Hello,
I am working on a project with RadGrid.
I'm trying to implement a filter like the following example:
Filtering with Client-Side Binding
I want the Grid values to change according to the text which the user is typing in the filter Textbox.
In my Project I use a DataTable as a data source.
How can I do this?
My code:
Currently when I try to filter, the grid’s data doesn’t changed.
Another problem that I have is that sometimes when I delete the whole text from the filter textbox, all cells’ values are replaced with “System.Data.DataRowView”
P.S. I've included a video that shows the problems I have.
http://youtu.be/0-FSvR5t-wQ
Thanks,
Daniel
I am working on a project with RadGrid.
I'm trying to implement a filter like the following example:
Filtering with Client-Side Binding
I want the Grid values to change according to the text which the user is typing in the filter Textbox.
In my Project I use a DataTable as a data source.
How can I do this?
My code:
01.
Public
Class
Grid_Filter_Client
02.
Inherits
System.Web.UI.Page
03.
Dim
dd
As
New
DummyData
04.
Dim
dt
As
New
DataTable
05.
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
06.
07.
If
Not
IsPostBack
Then
08.
09.
SetGridProp(RadGrid1,
True
)
10.
Else
11.
12.
End
If
13.
14.
15.
End
Sub
16.
17.
Private
Sub
SetGridProp(
ByRef
grd,
ByVal
auto)
18.
dt = dd.GenTableData2
19.
grd.AllowFilteringByColumn =
True
20.
grd.FilterType = GridFilterType.CheckList
21.
grd.MasterTableView.PagerStyle.AlwaysVisible =
True
22.
grd.AllowSorting =
True
23.
24.
''''''''''''''''''
25.
'grd.MasterTableView.CheckListWebServicePath = "dt"
26.
27.
If
auto
Then
28.
grd.MasterTableView.AutoGenerateColumns =
False
29.
30.
grd.MasterTableView.DataKeyNames = {dt.Columns(0).ColumnName}
31.
grd.MasterTableView.ClientDataKeyNames = {dt.Columns(0).ColumnName}
32.
33.
Dim
GridBoundCol
As
GridBoundColumn
34.
For
index = 0
To
dt.Columns.Count - 1
35.
GridBoundCol =
New
GridBoundColumn
36.
GridBoundCol.FilterDelay = 200
37.
GridBoundCol.FilterCheckListWebServiceMethod = dt.Columns(index).ColumnName
38.
GridBoundCol.DataField = dt.Columns(index).ColumnName
39.
GridBoundCol.HeaderText = dt.Columns(index).ColumnName
40.
grd.MasterTableView.Columns.Add(GridBoundCol)
41.
42.
Next
43.
44.
45.
grd.DataSource = dt
46.
47.
''''''''''''''''''''
48.
'grd.ClientSettings.DataBinding.SelectMethod = ""
49.
'grd.ClientSettings.DataBinding.Location = ""
50.
grd.ClientSettings.DataBinding.SortParameterType = GridClientDataBindingParameterType.Linq
51.
grd.ClientSettings.DataBinding.FilterParameterType = GridClientDataBindingParameterType.Linq
52.
End
If
53.
End
Sub
54.
55.
56.
Private
Sub
RadGrid1_NeedDataSource(sender
As
Object
, e
As
GridNeedDataSourceEventArgs)
Handles
RadGrid1.NeedDataSource
57.
dt = dd.GenTableData2
58.
RadGrid1.DataSource = dt
59.
End
Sub
60.
61.
62.
63.
End
Class
Currently when I try to filter, the grid’s data doesn’t changed.
Another problem that I have is that sometimes when I delete the whole text from the filter textbox, all cells’ values are replaced with “System.Data.DataRowView”
P.S. I've included a video that shows the problems I have.
http://youtu.be/0-FSvR5t-wQ
Thanks,
Daniel