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

Update grid after insert.

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 29 Aug 2011, 12:24 PM
Hi,

Can someone help me understand how to display newly inserted row in rad grid after successfully inserting? I have a register employee form and a radgrid on the same page. after I click submit and the user was sucessully created, how would I display that new user in the grid? I tried user the ajax manager to update the grid but no luck. I'll attach a screen shot to give a better idea.

Thanks,
Ron.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Aug 2011, 12:42 PM
Hello Ron,

I hope you are populating RadGrid using Advanced DataBinding(using NeedDataSource event). If so on Submit button click add the corresponding fields value into database. Then Rebind the grid which in turn call the NeedDataSource event of RadGrid.

C#:
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
      //populate Radgrid
    }
 
protected void Submit_Click(object sender, EventArgs e)
    {
        //add the form value in to correspnding fields in database
       RadGrid1.Rebind()// which in turn call NeedDataSource event
    }

Thanks,
Princy.
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or