How to make datagrid searchable?
-
Hi, I am new in .net. I am making an application using datagrid which is showing details about employees. So I want to make my data grid searchable. So i am using a textbox where user can enter some data into it and the matching result with all the columns will be displayed in the datagrid. If anyone knows how to do it or anyone hav a code for it. Please reply me
Rocki Star
-
Hi, I am new in .net. I am making an application using datagrid which is showing details about employees. So I want to make my data grid searchable. So i am using a textbox where user can enter some data into it and the matching result with all the columns will be displayed in the datagrid. If anyone knows how to do it or anyone hav a code for it. Please reply me
Rocki Star
You can try the following methods 1- When user enters search criteria, goto database and fetch the records and rebind the DataGrid. 2- When datagrid is initially binded, keep datasource in a session or viewstate, and do search on that datasource. If you are using
DataTable
to bind the grid, you can useSelect()
method to search the records.All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
Hi, I am new in .net. I am making an application using datagrid which is showing details about employees. So I want to make my data grid searchable. So i am using a textbox where user can enter some data into it and the matching result with all the columns will be displayed in the datagrid. If anyone knows how to do it or anyone hav a code for it. Please reply me
Rocki Star
-
You can try the following methods 1- When user enters search criteria, goto database and fetch the records and rebind the DataGrid. 2- When datagrid is initially binded, keep datasource in a session or viewstate, and do search on that datasource. If you are using
DataTable
to bind the grid, you can useSelect()
method to search the records.All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
Actually I am planning for that it will search for the criteria in all the column in datagrid. Search criteria is not restricted to only one column. So is there any method or event in datagrid which can help me. http://www.preterra.com/flexsamples/gridsearch/gridsearch.html[^] This is how one guy has achieved it using datagrid but he hasn't uploaded his code Is it possible for me to do it in this style. Thank You N a v a n e e t h
Rock Star
-
Actually I am planning for that it will search for the criteria in all the column in datagrid. Search criteria is not restricted to only one column. So is there any method or event in datagrid which can help me. http://www.preterra.com/flexsamples/gridsearch/gridsearch.html[^] This is how one guy has achieved it using datagrid but he hasn't uploaded his code Is it possible for me to do it in this style. Thank You N a v a n e e t h
Rock Star
Rock Star. wrote:
I am planning for that it will search for the criteria in all the column in datagrid.
Yes you can do as I specified in the first post. Assume your DataGrid is binded with a
DataTable
object.DataTable
comes with a select(DataTableObject.Select()
) method where you can write queries. So form a query which looks for the matches in all the columns when user clicks search, pass it to the select method on the DataTable object. You can keep theDataTable
object inSession/ViewState
.All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
Hi, I am new in .net. I am making an application using datagrid which is showing details about employees. So I want to make my data grid searchable. So i am using a textbox where user can enter some data into it and the matching result with all the columns will be displayed in the datagrid. If anyone knows how to do it or anyone hav a code for it. Please reply me
Rocki Star
hi if you are binding a dataset to the grid then it is very easy.... filter the dataset with the value entered in the text box dataset.select(
-
hi if you are binding a dataset to the grid then it is very easy.... filter the dataset with the value entered in the text box dataset.select(
joemonvarghese wrote:
if you are binding a dataset to the grid then it is very easy.... filter the dataset with the value entered in the text box dataset.select(
WRONG. Dataset don't have
Select()
method.All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions