DataGrid multi select

W

Wayne

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?

--
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
 
R

raj.singh

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
 
G

Guest

hi,
multi selection of rows can be prevented by setting datagrids
MultiSelect property to false
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top