locked
problem in rowupading in grid view RRS feed

  • Question

  • User-1517606412 posted

    Here i face a problem in Gridview Row updating.

    i am bounding my gridview from databound field using storeprocedure

     

     <asp:BoundField  HeaderText ="Name" DataField ="Name" ReadOnly="true"   />
    and  similarly other field also, and when i want to update this grid on behalf of this field "name" then
     first i want to fetch this field on row updating event, I am creating this field as readonly so user can't change
    value of this field but due to this i can't fetch this field in updating event
     
    here the code for same
     
    protected void gv_CSCList_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
    
           string Id = ((TextBox)gv_CSCList.Rows[e.RowIndex].Cells[0].Controls[0]).Text;
           .......
    ........
    ......
    }
       
     
    please help me in this issue, I am simpaly want to update my grid on behalf of name and name field does 
    not show as input control.
     
    thanks in advance 
      
     
     
     
      
    Wednesday, May 20, 2009 8:46 AM

Answers

  • User-294030300 posted

    Hey,

    I'm not sure what you are looking for.  If you set ReadOnly="True", then you can't see the textbox; to get the value, do:

    gv_CSCList.Rows[e.RowIndex].Cells[0].Text

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 20, 2009 9:00 AM

All replies

  • User-294030300 posted

    Hey,

    I'm not sure what you are looking for.  If you set ReadOnly="True", then you can't see the textbox; to get the value, do:

    gv_CSCList.Rows[e.RowIndex].Cells[0].Text

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 20, 2009 9:00 AM
  • User-1517606412 posted

     thanks , its working

    Wednesday, May 20, 2009 9:19 AM