Click here to Skip to main content
15,885,929 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used one grid view with dropdown control in edit template.
when i click the edit button it has some error....


protected void gridFeesType_RowEditing(object sender, GridViewEditEventArgs e)
    {
        DataTable dts1 = (DataTable)ViewState["Data"];
        gridFeesType.EditIndex = e.NewEditIndex;
        int RowIndex = e.NewEditIndex;
        ViewState["row"] = RowIndex;
        
      DropDownList ddl = (DropDownList)gridFeesType.Rows[RowIndex].FindControl("TermofFees") as DropDownList;
     
        Table_();
        DataTable dtedit = (DataTable)ViewState["Table"];

ERROR--> object reference not set to instance object..

        ddl.SelectedItem.Text = dtedit.Rows[RowIndex]["TermofFees"].ToString();
    }
Posted
Updated 14-Dec-11 23:41pm
v2
Comments
Smithers-Jones 15-Dec-11 5:41am    
Added code-block.

1 solution

I'm having trouble trying to understand what it is your trying to do. But more than likely your ViewState doesnt contain a property named "Table".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900