
Get an Item.ItemIndex of controls other than supporting CommandName inside composite controls
All right - I found another solution : looping through DataGridItems and
matching controls ...
Radek
Quote:
> Hello All
> Scenario : inside composite controls like DataGrid/DataList/Repeater we
> populate DropDownLists or CheckBoxes. Those controls do AutoPostBacks.
They
> have a proper events assigned (for DropDownList - SelectedIndexChanged)
> either on ItemCreated or Html level. Let's narrow it to DropDownLists -
> SelectedIndexChanged fires properely as bubbled event. Inside that event
we
> need to know to what row of the parent DataGrid this control belongs to.
By
> its nature DropDownList doesn't support any CommandName property which
> concludes we can't use composite controls' ItemCommand event to get child
> controls' Item.ItemIndex. Question : what would be the best way to get
> Item.ItemIndex (ex. DataGrid's row) of the DropDownList control fired
inside
> composite control (like DataGrid) ? The way I'm doing it seems to be very
> cumbersome (I extract it from UniqueID). Any suggestions ?
> I appreciate
> Radek