<AjaxSettings> <telerik:AjaxSetting AjaxControlID="btnViewUpdate"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="lblViewName" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings>
protected override void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); Grid = new RadGrid(); // actually this is not RadGrid but descendant class I created Grid.Initialize(ZSheet, ForceLoad, DataSourceProvider, this); // create columns runtime ZSheetContainer.Controls.Add(Grid); GridFilter.Initialize(ZSheet, Grid.ZTable.TableNameUser); if (IsPostBack) GridFilter.ApplyFilter(); // create and apply filter expressions obtained from different source, see below }
public void ApplyFilter() { if (string.IsNullOrWhiteSpace(_hf.Value)) return; List<GridFilterItem> filterItems = new JavaScriptSerializer().Deserialize<List<GridFilterItem>>(_hf.Value); foreach (GridFilterItem item in filterItems) { ZSheetItem zitem = _table.Structure.FirstOrDefault(t => t.f_name == item.Condition.ColumnID); Type columnType = GetColumnType(zitem); Type filterExpressionType; Type[] types = new[] { columnType }; switch (item.Condition.Operator) { case GridKnownFunction.Contains: filterExpressionType = typeof(RadFilterContainsFilterExpression); break; case GridKnownFunction.DoesNotContain: filterExpressionType = typeof(RadFilterDoesNotContainFilterExpression); break; case GridKnownFunction.StartsWith: filterExpressionType = typeof(RadFilterStartsWithFilterExpression); break; case GridKnownFunction.EndsWith: filterExpressionType = typeof(RadFilterEndsWithFilterExpression); break; case GridKnownFunction.EqualTo: filterExpressionType = typeof(RadFilterEqualToFilterExpression<>); break; case GridKnownFunction.NotEqualTo: filterExpressionType = typeof(RadFilterNotEqualToFilterExpression<>); break; case GridKnownFunction.GreaterThan: filterExpressionType = typeof(RadFilterGreaterThanFilterExpression<>); break; case GridKnownFunction.LessThan: filterExpressionType = typeof(RadFilterLessThanFilterExpression<>); break; case GridKnownFunction.GreaterThanOrEqualTo: filterExpressionType = typeof(RadFilterGreaterThanOrEqualToFilterExpression<>); break; case GridKnownFunction.LessThanOrEqualTo: filterExpressionType = typeof(RadFilterLessThanOrEqualToFilterExpression<>); break; case GridKnownFunction.Between: filterExpressionType = typeof(RadFilterBetweenFilterExpression<>); types = new[] { columnType, columnType }; break; case GridKnownFunction.NotBetween: filterExpressionType = typeof(RadFilterNotBetweenFilterExpression<>); types = new[] { columnType, columnType }; break; case GridKnownFunction.IsEmpty: filterExpressionType = typeof(RadFilterIsEmptyFilterExpression); break; case GridKnownFunction.NotIsEmpty: filterExpressionType = typeof(RadFilterNotIsEmptyFilterExpression); break; case GridKnownFunction.IsNull: filterExpressionType = typeof(RadFilterIsNullFilterExpression); break; case GridKnownFunction.NotIsNull: filterExpressionType = typeof(RadFilterNotIsNullFilterExpression); break; default: filterExpressionType = typeof(RadFilterEqualToFilterExpression<>); break; } Type genericType = filterExpressionType.MakeGenericType(types); RadFilterExpression expression = (RadFilterExpression)Activator.CreateInstance(genericType, item.Condition.ColumnID); _filter.RootGroup.AddExpression(expression); }Now about the problem. When I call ApplyFilter from Page_Load() method, it raises a NullReferenceException in RadFilterDataEditor._filter.FireApplyCommand();}
CreateEditorFrom() method. When I call it from Page_Init() right after grid is initialized, filter won't apply. What am I doing wrong?<EditFormSettings EditFormType="Template"> <FormTemplate> <table width="100%"> <tr> <td style="width:10%" align="right">Mac Type: </td> <td style="width:15%" align="left"><asp:DropDownList ID="ddlMacType" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td> <td style="width:10%" align="right">SSN: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtSSN" runat="server" Width="200px" Text='<%# Bind("strSSN") %>'></asp:TextBox></td> <td style="width:10%" align="right">EDIPI: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtEDIPI" runat="server" Width="200px" Text='<%# Bind("strEDIPI") %>'></asp:TextBox></td> <td style="width:10%" align="right">AKO Logon: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtAKO" runat="server" Width="200px" Text='<%# Bind("strAkoLogon") %>'></asp:TextBox></td> </tr> <tr> <td style="height:5px"></td> </tr> <tr> <td style="width:10%" align="right">LName: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtLName" runat="server" Width="200px" Text='<%# Bind("strLName") %>'></asp:TextBox></td> <td style="width:10%" align="right">FName: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtFname" runat="server" Width="200px" Text='<%# Bind("strFname") %>'></asp:TextBox></td> <td style="width:10%" align="right">MI: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtMI" runat="server" Width="200px" Text='<%# Bind("strMI") %>'></asp:TextBox></td> <td style="width:10%" align="right">Gen Qual: </td> <td style="width:15%" align="left"><asp:DropDownList ID="ddlGenQual" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td> </tr> <tr> <td style="height:5px"></td> </tr> <tr> <td style="width:10%" align="right">Emp Type: </td> <td style="width:15%" align="left"><asp:DropDownList ID="ddlEmpType" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td> <td style="width:10%" align="right">Rank/Salutation: </td> <td style="width:15%" align="left"><asp:DropDownList ID="ddlSalutation" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td> <td style="width:10%" align="right">Job Title: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtJobTitle" runat="server" Width="200px" Text='<%# Bind("strJobTitle") %>'></asp:TextBox></td> <td style="width:10%" align="right">Pick Unit: </td> <td style="width:15%" align="left"><asp:DropDownList ID="ddlunit" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td> </tr> <tr> <td style="height:5px"></td> </tr> <tr> <td style="width:10%" align="right">Requires Email: </td> <td style="width:15%" align="left"><asp:CheckBox ID="cbEmail" runat="server" Checked='<%# Bind("bitEmail") %>' /></td> <td style="width:10%" align="right">Military Phone: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtPhone" runat="server" Width="200px" Text='<%# Bind("strPhoneNumber") %>'></asp:TextBox></td> <td style="width:10%" align="right">Requires LD: </td> <td style="width:15%" align="left"><asp:CheckBox ID="cbLD" runat="server" Checked='<%# Bind("bitLongDistance") %>' /></td> <td style="width:10%" align="right">Requires VM: </td> <td style="width:15%" align="left"><asp:CheckBox ID="cbVM" runat="server" Checked='<%# Bind("bitVoiceMail") %>' /></td> </tr> <tr> <td style="height:5px"></td> </tr> <tr> <td style="width:10%" align="right"></td> <td style="width:15%" align="left"></td> <td style="width:10%" align="right">Zero Out: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtZeroOut" runat="server" Width="200px" Text='<%# Bind("strVoiceExt") %>'></asp:TextBox></td> <td style="width:10%" align="right">Notes: </td> <td style="width:15%" align="left"><asp:TextBox ID="txtNotes" runat="server" Width="260px" TextMode="MultiLine" Height="60px" Text='<%# Bind("strNotes") %>'></asp:TextBox></td> <td style="width:10%" align="right"></td> <td style="width:15%" align="left"></td> </tr> <tr> <td style="height:5px"></td> </tr> </table> <table width="100%"> <tr> <td style="width:25%"></td> <td style="width:50%" align="center"> <asp:LinkButton ID="lnkSubmit" runat="server" text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'></asp:LinkButton> <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel"></asp:LinkButton> </td> <td style="width:25%"></td> </tr> </table> </FormTemplate> </EditFormSettings>If (e.CommandName = RadGrid.PerformInsertCommandName) Then End If If (e.CommandName = RadGrid.UpdateCommandName AndAlso e.Item.IsInEditMode) Then End ifConversion from type 'DBNull' to type 'Boolean' is not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Conversion from type 'DBNull' to type 'Boolean' is not valid. Source Error: Line 85: <tr> Line 86: <td style="width:10%" align="right">Requires Email: </td> Line 87: <td style="width:15%" align="left"><asp:CheckBox ID="cbEmail" runat="server" Checked='<%# Bind("bitEmail") %>' /></td> Line 88: <td style="width:10%" align="right">Military Phone: </td> Line 89: <td style="width:15%" align="left"><asp:TextBox ID="txtPhone" runat="server" Width="200px" Text='<%# Bind("strPhoneNumber") %>'></asp:TextBox></td> I am using Radgrid and have the following situation.
First GroupBy is Product and with in product it is grouped by City
| PRODUCT | Part A | Part B | |||
| Produc AA | |||||
| City: New York | |||||
| Conractor 1 | 10 | 20 | |||
| Cotnractor 2 | 12 | 8 | |||
| Cotnractor 3 | 22 | 20 | |||
| City Total | 44 | 48 | |||
| City:Chicago | |||||
| Cotnractor3 | 22 | 12 | |||
| contractor8 | 11 | 33 | |||
| Contactor 10 | 24 | 10 | |||
| City Total | 57 | 55 | |||
| Prodcut Total | 101 | 103 | |||
Eveything works fin about the total and also I am inserting the labels accordingly in the group footer.
I need to make my group footer more readble i.e it should say NewYork City Total and Chicago City Total in the inner group
and it should say Product AA Total for outr group rather that standard label
How do I access the groupby value from its Groupfooter.
Thanks for you help

<
asp:UpdatePanel id="pnluCompanyData" EnableViewState="true" runat="server" UpdateMode="Conditional"
RenderMode="Inline">
<contenttemplate>
<asp:PlaceHolder id="CtrlPlaceholder" EnableViewState="true" runat="server" ></asp:PlaceHolder>
</asp:UpdatePanel>
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
<AjaxSettings >
<telerik:AjaxSetting AjaxControlID="mvwDriver1" >
<UpdatedControls >
<telerik:AjaxUpdatedControl ControlID="divLoadingImageDriver" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<ClientEvents OnResponseEnd="Driver_ResponseEnd" OnRequestStart="ApplyFormCssClass(dDisablescreen)" />
</
telerik:RadAjaxManager>
<
telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
Width="75px">
<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
style="border: 0px;" />
</
telerik:RadAjaxLoadingPanel>