Hi,
I have the following grid:
<TELERIK:RADGRID ID="RadGridProductCharacteristics" runat="server" AutoGenerateColumns="false" AllowAutomaticUpdates="true" OnItemUpdated="RadGridProductCharacteristics_ItemUpdated" OnItemDataBound="RadGridProductCharacteristics_ItemDataBound" OnItemCommand="RadGridProductCharacteristics_ItemCommand" OnPreRender="RadGridProductCharacteristics_PreRender">
<CLIENTSETTINGS AllowGroupExpandCollapse="true" />
<MASTERTABLEVIEW DataKeyNames="CharacteristicID" GroupLoadMode="Client" CommandItemDisplay="Top" EditMode="Batch">
<BATCHEDITINGSETTINGS EditType="Cell" />
<GROUPBYEXPRESSIONS>
<TELERIK:GRIDGROUPBYEXPRESSION>
<GROUPBYFIELDS>
<TELERIK:GRIDGROUPBYFIELD FieldName="ParentCharacteristicName" />
</GROUPBYFIELDS>
<SELECTFIELDS>
<TELERIK:GRIDGROUPBYFIELD FieldName="ParentCharacteristicName" HeaderText="Parent Characteristic" />
</SELECTFIELDS>
</TELERIK:GRIDGROUPBYEXPRESSION>
</GROUPBYEXPRESSIONS>
<COLUMNS>
<TELERIK:GRIDBOUNDCOLUMN HeaderText="Characteristic" DataField="CharacteristicName" ReadOnly="true" />
<TELERIK:GRIDBOUNDCOLUMN UniqueName="CharacteristicValue" HeaderText="Value" DataField="CharacteristicValue" />
<TELERIK:GRIDTEMPLATECOLUMN HeaderText="Color" UniqueName="CharacteristicColor" DataField="CharacteristicColor">
<ITEMTEMPLATE>
<%# Eval("CharacteristicColor") %>
</ITEMTEMPLATE>
<EDITITEMTEMPLATE>
<TELERIK:RADDROPDOWNLIST runat="server" ID="RadDropDownListColor" />
</EDITITEMTEMPLATE>
</TELERIK:GRIDTEMPLATECOLUMN>
<TELERIK:GRIDBUTTONCOLUMN UniqueName="ImageButtonDelete" HeaderText="Action" ButtonType="ImageButton" ImageUrl="~/Resources/Images/icon_delete.png" CommandName="Delete" />
</COLUMNS>
</MASTERTABLEVIEW>
</TELERIK:RADGRID>
I would like to fill the RadDropDownListColor so it is filled when the user clicks the cell to edit the value.
I checked this article: Column Editors and from there I derived the following code:
protected void RadGridProductCharacteristics_PreRender(object sender, EventArgs e)
{
GridTableView masterTable = (sender as RadGrid).MasterTableView;
RadDropDownList radDropDownListColor = masterTable.GetBatchColumnEditor("CharacteristicColor") as RadDropDownList;
radDropDownListColor.DataSource = DBCom.GetHTMLColors();
radDropDownListColor.DataTextField = "HTMLColorName";
radDropDownListColor.DataValueField = "HTMLColorCode";
radDropDownListColor.DataBind();
radDropDownListColor.Items.Insert(0, new DropDownListItem("", "0"));
}
But still the variable radDropDownListColor is null.
What am I doing wrong?
I am creating a mobile website using radcomboboxes inside of update controls that are set to autopostback = true. All of the controls work except on the page's initial load the UI elements are enlarged and look more like buttons. They are still able to be selected and after the controls postback the elements still do not go back to a normal size. Only after a postback from another control do the UI elements shrink down to a normal size.
I have tested the radcombobox with checkboxes enabled outside of the update panel and this behavior does not change. I have a master page that contains jQuery files located in the header, and when I remove one of the js files, the problem disappears with the UI elements disappearing. Can anyone help me figure out what is preventing the UI elements from rendering properly?
On Load:
After postback: