ASP.Net, how to put hyperlinks in datagrids.
Hi i have a datagrid I've put in on a aspx web form in visual studio 2010, I'm new to this so I've been following the ms tutorials.
One of the columns on my data grid contains a lot of information, is there a way i can add a "+more" option in the cell next to the entry that shows only the first few characters of that cell, but once clicked opens all the information on th开发者_Python百科at particular entry but onto a new aspx form?
Thanks for any help!!
There are basically three different ways...
- Structure your data object/query so that it returns a key and and abbreviation (i.e, first name, last name, id, bio) and use a template that turns id into a link.
- Use the onrowbound event to manipulate the controls on the row, so that you have a href to your details page.
- Use css to show the additional info on a hover/mouse over (I like this, but it doesn't play well with mobile devices, which don't have either event).
EDIT: Methods 1&3 would be done on your aspx page, method 2 would be done in the codebehind for your page. Method 1 is really dependent upon your being able to control the data object/ query results. If you are calling a stored proc that someone else controls, it may be very difficult to make it work.
精彩评论