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

[Solved] refreshing a grid to show newly inserted data

2 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kirk Thomas
Top achievements
Rank 1
Kirk Thomas asked on 15 Oct 2009, 01:52 PM
Hello,

I have a form outside of a grid that has textboxes and a button.  When the button is clicked the data is added to the grid and a database on a full postback.  But inorder to see the data in the grid I must perform another postback.  In looking for a solution to this problem I saw something about the data not being written to the database until the first postback is completed, not sure if thats true or not.  But I was hopeing someone could help me out with this problem because I would like the grid to have the newly inserted data after the add button is clicked.

Thanks,
Kirk

2 Answers, 1 is accepted

Sort by
0
Thomas Salt
Top achievements
Rank 1
answered on 15 Oct 2009, 02:47 PM
Perhaps put your grid load code into a function and only call that function when you want the data to rebind.  ie after you insert your records.
0
Schlurk
Top achievements
Rank 2
answered on 15 Oct 2009, 02:49 PM
You could add the items just to your RadGrid and then call RadGrid1.Rebind() in order to reflect these changes in the database. This way the appearance is that the Grid and the database have all the items all along but the database does not contain them until the rebind (which could happen at the end of the click event anyways).
Tags
Grid
Asked by
Kirk Thomas
Top achievements
Rank 1
Answers by
Thomas Salt
Top achievements
Rank 1
Schlurk
Top achievements
Rank 2
Share this question
or