This is a migrated thread and some comments may be shown as answers.

[Solved] How to insert selected value from GridDropDownColumn that resides in RadGrid

1 Answer 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kem Arda
Top achievements
Rank 1
Kem Arda asked on 20 Oct 2009, 07:25 AM
I have a GridDropDownColumn and i insert ( in event RadGrid1_InsertCommand) selected value from GridDropDownColumn into a collection(here a llblgen collection-never mind this.) Each time i insert (so-called) the selected value, first item in GridDropDownColumn is inserted in code behind.

Here is how i get the selected value:

//e here is GridCommandEventArgs e 
GridEditableItem eeditedItem = e.Item as GridEditableItem; 
Hashtable newnewValues = new Hashtable(); 
//The GridTableView will fill the values from all editable columns in the hash 
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
//here newValues always stores the first item from the GridDropDownColumn



  <telerik:GridDropDownColumn DataField="HizmetId" DataSourceID="LLBLGenProDataSourceHizmet" 
                        HeaderText="Hizmet Adı" ListTextField="HizmetAdi" ListValueField="HizmetId" 
                        UniqueName="HizmetId" ColumnEditorID="GridDropDownColumnEditor1"  > 
                    <ItemStyle Width="400px"></ItemStyle> 
                    </telerik:GridDropDownColumn> 

Thanks...

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Oct 2009, 01:34 PM
Hi Kem Arda,

Try using column editors in order to get the value from insert form. For more information, checkout Example 2 in the following documentation.
Inserting values in-place and EditForms

Thanks,
Princy.
Tags
Grid
Asked by
Kem Arda
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or