Hey,
I have a RadGrid which is filtering (using dynamic LINQ), sorting and paging server side within the NeedDataSource event and everything is working perfectly. However, one of the properties I am binding to is a lookup to another table. This is workable, so in NeedDataSource I perform my lookup and set the value e.g. Say the property is called "CategoryID". I wish to display the category name as opposed to the ID. Because of this, I have the the filter template in my grid where the user can choose from a drop down list. The query will use the value "C1" for Category1 and so on (based on different text/value attributes in the RadComboBoxItem). My query runs fine (selects from table where CategoryID = 'C1') and returns results. Unfortunately, the Grid seems to being filtering client side after the results are returned (so it eliminates results that don't equal 'C1', which is everything). I can tell it's being done client side because:
1. I can put a break point in on the server and see my results after my filtering/sorting/paging.
2. If I name the CategoryID and Caterory name the same thing, the results display as expected.
3. The Grid actually displays the number of results and the correct page numbers successfully at the bottom.
Any help is much appreciated, I'm so close!
I have a RadGrid which is filtering (using dynamic LINQ), sorting and paging server side within the NeedDataSource event and everything is working perfectly. However, one of the properties I am binding to is a lookup to another table. This is workable, so in NeedDataSource I perform my lookup and set the value e.g. Say the property is called "CategoryID". I wish to display the category name as opposed to the ID. Because of this, I have the the filter template in my grid where the user can choose from a drop down list. The query will use the value "C1" for Category1 and so on (based on different text/value attributes in the RadComboBoxItem). My query runs fine (selects from table where CategoryID = 'C1') and returns results. Unfortunately, the Grid seems to being filtering client side after the results are returned (so it eliminates results that don't equal 'C1', which is everything). I can tell it's being done client side because:
1. I can put a break point in on the server and see my results after my filtering/sorting/paging.
2. If I name the CategoryID and Caterory name the same thing, the results display as expected.
3. The Grid actually displays the number of results and the correct page numbers successfully at the bottom.
Any help is much appreciated, I'm so close!
<
telerik:RadGrid
ID
=
"radGridExperienceEntry"
runat
=
"server"
OnNeedDataSource
=
"GetData"
>
<
GroupingSettings
CaseSensitive
=
"False"
/>
<
MasterTableView
AutoGenerateColumns
=
"false"
DataKeyNames
=
"Id"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Category"
UniqueName
=
"Category"
HeaderText
=
"Category Type"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBoxCategory"
Height
=
"100px"
AppendDataBoundItems
=
"true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Category").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="IndexChanged">
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"All"
/>
<
telerik:RadComboBoxItem
Text
=
"Category1"
Value
=
"C1"
/>
<
telerik:RadComboBoxItem
Text
=
"Category2"
Value
=
"C2"
/>
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function IndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("Category", args.get_item().get_value(), "EqualTo");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>