This is a migrated thread and some comments may be shown as answers.

Closing the Form with a Programmatic Insert

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 16 Dec 2011, 07:09 PM
Hello,

I'm doing a programmatic insert with a radgrid, and graving the newvalues out of the insertitem. I am doing this in a procedure handling then InsertCommand event. The insert itself works just fine...

The trouble is that I can't figure out how to close the insert form. I can rebind the grid, but that doesn't do it, I have tried IsItemInserted = false, but that throws an error. How on earth do you get the grid to just close and rebind normally when doing a programmatic insert?

Thanks,

Mike

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Dec 2011, 07:30 PM
Hello Mike,

// your insert code
           RadGrid1.MasterTableView.IsItemInserted = false;
  
           // if you used Advance data binding then used below method
           RadGrid1.Rebind();
           // else
           RadGrid1.DataSource = null;
           RadGrid1.DataBind();

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or