We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridFindReplaceDialogSink.Find method

Thread ID:

Created:

Updated:

Platform:

Replies:

14572 May 29,2004 03:12 AM Jun 21,2004 03:03 AM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 29, 2004 03:12 AM

hello, i''m using GridFindReplaceDialogSink for seraching in the grid, Find method of this not locating the first row, first column of the grid. how do first row, first column can be located? thanks in advance..

Administrator [Syncfusion]
Replied On May 30, 2004 01:50 AM

Are you explicitly making the cell where the search should begin the current cell before you start the search? Here is a sample that seems to catch the top properly for me. Find_8720.zip

Administrator [Syncfusion]
Replied On June 19, 2004 03:11 AM

hello, i''m not explicitly setting the current cell and my requirement does not allow it. Problem is like this, current cell is (10,1) and Find method will be executed, even though the search string is present in Cell (1,1), it doesn''t locate it, ie. first row is not getting considered in the Find process. thanks. >Are you explicitly making the cell where the search should begin the current cell before you start the search? > >Here is a sample that seems to catch the top properly for me. > >Find_8720.zip > >

Administrator [Syncfusion]
Replied On June 19, 2004 09:01 AM

I think this is a bug we will have to fix in our code. The code is explicitly skipping that cell when you do a find on the whole table if the search does not start at cell 1,1. Here is code that made things work for me in the sample by using an explicit range (slightly enlarged to avoid the bug) to search the whole table.
private void button1_Click(object sender, System.EventArgs e)
{
	GridDataBoundGrid grid = this.gridDataBoundGrid1;
	grid.Focus();//set focus back to the grid from the button
	string search = this.textBox1.Text;
	if(search.Length > 0)
	{
		fr = new GridFindReplaceDialogSink(grid);
		GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
		frLocationInfo = GridRangeInfo.Cell(cc.RowIndex, cc.ColIndex);
		this.gridDataBoundGrid1.BeginUpdate();
		this.gridDataBoundGrid1.Selections.Add(GridRangeInfo.Cells(1,0,this.gridDataBoundGrid1.Model.RowCount, this.gridDataBoundGrid1.Model.ColCount));
		fre = new GridFindReplaceEventArgs(search, "", GridFindTextOptions.SelectionOnly|GridFindTextOptions.MatchWholeCell, frLocationInfo);
		fr.Find(fre);
		grid.Selections.Clear();
		this.gridDataBoundGrid1.EndUpdate();
		grid.Refresh();
		//grid.Selections.Add(GridRangeInfo.Row(grid.CurrentCell.RowIndex));
	}
}

Administrator [Syncfusion]
Replied On June 21, 2004 03:03 AM

thanks, it worked.. below code will do column only search ''grid.Selections.Add(GridRangeInfo.Cells(0,2,grid.Model.RowCount, 2))'' this will search only the column 2 here, to include the first row,Selection Range''s Top is setted as 0 >I think this is a bug we will have to fix in our code. The code is explicitly skipping that cell when you do a find on the whole table if the search does not start at cell 1,1. > >Here is code that made things work for me in the sample by using an explicit range (slightly enlarged to avoid the bug) to search the whole table. > >
>private void button1_Click(object sender, System.EventArgs e)
>{
>	GridDataBoundGrid grid = this.gridDataBoundGrid1;
>	grid.Focus();//set focus back to the grid from the button
>	string search = this.textBox1.Text;
>	if(search.Length > 0)
>	{
>		fr = new GridFindReplaceDialogSink(grid);
>		GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
>		frLocationInfo = GridRangeInfo.Cell(cc.RowIndex, cc.ColIndex);
>		this.gridDataBoundGrid1.BeginUpdate();
>		this.gridDataBoundGrid1.Selections.Add(GridRangeInfo.Cells(1,0,this.gridDataBoundGrid1.Model.RowCount, this.gridDataBoundGrid1.Model.ColCount));
>		fre = new GridFindReplaceEventArgs(search, "", GridFindTextOptions.SelectionOnly|GridFindTextOptions.MatchWholeCell, frLocationInfo);
>		fr.Find(fre);
>		grid.Selections.Clear();
>		this.gridDataBoundGrid1.EndUpdate();
>		grid.Refresh();
>		//grid.Selections.Add(GridRangeInfo.Row(grid.CurrentCell.RowIndex));
>	}
>}
>

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;