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

Width of dropdown

1 Answer 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Laura
Top achievements
Rank 1
Laura asked on 16 Sep 2008, 07:44 PM
I have a simple dropdown column. The aspx code for it is:
   
        <telerik:GridDropDownColumn DataField="package_id" HeaderText="Package" Display="true"  DataSourceID="ContentCentralPackages"
                               UniqueName="PackageName" ListTextField="package_name"  SortExpression="package_id"
                               ListValueField="package_id" EnableEmptyListItem="false" DropDownControlType="RadComboBox"
                                  AllowFiltering="true" ForceExtractValue="InEditMode" ItemStyle-Wrap="False" >

       </telerik:GridDropDownColumn>
      

I want the width of the dropdown to be as wide as my widest line of text in it.
I don't see anyway to set the width of the dropdown.

Thanks,
Laura

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Sep 2008, 04:40 AM
Hello Laura,
    You can access the DropDown and set its width as shown in the Code below.
cs:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode) 
        { 
            GridEditFormItem formItem = (GridEditFormItem)e.Item; 
            RadComboBox rdcbx = (RadComboBox)formItem["ColumnUniqueName"].Controls[0]; 
            rdcbx.Width = "200"; 
        } 
    } 

Princy.
Tags
Grid
Asked by
Laura
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or