Help On gridview binding

Posted by Vijayar under C# on 8/23/2011 | Points: 10 | Views : 916 | Status : [Member] | Replies : 3
HI
i have a grid view,i have to bind the name of current month to it.How to bind the name of month to label.It should should name in characters
i.e. Details Of January in label in header

vijaya


Responses

Posted by: Ndebata on: 8/23/2011 [Member] Starter | Points: 25

Up
0
Down
Try to add a template column with a lable inside the header template
<asp:TemplateField>

<HeaderTemplate>
<asp:Label ID="lblMonth" runat="server" Text='<%# "Details of "+ DateTime.Now.ToString("MMMM") %>'></asp:Label>
</HeaderTemplate>
</asp:TemplateField>


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

Posted by: Vijayar on: 8/24/2011 [Member] Starter | Points: 25

Up
0
Down
thanks it worked

vijaya

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

Posted by: Vijayar on: 8/24/2011 [Member] Starter | Points: 25

Up
0
Down
Hi
i have a datalist for which iam binding both image and name of employee.If image exist for that employee in database i need to display that image other wise i need to display a default empty image in that place.How to do this .Explain me with example

vijaya

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

Login to post response