Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / November 2003

Tip: Looking for answers? Try searching our database.

Multi line selection in datagrids

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
P Nelson - 13 Nov 2003 00:41 GMT
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,

   Paul.
MSFT - 13 Nov 2003 05:25 GMT
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

Signature

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.