problem in GridView

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thiagarajanrsbe
    New Member
    • Jan 2008
    • 5

    problem in GridView

    Code:
    protected void gridReport_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                for (int i = 0; i < gridReport.Columns.Count; i++)
                {
                    DataControlFieldCell cell = gridReport.Rows[e.RowIndex].Cells[i] as DataControlFieldCell;
                    gridReport.Columns[i].ExtractValuesFromCell(e.NewValues, cell, DataControlRowState.Edit, true);
                }
    
                foreach (string key in e.NewValues.Keys)
                {
                       gridReport.Rows[e.RowIndex][key] = e.NewValues[key];
                    
    
                }
    
                gridReport.EditIndex = -1;
                gridReport.DataBind();
            }
            catch (NullReferenceException ex)
            {
                Response.Write(ex.ToString());
            }
            
        }
    how to solve the following problem.....ple ase send me as a code....

    Note:

    I got the following Error: Cannot apply indexing with [] to an expression of type 'System.Web.UI. WebControls.Gri dView
    Last edited by RedSon; Jan 28 '08, 04:56 PM.
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Please be warned, we expect your code to be posted in [CODE] tags (See How to Ask a Question).
    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
    Please use [CODE] tags in future.

    -Moderator

    Comment

    Working...