select command on the gridview

Discussion in '.NET' started by sanam, Aug 9, 2008.

  1. sanam

    sanam

    Joined:
    Aug 9, 2008
    Messages:
    1
    Hello
    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?
     
    sanam, Aug 9, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFiYmxlcg==?=

    select gridview row without using select button?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 3, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    101,541
    dch31969
    Feb 27, 2009
  2. Tammy B

    gridview select command question

    Tammy B, Mar 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,289
    Munawar Hussain
    Mar 7, 2006
  3. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,985
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  4. MikeS
    Replies:
    4
    Views:
    341
    MikeS
    Nov 16, 2006
  5. palmiere
    Replies:
    1
    Views:
    414
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page