Hello
I have a gridview that contain a template field I fill this template filed with this code :
I enable the selection on gridview and run it
when the page load template filed fill correctly.but when I click the select command on the gridview the content of template field disappear.why?
can anyone help me?
I have a gridview that contain a template field I fill this template filed with this code :
Code:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if ((e.Row.RowType == DataControlRowType.DataRow ) & (e.Row.RowType!=DataControlRowType.Footer))
{
DateTime datefromdb=Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem,"date1"));
System.Globalization.PersianCalendar PersianCalendar = new PersianCalendar();
int daytoshamsi = PersianCalendar.GetDayOfMonth(datefromdb);
int monthtoshamsi = PersianCalendar.GetMonth(datefromdb);
int yeartoyear = PersianCalendar.GetYear(datefromdb);
e.Row.Cells[5].Text = daytoshamsi+ "/" + monthtoshamsi + "/"+ yeartoyear;
}
}
I enable the selection on gridview and run it
when the page load template filed fill correctly.but when I click the select command on the gridview the content of template field disappear.why?
can anyone help me?