or

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
|
[FormatException: The string was not recognized as a valid format.] |
| <telerik:GridNumericColumn HeaderText="Order Total" DataField="order_total" NumericType="Currency" AllowFiltering="true" SortExpression="order_total" AllowSorting="true" /> |
<asp:DropDownList ID="AddressDropDownList" runat="server" DataSourceID="AddressSqlDataSource" DataTextField="adrFullname" DataValueField="adrIdx" AppendDataBoundItems="True" AutoPostBack="True"> <asp:ListItem Value="" Text="--All--"></asp:ListItem></asp:DropDownList><telerik:RadComboBox ID="xrcarCarIdxRadComboBox" runat="server" DataSourceID="CarrierListSQLDataSource" DataTextField="carName" DataValueField="carIdx" SelectedValue='<%# Bind("xrcarCarIdx") %>' Width="300" HighlightTemplatedItems="true"> <ItemTemplate> <asp:Label runat="server" ID="CarrierListLabel" > <b><%# Eval("carName") %></b><br /><%# Eval("carAddress")%><br /><%# Eval("carCSZ")%> </asp:Label> </ItemTemplate></telerik:RadComboBox><telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all" ></telerik:RadFormDecorator>RadGrid1.MasterTableView.FilterExpression =
"ParentID is null "
The code is modeled after the sample here
I can get it to work without the FilterExpression, but all items show up under the main grid, and then again as children. It seems very simple, but I must be missing something.
<telerik:GridBoundColumn DataField="CommunicationModule" HeaderText="CommunicationModule" UniqueName="CommunicationModule" ></telerik:GridBoundColumn> <telerik:GridTemplateColumn DataField="Module" HeaderText="Module" UniqueName="Module" ItemStyle-Width="400px"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "Module")%> </ItemTemplate> <EditItemTemplate> <telerik:RadComboBox runat="server" ID="cboModule"> </telerik:RadComboBox> </EditItemTemplate> </telerik:GridTemplateColumn>protected void RadGridCU_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.IsInEditMode) { if (!(e.Item is IGridInsertItem)) //Is this a new item? { GridEditFormItem item = (GridEditFormItem)e.Item; RadComboBox cmb = (RadComboBox)item.FindControl("cboModule"); cmb.DataSource = //Here I have logic to set the datasource (works); cmb.DataTextField = "Name"; cmb.DataValueField = "OID"; //I tried to use //item["CommunicationModule"].Text.ToString(); //But to get it to work, I needed to create helper class and then cast the dataitem.. cmb.SelectedValue = ((MyGridHelperClass)e.Item.DataItem).CommunicationModule.ToString(); cmb.DataBind(); } } }