Question about GridDropDownColumn

3 posts, 0 answers
  1. J
    J avatar
    143 posts
    Member since:
    Jun 2006

    Posted 30 Mar 2010 Link to this post

    I have a RadGrid with a GridDropDown column:

    <telerik:RadGrid ID="DGrid" runat="server" AutoGenerateColumns="False" 
        Width="100%" AllowAutomaticDeletes="True" GridLines="None" OnItemDataBound="DGrid_ItemDataBound" 
        OnNeedDataSource="DGrid_NeedDataSource" OnInsertCommand="DGrid_InsertCommand" 
        OnUpdateCommand="DGrid_UpdateCommand" OnDeleteCommand="DGrid_DeleteCommand" 
        AllowMultiRowEdit="false">  
        <mastertableview commanditemdisplay="Bottom" editmode="InPlace">  
            <HeaderStyle Wrap="false" /> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridDropDownColumn DataField="Id" UniqueName="Id" 
                    ListValueField="SystemID" ListTextField="SystemName" HeaderText="D" 
                    ItemStyle-Wrap="false" ItemStyle-Font-Names="Arial" ItemStyle-Width="500px">  
                       <ItemStyle Font-Names="Arial" /> 
                </telerik:GridDropDownColumn> 
                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" ButtonType="LinkButton" > 
                </telerik:GridButtonColumn> 
            </Columns> 
        </mastertableview> 
        <clientsettings> 
            <Selecting AllowRowSelect="false" /> 
        </clientsettings> 
    </telerik:RadGrid> 

    My questions are:
    How do I specify that the box that holds the values in the dropdownlist needs to be X pixels wide?
    The text that shows up in the RadCombobox, how do you set the style? 

    Just not sure where to find the answers.

    J
  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 30 Mar 2010 Link to this post

    This help article should be of use to you:


    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 31 Mar 2010 Link to this post

    Hello,

    You can specify the width of RadComboBox in pixels using the Unit.Pixel property and the text in RadComboBox can be styled by using the radcombo properties ForeColor, Font, Bold etc. Check out the sample code below.

    C#:

    protected
     void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
      if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
      {             
        GridEditableItem editedItem = e.Item as GridEditableItem; 
        RadComboBox radComboBox = (RadComboBox)editedItem["GridDropDownColumn1"].Controls[0];   
        radComboBox.Width = Unit.Pixel(500); 
        radComboBox.ForeColor = System.Drawing.Color.Red; 
        radComboBox.Font.Bold = true
      } 
    You can find a related topic here: Change the appearance of the Input element

    Regards,
    Princy.
Back to Top