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

set properties on the radcombobox in a griddropdowncolumn

1 Answer 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 2
Bill asked on 11 Feb 2010, 08:19 PM
Is there a simple way to set properties (like the width) of the radcombobox in a griddropdowncolumn?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Feb 2010, 05:23 AM
Hi Bill,

You can access the RadComboBox control from code and set the required properties as shown below.
 
cs:
 
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
        { 
            GridEditableItem editItem = (GridEditableItem)e.Item; 
            RadComboBox combo = (RadComboBox)editItem["DropDownColumn"].Controls[0]; 
            combo.Width = Unit.Pixel(400); 
        } 
    } 

aspx:
 
<telerik:GridDropDownColumn UniqueName="DropDownColumn" DataField="Age" DataSourceID="SqlDataSource1" 
    HeaderText="DropDownColumn" ListTextField="Age" ListValueField="Age"
</telerik:GridDropDownColumn> 

-Shinu.
Tags
Grid
Asked by
Bill
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or