Click here to Skip to main content
16,014,591 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
RadComboBox comboBox = (RadComboBox)editItem[dtBoundColumn.ColumnName].Controls[0];


what it means
where columnname=opname.

what is edititem here,and

C#
GridEditableItem editItem = e.Item as GridEditableItem; 


is editItem object of GridEditableItem?
Posted
Updated 15-Nov-11 19:30pm
v2
Comments
Mehdi Gholam 16-Nov-11 1:30am    
EDIT -> fixed formatting
[no name] 16-Nov-11 1:40am    
It means you should spend some time reading the documentation

1 solution

a gridview row can have multiple modes (templates)
1) like when the row is in Display mode its different (ItemTemplate).
2) when the row is in Edit mode its different (GridEditableItemTemplate)

RadComboBox is thirtparty combobox control, by Telerik.

C#
RadComboBox comboBox = (RadComboBox)editItem[dtBoundColumn.ColumnName].Controls[0];


in the above line, you are trying to acces combobox control, placed inside your gridview row, while grid row is in edit mode.

if you put a combobox inside a gridview (parent -> child), to access the child controls you have to search them inside the row items, and you have to type cast it to original type after searching.

C#
GridEditableItem editItem = e.Item as GridEditableItem; 


Yes, editItem is a row Item while in Edit mode.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900