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_Client02. Inherits System.Web.UI.Page03. Dim dd As New DummyData04. Dim dt As New DataTable05. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load06. 07. If Not IsPostBack Then08. 09. SetGridProp(RadGrid1, True)10. Else11. 12. End If13. 14. 15. End Sub16. 17. Private Sub SetGridProp(ByRef grd, ByVal auto)18. dt = dd.GenTableData219. grd.AllowFilteringByColumn = True20. grd.FilterType = GridFilterType.CheckList21. grd.MasterTableView.PagerStyle.AlwaysVisible = True22. grd.AllowSorting = True23. 24. ''''''''''''''''''25. 'grd.MasterTableView.CheckListWebServicePath = "dt"26. 27. If auto Then28. grd.MasterTableView.AutoGenerateColumns = False29. 30. grd.MasterTableView.DataKeyNames = {dt.Columns(0).ColumnName}31. grd.MasterTableView.ClientDataKeyNames = {dt.Columns(0).ColumnName}32. 33. Dim GridBoundCol As GridBoundColumn34. For index = 0 To dt.Columns.Count - 135. GridBoundCol = New GridBoundColumn36. GridBoundCol.FilterDelay = 20037. GridBoundCol.FilterCheckListWebServiceMethod = dt.Columns(index).ColumnName38. GridBoundCol.DataField = dt.Columns(index).ColumnName39. GridBoundCol.HeaderText = dt.Columns(index).ColumnName40. grd.MasterTableView.Columns.Add(GridBoundCol)41. 42. Next43. 44. 45. grd.DataSource = dt46. 47. ''''''''''''''''''''48. 'grd.ClientSettings.DataBinding.SelectMethod = ""49. 'grd.ClientSettings.DataBinding.Location = ""50. grd.ClientSettings.DataBinding.SortParameterType = GridClientDataBindingParameterType.Linq51. grd.ClientSettings.DataBinding.FilterParameterType = GridClientDataBindingParameterType.Linq52. End If53. End Sub54. 55. 56. Private Sub RadGrid1_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource57. dt = dd.GenTableData258. RadGrid1.DataSource = dt59. End Sub60. 61. 62. 63.End ClassCurrently 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
