D
DC
Hi,
I am doing something like this in the ItemCreated event (ASP.Net 1.1):
DataGridItem pagerRow = e.Item;
TableCell pagerCell = pagerRow.Cells[0];
Control addedControl = new Control();
addedControl.ID = "addedControl";
pagerCell.Controls.Add(addedControl);
Now I want to include some Javascript code that is using addedControl
and I therefore need to know the ClientID of addedControl.
The only way I found to get the ClientID is to locate (by traversing
the tree in the DataGrid's PreRender event) a control in the DataGrid
control tree whose name ends with "addedControl". I will then be able
to get the ClientID which usully looks like MyGrid_ctl0_addedControl or
something like this.
But this is so lame. I would be thankful for any hint on a better
approach.
Regards
DC
I am doing something like this in the ItemCreated event (ASP.Net 1.1):
DataGridItem pagerRow = e.Item;
TableCell pagerCell = pagerRow.Cells[0];
Control addedControl = new Control();
addedControl.ID = "addedControl";
pagerCell.Controls.Add(addedControl);
Now I want to include some Javascript code that is using addedControl
and I therefore need to know the ClientID of addedControl.
The only way I found to get the ClientID is to locate (by traversing
the tree in the DataGrid's PreRender event) a control in the DataGrid
control tree whose name ends with "addedControl". I will then be able
to get the ClientID which usully looks like MyGrid_ctl0_addedControl or
something like this.
But this is so lame. I would be thankful for any hint on a better
approach.
Regards
DC