Get an Item.ItemIndex of controls other than supporting CommandName inside composite controls 
Author Message
 Get an Item.ItemIndex of controls other than supporting CommandName inside composite controls

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



Mon, 20 Dec 2004 06:30:30 GMT  
 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



Mon, 20 Dec 2004 08:13:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Does List Control Support Images in Sub Items

2. getting key events from inside an ActiveX control hosted in a CView

3. Getting a CWnd parent inside my ActiveX control...

4. Getting an item from a Tree Control using HTREEITEM

5. Positioning Controls/Getting CWnd* for Dlg items

6. gets() question and others

7. sending/getting messages to others windows

8. At design time which control is over others

9. how to write a base Control which others will inherit

10. does atl support try..catch block?(empty inside)

11. Any support for Telnet inside MFC?

12. ActiveX control inside another activex control

 

 
Powered by phpBB® Forum Software