Hi Does anyone know how to add a button link to a grid view to a single row in a grid view, rather than the entire column?
At the moment I have this:
|
Customer |
Sales |
|
Customer A |
1000 |
|
Customer B |
1005 |
|
Customer C |
2500 |
However I want this:
|
Customer |
Sales |
|
Customer A |
1000 |
|
Customer B |
1005 |
|
Customer C |
2500 |
I have created this first grid view using the following :
http://technico.qnownow.com/using-gridview-in-asp-net-c-part-2/
Thank you for your help.
Suthish NairPosted Mar 27, 2013, 5:37 AM
Add two control, LinkButton and Label for column Customer. Both will bind with same value.
Make sure any one of the control should be visible all the time.
Now on GridView RowDataBound event check if e.Row.RowIndex == 0 (this means first row) then show LinkButton only and hide Label. Else for another row, hide LinkButton.
Lynn EmeryPosted Mar 27, 2013, 5:11 AM
Please could explain furher how I can hide the link.
Again, Thank you for your help.
Suthish NairPosted Mar 27, 2013, 5:07 AM