GridView Templates /DataBinding

T

Tatyana

Hi All,

I'm trying to Bind a GridView to an XML data file.
I have set up the Templates for the datafields of the GridView. I have
several label controls, in one of them, to which I'm binding to.
Everything works, but I do not always have all datafields. In which case I
would like to hide the field and its header in the template.
Does anybody know how to hide the label and a text when the datafield
doesnot exist?
Also is there any way to show the Name of the Datafield(something like
header) + Databound Expression and when the datafield does not exist - hide
both.

Label Text = "FieldName:" + <%# Bind("datafield") %>'

Label Text="Part #: " + <%# Bind("datafield") %>'

I need the "Part #:" to be displayed whenever the datafield exists, but
hide the Part#: when there is no datafield.

Thank you,
Tatyana
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top