WholeTable Search

Hi,

I am trying to search grid using GridFindReplaceDialogSink
ColumnOnly option works,
However, the WholeTable option does not work.
Here is my code:

public void FindCellText(string text)
{
GridFindReplaceDialogSink frDialog = new GridFindReplaceDialogSink(this);
GridFindTextOptions option = GridFindTextOptions.None;
option |= GridFindTextOptions.WholeTable;
GridFindReplaceEventArgs frEventArgs = new GridFindReplaceEventArgs(text, "", option, null);
frDialog.Find(frEventArgs);
}


Thanks.

Q

2 Replies

QS Qingde Shi June 8, 2007 02:47 PM UTC

Not sure if I found the answer, but set the grid to focus made it works.

>Hi,

I am trying to search grid using GridFindReplaceDialogSink
ColumnOnly option works,
However, the WholeTable option does not work.
Here is my code:

public void FindCellText(string text)
{
GridFindReplaceDialogSink frDialog = new GridFindReplaceDialogSink(this);
GridFindTextOptions option = GridFindTextOptions.None;
option |= GridFindTextOptions.WholeTable;
GridFindReplaceEventArgs frEventArgs = new GridFindReplaceEventArgs(text, "", option, null);
frDialog.Find(frEventArgs);
}


Thanks.

Q


RA Rajagopal Syncfusion Team June 8, 2007 03:38 PM UTC

Hi,

Here is your modified code below that should work fine.

public void FindCellText(string text)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (cc.RowIndex == -1 || cc.ColIndex == -1)
this.gridGroupingControl1.TableControl.CurrentCell.Activate(1, 1);
else
this.gridGroupingControl1.TableControl.CurrentCell.Activate(cc.RowIndex, cc.ColIndex);

GridFindReplaceDialogSink frDialog = new GridFindReplaceDialogSink(this.gridGroupingControl1.TableControl);
GridFindTextOptions option = GridFindTextOptions.None;
option |= GridFindTextOptions.WholeTable;
GridFindReplaceEventArgs frEventArgs = new GridFindReplaceEventArgs(text, "", option, null);
frDialog.Find(frEventArgs);

if (!this.gridGroupingControl1.TableControl.HasControlFocus)
this.gridGroupingControl1.TableControl.Focus();
}

Thanks for using Syncfusion Products.
Regards,
Rajagopal

Loader.
Up arrow icon