ItemCommand not firing w/ a control in ItemTemplate column

S

Sal

I 've been dealing with this problem for a while now.
I have a datagrid in which one column is a template column, encompassing
textboxes (1 hidden, 1 visible) and bound to the same data source column.
Also the footer contains a button to save contents of the textboxes.
Viewstate is on.
I also have a custom header row that I place on the grid:
This line instantiates the custom row: Dim DGHeaderRow As New
DataGridItem(-1, 0, ListItemType.Header)
This line adds the custom row to the datagrid:
DGPrtTrk.Controls(0).Controls.AddAt(0, DGHeaderRow)
What I'm finding is that the custom row will interfere with how the template
column's footer button works. Upon 1st click of this button, to save the
contents of the textboxes, the page reloads but the itemcommand event
doesn't fire. The page comes back and all of the item rows contents are
shifted down one row, so the last item row's contents are in the footer row.
Upon 2nd click of this button the page reloads and the itemcommand event now
does fire. Also the gird appears how it should appear, all item rows in
their right place.
If I comment out the custom row code while keeping everything else the same,
the itemcommand event fires on the first try, everytime.
Does anyone know why this is happening or even experienced this?
Sal
 
R

Rick Spiewak

Is this new header row in addition to the existing one? I'm not sure that
works. Why not just manipulate the contents of the existing header row.
 
S

Sal

Yes this row is in addition to one already there. I need it to apply a
label that spans 2 or more rows. Sort of a grouping if you will. The row
def works but it interferes with itemtemplates in the grid.
S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top