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

[Solved] GridBoundColumn,GridDropDownListColumnEditor

4 Answers 289 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ahmad
Top achievements
Rank 1
ahmad asked on 27 Mar 2009, 11:13 AM

Hi Telerik Team,

    I created my RadGrid dynamically without creating its columns and its data source is datatable.
    I need to change the default GridTextBoxColumnEditor into GridDropDownListColumnEditor.
    Please Help !

Regards,
Ahmad

4 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 31 Mar 2009, 10:24 AM
Hello ahmad,

Pleae, review the following online example on using column editors: Grid/Using column editors, and if it is not relevant to your implementation, could you provide more details on your scenario.

Thank you.

Best Regards,
Tsvetoslav
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
ahmad
Top achievements
Rank 1
answered on 31 Mar 2009, 12:35 PM
Hello Telerik,
         Can i write this:
              
protected void RadGrid1_CreateColumnEditor(object sender, Telerik.Web.UI.GridCreateColumnEditorEventArgs e)
{
 
if ( e.Column is GridBoundColumn )
 {
   
if ( (e.Column as GridBoundColumn).DataField == "Country" )
   {
      e.ColumnEditor =
new GridDropDownListColumnEditor();
   }
  

 }
}


That is i replace MultiLineTextBoxColumnEditor by GridDropDownListColumnEditor.
It gave me error.

Regards,
Ahmad
0
Princy
Top achievements
Rank 2
answered on 01 Apr 2009, 06:18 AM
Hello Ahmad,

Generally a GridBoundColumn would accept only editors of the type GridTextColumnEditor. So if you require to display a DropDownList for a specific column when its in EditMode, then i would suggest you to either use a GridTemplateColumn with a Label in its ItemTemplate and a DropDownList in its EditItemTemplate or use a GridDropDownColumn which automatically displays data as in GridBoundColumn when in normal mode and displays a dropdownlist when in edit mode. You can also refer to the following document to understand better the diffferent types of columns:
Column types

Thanks
Princy.
0
ahmad
Top achievements
Rank 1
answered on 01 Apr 2009, 03:51 PM
Thank You.
Tags
Grid
Asked by
ahmad
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
ahmad
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or