How to reduce the width of combobox

4 posts, 0 answers
  1. Anupama
    Anupama avatar
    2 posts
    Member since:
    Mar 2011

    Posted 21 Mar 2011 Link to this post

    Currently it has a width assigned via stylesheet to 160px. How can I change this?

  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 21 Mar 2011 Link to this post

    Hello Anupama,

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

    Kind regards,
    Kalina
    the Telerik team
  3. Anupama
    Anupama avatar
    2 posts
    Member since:
    Mar 2011

    Posted 22 Mar 2011 Link to this post

    Thanks. How do I do the same for telerik:GridDropDownColumn in edit mode?
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Mar 2011 Link to this post

    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.
Back to Top