Checking result of Container.DataItem in a Datagrid

A

anony

Hi,

I would like to find out if it's possible to check the value of a
Container.DataItem inside the Datagrid's <ItemTemplate> tag .... based on
it's value, I would to either output it or output another DataItem from the
current resultset. Something like this:

<ItemTemplate>

If container.dataitem( "column" ) <> "none" Then
output container.dataitem( "column" )
Else
output container.dataitem( "alternate column" )

</ItemTemplate>

My weakness is inline asp code using <%# %> or <% %>. I jumped straight
into asp.net without knowing classic asp, and I think it's hurting me in
this case! Thanks for any advice.

Brian
 
G

Guest

Not using inline code. You'd need to add a handler for the datagrid.ItemDataBound event and do your checking there

----- anony wrote: ----

Hi

I would like to find out if it's possible to check the value of
Container.DataItem inside the Datagrid's <ItemTemplate> tag .... based o
it's value, I would to either output it or output another DataItem from th
current resultset. Something like this

<ItemTemplate

If container.dataitem( "column" ) <> "none" The
output container.dataitem( "column"
Els
output container.dataitem( "alternate column"

</ItemTemplate

My weakness is inline asp code using <%# %> or <% %>. I jumped straigh
into asp.net without knowing classic asp, and I think it's hurting me i
this case! Thanks for any advice

Bria
 

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,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top