Here
is an example of the same, in this case I was changing the background colour, but I do think you may set the visibility, too. You may also want to see the other suggestions in
that entire thread
I hope this would help you, if it does not, please post. Thanks.
Romus666
0 Points
1 Post
Gridview conditional formattiong
Dec 12, 2012 01:24 PM|LINK
Hi, I have a gridview with multiple boundfields with datetime headers added dynamically.
now I bind the columns to the same record containing date and quantity. I would like to only make the quantity value visible if
the date matches the header date. Like in the table below.
How can I do this?
the table now looks like
aarsh
Participant
1543 Points
427 Posts
Re: Gridview conditional formattiong
Dec 12, 2012 01:32 PM|LINK
Here is an example of the same, in this case I was changing the background colour, but I do think you may set the visibility, too. You may also want to see the other suggestions in that entire thread
I hope this would help you, if it does not, please post. Thanks.
sarathi125
Star
13599 Points
2691 Posts
Re: Gridview conditional formattiong
Dec 12, 2012 02:20 PM|LINK
Hi,
Which format exactly you need?
Remember to click Mark as Answer on the post that helps to others.
My Blog :MyAspSnippets
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Gridview conditional formattiong
Dec 13, 2012 01:30 AM|LINK
Hi,
You can just turn your BoundField to a TemplateField one, and then set its visible property:
Something like this:
<asp:Label Id="lb" runat="server" Text='<%#Eval("Quality")%>' Visible='<%#DateTime.Parse(Eval("DateTimeColumn")).ToString("yyyy/MM/dd")==some value%>'