all groups > dotnet distributed apps > november 2003 >
You're in the

dotnet distributed apps

group:

Multi line selection in datagrids


Multi line selection in datagrids P Nelson
11/12/2003 4:41:13 PM
dotnet distributed apps: Can someone let me know how I nan select multiple lines in
a datagrid? It seems I can only select one at a time.
Alternatively, how can I specifically mark certain rows
as "selected". The selected rows should have an alternate
background color (the default selection color of yellow is
fine). The actual rows selected will be configurable by
users, and their choices stored as a server side cookie -
and so are likely to be diferent for diferent users.

Any books where i could find info on this would be
useful too - I didn't find it in the Help (yet).

Thanks for any help,

RE: Multi line selection in datagrids lukezhan NO[at]SPAM online.microsoft.com
11/13/2003 5:25:48 AM
Hi Paul,

If your datagrid is bound to a datsset, I think you may add a boolean
column to the datatable, and use a checkbox to display this column on
client side. In this way, user can select a row by check the checkbox and
you can get the lines selected in the datatable.

To change the background color of a row, we may add some client script code
in the check box's onClick event, for example:

check1.parentElement.parentElement.style.backgroundColor="Yellow";

On client side, datagrid will be render to a HTML table, the checkbox's
grantparent is the <TR> tag.

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
AddThis Social Bookmark Button