Example #1
0
    protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        string           StudentID  = editedItem.GetDataKeyValue("StudentID").ToString().Trim(); // Works if you set the DataKeyValue as CustomerID

        string name    = (editedItem["StudentName"].Controls[0] as TextBox).Text;
        string address = (editedItem["Address"].Controls[0] as TextBox).Text;
        string DOB     = (editedItem["DOB"].Controls[0] as TextBox).Text;
        string phoneNo = (editedItem["PhoneNo"].Controls[0] as TextBox).Text;

        AbcDAL MyDAL = new AbcDAL("");

        MyDAL.UpdStudentMaster(StudentID, name, phoneNo, address, Convert.ToDateTime(DOB));
    }