Datagrid - Conditional Buttons/links

B

bijoy

My datagrid displays the following info: Date, Expected Users, Number
of Events

I want it to behave as follows:

For each row, if the value of Expected Users is greater than 5000, then
I display the value in RED and make it a link. Otherwise just display
the text in regular font. The link should fire a server-side event. I
will use this to display additional information on the page about the
clicked item.

The text in RED part was easy..

How do I go about displaying conditional links that trigger a server
side event?

Bijoy
 
E

Elton Wang

Hi bijoy,

You can add both LinkButton Lable in a TemplateColumn.
Then in datagrid_ItemDataBound event according to your
condition set only one of them visible. The linkButton can
fire datagrid_ItemCommand event.

HTH

Elton Wang
(e-mail address removed)
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top