Hello,
I am trying to filter a column in a radgrid with a custom filter template, based on the id´s of the objects and not the display names (in some cases we have entries with the name / display name)
My Code is:
Unfortunately the filtering does not work because my entity data source get athe following filterexpression from the grid (seen in debug mode):
RadGrid1.MasterTableView.FilterExpression = "(it.Accountrole.Name = \"1\")"
but it should be:
RadGrid1.MasterTableView.FilterExpression = "(it.Accountrole.RoleId= \"1\")"
How can I tell the Grid to generate the correct filter expression?
Thanks in advance!
I am trying to filter a column in a radgrid with a custom filter template, based on the id´s of the objects and not the display names (in some cases we have entries with the name / display name)
My Code is:
<
telerik:GridBoundColumn
AllowFiltering
=
"true"
AllowSorting
=
"true"
DataField
=
"Accountrole.Name"
HeaderText="<%$ Resources:Administration,Role %>" UniqueName="Accountrole.RoleId">
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBoxRole"
DataSourceID
=
"RoleDataSource"
DataTextField
=
"Name"
DataValueField
=
"RoleId"
AppendDataBoundItems
=
"true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Accountrole.RoleId").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="RoleIndexChanged">
<
Items
>
<
telerik:RadComboBoxItem
Text="<%$ Resources:Basic,All %>" />
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function RoleIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("Accountrole.RoleId", args.get_item().get_value(), "EqualTo");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
Unfortunately the filtering does not work because my entity data source get athe following filterexpression from the grid (seen in debug mode):
RadGrid1.MasterTableView.FilterExpression = "(it.Accountrole.Name = \"1\")"
but it should be:
RadGrid1.MasterTableView.FilterExpression = "(it.Accountrole.RoleId= \"1\")"
How can I tell the Grid to generate the correct filter expression?
Thanks in advance!