DataBinder

G

Guest

Hello,
I create in datagrid <ItemTemplate><%#DataBinder.Eval(Container.DataItem,
"ID_0061_PREDECESSOR")%></ItemTemplate>. This is written in HTML code. But
now is shown Guid 0000-00000-0000.... in datagrid. But I need create in
ItemTemplate "IF" construction like this:

If DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR")!=Guid.Empty
DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR")

So if ID_0061_PREDECESSOR isn't empty, then write in page the value of
ID_0061_PREDECESSOR.
How can I create this construction?

Thanks Lubos
 
G

Guest

<%# If (GUID) DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR") !=
Guid.Empty
DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR") %>

And don't forget to imort the proper namespace for the GUID

Hope that helps!
Ragards,
Kostadin Kostov
 

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,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top