Hi,
I'm having trouble having the grid filtered when it loads. My query lists all users, but I want it to only show users where IsActive = True, which is a checkbox. I used the example here as my template and it seems pretty straightforward. (The last example on the page pertains to checkboxes.)
According to the example, I added
to the checkbox column and it was just fine.
When I add
the grid fails to load and gives me a ParseException error (either "expected expression" with brackets around IsActive, or "No property or field 'IsActive' exists in type 'DataRowView'" without the brackets.
Thanks in advance!
Here is the grid & data source:
I'm having trouble having the grid filtered when it loads. My query lists all users, but I want it to only show users where IsActive = True, which is a checkbox. I used the example here as my template and it seems pretty straightforward. (The last example on the page pertains to checkboxes.)
According to the example, I added
CurrentFilterFunction
=
"EqualTo"
CurrentFilterValue
=
"True"
to the checkbox column and it was just fine.
When I add
FilterExpression
=
"([IsActive] = True)"
the grid fails to load and gives me a ParseException error (either "expected expression" with brackets around IsActive, or "No property or field 'IsActive' exists in type 'DataRowView'" without the brackets.
Thanks in advance!
Here is the grid & data source:
<
telerik:RadGrid
ID
=
"grd_UserAdmin"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
ShowGroupPanel
=
"True"
Skin
=
"Black"
AllowAutomaticInserts
=
"True"
ShowFooter
=
"True"
DataSourceID
=
"ds_UserAdmin"
>
<
ClientSettings
AllowColumnsReorder
=
"True"
AllowDragToGroup
=
"True"
ReorderColumnsOnClient
=
"True"
AllowKeyboardNavigation
=
"True"
ColumnsReorderMethod
=
"Reorder"
>
</
ClientSettings
>
<
MasterTableView
AllowAutomaticDeletes
=
"True"
AllowAutomaticUpdates
=
"True"
DataKeyNames
=
"UserName"
EditMode
=
"PopUp"
DataSourceID
=
"ds_UserAdmin"
FilterExpression
=
"([IsActive] = True)"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
>
<
ItemStyle
CssClass
=
"MyImageButton"
/>
</
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this user?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"clmDeleteColumn"
FilterControlAltText
=
"Filter clmDeleteColumn column"
>
<
ItemStyle
HorizontalAlign
=
"Center"
CssClass
=
"MyImageButton"
/>
</
telerik:GridButtonColumn
>
<
telerik:GridBoundColumn
DataField
=
"FirstName"
FilterControlAltText
=
"Filter FirstName column"
HeaderText
=
"First Name"
SortExpression
=
"FirstName"
UniqueName
=
"clmFirstName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"LastName"
FilterControlAltText
=
"Filter clmLastName column"
HeaderText
=
"Last Name"
SortExpression
=
"LastName"
UniqueName
=
"clmLastName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"UserName"
FilterControlAltText
=
"Filter clmUserName column"
HeaderText
=
"User Name"
SortExpression
=
"UserName"
UniqueName
=
"clmUserName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"IsActive"
DataType
=
"System.Boolean"
FilterControlAltText
=
"Filter clmIsActive column"
HeaderText
=
"Is Active?"
SortExpression
=
"IsActive"
UniqueName
=
"clmIsActive"
EditFormColumnIndex
=
"1"
CurrentFilterFunction
=
"EqualTo"
CurrentFilterValue
=
"True"
>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridBoundColumn
DataField
=
"LastActivityDate"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter clmLastActivityDate column"
HeaderText
=
"Last Activity Date"
SortExpression
=
"LastActivityDate"
UniqueName
=
"clmLastActivityDate"
EditFormColumnIndex
=
"1"
ReadOnly
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Email"
FilterControlAltText
=
"Filter Email column"
HeaderText
=
"E-Mail"
SortExpression
=
"Email"
UniqueName
=
"clmEmail"
EditFormColumnIndex
=
"1"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
<
telerik:GridDropDownListColumnEditor
ID
=
"GridDropDownColumnEditor1"
runat
=
"server"
DropDownStyle-Width
=
"110px"
>
</
telerik:GridDropDownListColumnEditor
>
<
asp:SqlDataSource
ID
=
"ds_UserAdmin"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:Alderman_ConnectionString %>"
SelectCommand="SELECT * FROM vw_Users"
DeleteCommand="sp_web_UserAdministration_del" DeleteCommandType="StoredProcedure">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"UserID"
Type
=
"Object"
/>
</
DeleteParameters
>
</
asp:SqlDataSource
>