Hyperlink in DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello!

I am using a DataGrid to show a table. Some of the columns are showing
numeric data. I need to show these numeric data as hyperlinks so that the
user can drill downward (or get more details about the data). Thanks in
advance.

Newbie
 
Simply add a hyperlink column to the grid and bind your values to it instead
of a databound column.
 
Newbie,

In order to do this, you will have to create your own column style that
derives from DataGridColumnStyle. Deriving from this class will allow you
to control how a column is rendered in the data grid. Once you do that, you
can assign it to your column, and create the semantics you are looking for.

Hope this helps.
 
Thanks Ben. I am using 2 Panel controls in my webform. The first Panel
(containing a DataGrid) is visible at startup. When the user clicks on the
hyperlink in the DataGrid cell, the second Panel control becomes visible and
the first one becomes hidden. I am not using a different webform after the
hyperlink is clicked. How do I handle the clicking? Is there an event handler
I should implement? Suggestions?
 
Add a link button and set the command name and args. Then wire up the
datagrids oncommand event and hide/show/bind at will :)

Ben
 
See if this helps

http://www.c-sharpcorner.com/Code/2003/June/DataGridHyperLinkColumn.asp


Nicholas Paldino said:
Newbie,

In order to do this, you will have to create your own column style that
derives from DataGridColumnStyle. Deriving from this class will allow you
to control how a column is rendered in the data grid. Once you do that, you
can assign it to your column, and create the semantics you are looking for.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Newbie said:
Hello!

I am using a DataGrid to show a table. Some of the columns are showing
numeric data. I need to show these numeric data as hyperlinks so that the
user can drill downward (or get more details about the data). Thanks in
advance.

Newbie
 
Back
Top