Wrox Programmer Forums
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 17th, 2006, 03:13 AM
Registered User
Join Date: May 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ardvisoor
Default Selection in DataGrid

i Want to Select DataGrid Rows, but not by Select Command, but by Clicking on a row, how i can do it?

There is no shortcut to anywhere worth going
Old May 18th, 2006, 10:44 PM
Friend of Wrox
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts

the only way I can think of is by using javascript

Old June 13th, 2006, 02:28 PM
Authorized User
Join Date: May 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts

You can use third party grid with this functionality
For example:
grid from telerik (http://telerik.com);
algrid from asplib component library (http://asplib.net)

Old June 14th, 2006, 09:23 AM
Authorized User
Join Date: Jun 2005
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to aldwinenriquez

You need to add this code.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        e.Row.Attributes.Add("onclick", "this.style.backgroundColor='Silver'");
        e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='White'");

If its a Datagrid I think the event should be on ItemDataBound and e.Row should be e.Item.My example is for a GridView control in .net 2.0

Hope this helps.

Aldwin Enriquez
"Dont you ever give up!"

Similar Threads
Thread Thread Starter Forum Replies Last Post
selection of all checkboxes inside the datagrid yes_no ASP.NET 1.0 and 1.1 Professional 4 April 15th, 2008 07:31 AM
Multiple selection in Datagrid w/o RowHeaders debsoft General .NET 4 October 12th, 2006 11:30 AM
cannot detect selection of checkbox datagrid edit swati_joshi ASP.NET 1.0 and 1.1 Professional 0 April 21st, 2006 08:21 AM
selection index changed in datagrid lily611 General .NET 1 July 21st, 2004 07:56 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.