Hi satabeach,
As per your query i have create the sample. Please check the sample if you have any doubt revert me back.
HTML
<asp:GridView ID="gvMonth" runat="server">
</asp:GridView>
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
List<string> item = new List<string>();
DateTime currentDateTime = new DateTime(DateTime.Now.Year, 01, 01);
for (int i = 0; i < 12; i++)
{
item.Add(string.Format("{0} - {1} {2}", currentDateTime.AddMonths(i).ToString("MMMM"), currentDateTime.AddMonths(i + 1).ToString("MMMM"), DateTime.Now.Year));
i++;
}
gvMonth.DataSource = item;
gvMonth.DataBind();
}
}
VB
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim item As New List(Of String)()
Dim currentDateTime As New DateTime(DateTime.Now.Year, 1, 1)
For i As Integer = 0 To 11
item.Add(String.Format("{0} - {1} {2}", currentDateTime.AddMonths(i).ToString("MMMM"), currentDateTime.AddMonths(i + 1).ToString("MMMM"), DateTime.Now.Year))
i += 1
Next
gvMonth.DataSource = item
gvMonth.DataBind()
End If
End Sub
Output
Item |
January - February 2017 |
March - April 2017 |
May - June 2017 |
July - August 2017 |
September - October 2017 |
November - December 2017 |