Check out the code below |
protected void MetadataRadGrid_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
{ |
GridEditableItem gridEditableItem = (GridEditableItem)e.Item; |
GridEditManager gridEditManager = gridEditableItem.EditManager; |
ArrayList metadataTypeArrayList = new ArrayList(); |
metadataTypeArrayList.Add("Boolean"); |
metadataTypeArrayList.Add("Int"); |
metadataTypeArrayList.Add("String"); |
GridDropDownColumnEditor gridDropDownColumnEditor = (GridDropDownColumnEditor)gridEditManager.GetColumnEditor("MetadataType"); |
gridDropDownColumnEditor.DataSource = metadataTypeArrayList; |
gridDropDownColumnEditor.DataBind(); |
} |
} |
<telerik:GridDropDownColumn UniqueName="MetadataType" DataField="MetadataType" HeaderText="MetadataType" SortExpression="MetadataType" > |
</telerik:GridDropDownColumn> |
hi,
i am using GridDropDownColumn in radgrid and facing some problems
Firstly GridDropDownColumn is not displaying the datafield value.
I have defined datafield datatext properties of the GridDropDownColumn so that it can pick the values of RadGrid datasource and display it when ever the grid displaying the data in read mode.
I also have populated GridDropDownColumn if it is in editable state with a hashtable in ItemDataBound event of RadGrid.Means it will only be populated with hashtable in edit mode or add mode.
How ever when i add a new record in the grid and press ok...it shows me all the data values in this GridDropDownColumn field.
Please tell me the solution of this problem
Secondly tell me the way how can i store some values in this GridDropDownColumn in ItemCommand event when in edit mode.
Reply me ASAP.