Hi
I have one dataset named as ds.
I have one textbox search button If i enter a cell value in the textbox then click the search button the corresponding row should be highlighted in the grid rest of the rows present in the grid as usual.The search operation should be done in the dataset then the respected row should be highlighted in the grid.
(Note : The search operation not directly in the grid only by dataset)
Sanjeeb LenkaPosted May 5, 2015, 2:46 AM
create a gridrowdatabound event and write your textbox.text to match like 'high'
public void yourGridview_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// do your stuffs here, for example if column risk is your third column:
if (e.Row.Cells[2].Text == 'high')
{
e.Row.BackColor = Color.Red;
}
}
and in textbox textchanged event call the gridbind method.
Khargesh RajputPosted May 5, 2015, 2:46 AM
http://www.aspsnippets.com/Articles/Search-records-in-GridView-and-highlight-results-in-ASPNet-using-C-and-VBNet.aspx