I
Iain
I want to select whole rows in my Datagrid. I do so using code from
SyncFusions WinForms FAQ which overrides the ColumnStyle Edit command and
deselects and selects according to a private variable as in the code sample
below.
The problem is if I click on a header to sort the DataGrid the results are
not what I want.
Basically, I need a way to detect that the sort has occured (before and
after) so I can work out what new rows to select and deselect.
This seems impossible. Are there any workarounds?
Iain
protected override void Edit(System.Windows.Forms.CurrencyManager source,
int rowNum, System.Drawing.Rectangle bounds,
bool readOnly, string instantText,bool cellIsVisible)
{
if (mWholeRows)
{
if(mSelectedRow > -1 && mSelectedRow < source.List.Count + 1)
this.DataGridTableStyle.DataGrid.UnSelect(mSelectedRow);
mSelectedRow = rowNum;
this.DataGridTableStyle.DataGrid.Select(mSelectedRow);
}
else
base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible);
}
SyncFusions WinForms FAQ which overrides the ColumnStyle Edit command and
deselects and selects according to a private variable as in the code sample
below.
The problem is if I click on a header to sort the DataGrid the results are
not what I want.
Basically, I need a way to detect that the sort has occured (before and
after) so I can work out what new rows to select and deselect.
This seems impossible. Are there any workarounds?
Iain
protected override void Edit(System.Windows.Forms.CurrencyManager source,
int rowNum, System.Drawing.Rectangle bounds,
bool readOnly, string instantText,bool cellIsVisible)
{
if (mWholeRows)
{
if(mSelectedRow > -1 && mSelectedRow < source.List.Count + 1)
this.DataGridTableStyle.DataGrid.UnSelect(mSelectedRow);
mSelectedRow = rowNum;
this.DataGridTableStyle.DataGrid.Select(mSelectedRow);
}
else
base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible);
}