When I edit a record with a RadCombox control in RadGrid, the height of dropdown item is so height(in attached image). Normaill, if the RadCombox bound two record, it should only show the height of two record. Don't know why it sill have so many blank space?
My Code is:
protected void RadGridFunction_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
if ((e.Item as GridEditableItem).IsInEditMode)
{
GridEditManager editMan = editedItem.EditManager;
GridDropDownListColumnEditor editor = editMan.GetColumnEditor("RuleType") as GridDropDownListColumnEditor;
RadComboBox ddl = (RadComboBox)editedItem["RuleType"].Controls[0];
ddl.Width = Unit.Pixel(100);
ddl.Items.Add(new RadComboBoxItem("dd1"));
ddl.Items.Add(new RadComboBoxItem("dd2"));
}
}
}
<telerik:GridDropDownColumn DataField="RuleType" UniqueName="RuleType"
HeaderText="Rule Type" ItemStyle-Width="100px">
<FilterTemplate>
<telerik:RadComboBox runat="server" Width="100px" ID="RadComboBoxRuleType" AutoPostBack="true">
</telerik:RadComboBox>
</FilterTemplate>
</telerik:GridDropDownColumn>
My Code is:
protected void RadGridFunction_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
if ((e.Item as GridEditableItem).IsInEditMode)
{
GridEditManager editMan = editedItem.EditManager;
GridDropDownListColumnEditor editor = editMan.GetColumnEditor("RuleType") as GridDropDownListColumnEditor;
RadComboBox ddl = (RadComboBox)editedItem["RuleType"].Controls[0];
ddl.Width = Unit.Pixel(100);
ddl.Items.Add(new RadComboBoxItem("dd1"));
ddl.Items.Add(new RadComboBoxItem("dd2"));
}
}
}
<telerik:GridDropDownColumn DataField="RuleType" UniqueName="RuleType"
HeaderText="Rule Type" ItemStyle-Width="100px">
<FilterTemplate>
<telerik:RadComboBox runat="server" Width="100px" ID="RadComboBoxRuleType" AutoPostBack="true">
</telerik:RadComboBox>
</FilterTemplate>
</telerik:GridDropDownColumn>