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

Question about GridDropDownColumn

2 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 30 Mar 2010, 03:15 PM

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 Answers, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 30 Mar 2010, 03:36 PM
This help article should be of use to you:


I hope that helps.
0
Princy
Top achievements
Rank 2
answered on 31 Mar 2010, 07:51 AM
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.
Tags
Grid
Asked by
J
Top achievements
Rank 1
Answers by
robertw102
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or