I have a datagrid, when I hold shift and navigate through the grid I am able
to multi select rows. How can I prevent multi selecting rows?

Signature
Thanks
Wayne Sepega
Jacksonville, Fl
Enterprise Library Configuration Console Module Generator
http://workspaces.gotdotnet.com/elccmg
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
raj.singh@logicacmg.com - 19 Aug 2005 10:43 GMT
Hi,
You can do it in different ways. But I think best will be to override
the Select method. Keet track of last selected row in a property. In
the overridden Select first unselect the last selected row and select
the currentrowindex.
The code will be like this...
public new void Select(int vintRowToSelect)
{
if(intCurrentDataGridRowIndex > -1)
{
base.UnSelect(intCurrentDataGridRowIndex);
}
base.Select(vintRowToSelect);
}
I hope this helps
Cheers
Raj
> I have a datagrid, when I hold shift and navigate through the grid I am able
> to multi select rows. How can I prevent multi selecting rows?
[quoted text clipped - 10 lines]
> let him sit on a hot stove for a minute and it's longer than any hour.
> That's relativity." - Albert Einstein
Bjarke Lindberg - 19 Aug 2005 10:44 GMT
>
> I have a datagrid, when I hold shift and navigate through the grid I am able
> to multi select rows. How can I prevent multi selecting rows?
Hi Wayne.
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q839q
/B.
swashi - 19 Aug 2005 10:59 GMT
hi,
multi selection of rows can be prevented by setting datagrids
MultiSelect property to false
> I have a datagrid, when I hold shift and navigate through the grid I am able
> to multi select rows. How can I prevent multi selecting rows?