How to set default value to grid cell

Posted by Abhisekjani under C# on 11/15/2012 | Points: 10 | Views : 1172 | Status : [Member] | Replies : 1
Dear All,

I have grid view, It have three main field.
SlNo,Amount, Date. now i want to set the Amount field default 0 .
How i do this?
Please help me..........



Posted by: Funda on: 11/15/2012 [Member] Starter | Points: 25

Use this snippet in grid .....
<asp:Label ID="lblLabel" Text=' <%#(String.IsNullOrEmpty(Eval("YOURVALUE").ToString()) ? "0" : Eval("YOURVALUE"))%>' runat="server"></asp:Label>

If YOURVALUE is null it will display Zero..else it will display YOURVALUE

Abhisekjani, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response