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

How to reduce the width of combobox

3 Answers 55 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Anupama
Top achievements
Rank 1
Anupama asked on 21 Mar 2011, 09:34 PM
Currently it has a width assigned via stylesheet to 160px. How can I change this?

3 Answers, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 21 Mar 2011, 09:52 PM
Hello Anupama,

Please use the Width property of the RadComboBox to change the control width.

Kind regards,
Kalina
the Telerik team
0
Anupama
Top achievements
Rank 1
answered on 22 Mar 2011, 08:07 AM
Thanks. How do I do the same for telerik:GridDropDownColumn in edit mode?
0
Shinu
Top achievements
Rank 2
answered on 22 Mar 2011, 08:55 AM
Hello Anupama,

You can set the width of the control after accessing it from in the edit mode like below.
C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
  if (e.Item is GridEditFormItem && e.Item.IsInEditMode)//Check whether grid is in edit mode
   {
      GridEditFormItem editItem = (GridEditFormItem)e.Item;
      RadComboBox combo1= (RadComboBox)editItem["ColumnUniqueName"].Controls[0];//accessing the control with column unique name
      combo1.Width = Unit.Pixel(20);
   }
}

MarkUp:
<telerik:GridDropDownColumn DataField="LastName"  UniqueName="ColumnUniqueName"  ListTextField="LastName"  ListValueField="LastName">
</telerik:GridDropDownColumn>

Thanks,
Shinu.
Tags
ComboBox
Asked by
Anupama
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Anupama
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or