DataGrid clickable row

2019-09-02 05:51发布

问题:

I'm looking for a way for my users to click on a row on my DataGrid where if that click anyway they would pick up the UniqueID column, and then open an new page which would be called "uniqueidview.aspx" that uses the UniqueID as it's primary key in a MySQL query. I'm able to do the MySQL part but i can't find a walk-through or guide on how to do this using a DataGrid, i've found a few using DataView, any help would be awesome. Thanks!

回答1:

4 Guys From Rolla posted an article Creating a Row-Selectable DataGrid Control many years back. In the article, clicking on the row would put the grid into edit mode.

You might be able to use that as a starting point, and modify it to do what you're looking to do.

Are you using an actual DataGrid (from .NET 1.1), or do you mean the GridView (2.0+)?

If you're actually talking about GridView, here's another link:

Developing a row-clickable GridView