Ok I've been struggling with this all day and have been all over this site and forums and can't crack this one. I think the issue is I do not know the proper syntax for the regular expression but not sure. It is a bool field that is populating a GridBoundColumn. The text that appears in the results is "True" or "False"
So the use case is to auto default my grid to show only records where the Active field equals true. The grid was populating successfully everything was working beautifully up until I tired to add the default filter.
(some irrelevant code has been removed for privacy)
Code behind
error message
Exception Details: Telerik.Web.UI.ParseException: No property or field 'Active' exists in type 'DataRowView'
Additional syntax that has been tried but was also unsuccessful
[Active] = 'true'
[Active] = 'True'
Active = 'true'
Active = True
[Active] EqualTo 'true'
[Active] EqualTo 'True'
[Active] EqualTo true
[Active] EqualTo True
Any help would be great!
~Mike
So the use case is to auto default my grid to show only records where the Active field equals true. The grid was populating successfully everything was working beautifully up until I tired to add the default filter.
(some irrelevant code has been removed for privacy)
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" CellSpacing="0" GridLines="None" PageSize="25" Skin="Windows7" Width="100%" AutoGenerateColumns="False" OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated" OnItemCommand="RadGrid1_ItemCommand" OnNeedDataSource="RadGrid1_NeedDataSource" OnInit="RadGrid1_Init" OnInsertCommand="RadGrid1_ItemCommand"> <ExportSettings ExportOnlyData="True" OpenInNewWindow="True" FileName="DataExport" IgnorePaging="True" Excel-FileExtension="xls" Excel-Format="ExcelML"> <Excel Format="ExcelML"></Excel> </ExportSettings> <MasterTableView IsFilterItemExpanded="True" CommandItemDisplay="Top" > <CommandItemSettings ShowAddNewRecordButton="true" ShowExportToExcelButton="True" ShowExportToCsvButton="True" AddNewRecordText="Add" /> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="Active" FilterControlAltText="Filter Active column" HeaderText="Active" FilterControlWidth="65%" UniqueName="Active" DataType="System.Boolean"> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView> <FilterMenu EnableImageSprites="False"> </FilterMenu> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"> </HeaderContextMenu> </telerik:RadGrid> Code behind
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { RadGrid1.DataSource = MyInfo.Get(); if (!Page.IsPostBack) { RadGrid1.MasterTableView.FilterExpression = "(Active = true)"; GridColumn col = RadGrid1.MasterTableView.GetColumnSafe("Active"); col.CurrentFilterFunction = GridKnownFunction.EqualTo; col.CurrentFilterValue = "true"; } } error message
Server Error in '/' Application.
No property or field 'Active' exists in type 'DataRowView'
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: Telerik.Web.UI.ParseException: No property or field 'Active' exists in type 'DataRowView'
Additional syntax that has been tried but was also unsuccessful
[Active] = 'true'
[Active] = 'True'
Active = 'true'
Active = True
[Active] EqualTo 'true'
[Active] EqualTo 'True'
[Active] EqualTo true
[Active] EqualTo True
Any help would be great!
~Mike