dataGrid - link - popup window

P

popsovy

I need to create a datagrid where the column headers (not the items) are links. When a user clicks on a link, it brings up a popup window.

I guess the question is how to make the headers to be URLs but without using sorting, then associate client-side javascript to these headers.... or, is there a better way?

Many thanks for your help.

Zhenya
http://www.rusmex.com
 
A

Alvin Bruney [MVP]

Headers are cells too. In your itemcreated event handler trap for the header
cell and then add a link to the header. It's similar to adding a webding.
You may want to google for webding datagrid sort for a clearer picture. Here
is one approach.
if(e.item.itemtype == listitemtype.header)
{
linkbutton l = e.item.cells[0].controls[0];
link.navigateurl = "<script> goes here to open up a popup
}

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
I need to create a datagrid where the column headers (not the items) are
links. When a user clicks on a link, it brings up a popup window.
I guess the question is how to make the headers to be URLs but without
using sorting, then associate client-side javascript to these headers....
or, is there a better way?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top