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

Insert new row javascript

3 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 11 May 2011, 12:36 AM
Hi,

I'm inserting a new black row using javascript and a webservices. Everything works fine except the new row does not show in the grid until I do a page refresh.  Can somebody tell me why is that, or is there a way to do a page refresh using ajax?

Thanks,
Ron

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 May 2011, 06:39 AM
Hello Ron,

In your scenario better approach is to rebind the RadGrid from client side.
Javascript:
$find("<%= RadGrid1.ClientID %>").get_masterTableView().rebind();

Hope it helps.

Thanks,
Shinu.
0
Ron
Top achievements
Rank 1
answered on 11 May 2011, 01:12 PM
Thank you kindly for you reply. I've tried your example and it worked but the row appears as a grey emtpy horizontal bar until i refresh the page and do a post back then the row apears as it should with columns and controls. I included a picture of before the page refresh, after the page refresh and the source code before the post back so you can get an idea. In the source you can see that the row is there but it's showing empty td tags. Can you take a look?  I greatly appreciate your assistance with this. Thanks.
0
Tsvetina
Telerik team
answered on 16 May 2011, 12:13 PM
Hello Ron,

If you are using client-side binding through a web service, you would rather need to call databind() upon your grid in order to reflect changes. You can take a look at this online demo showing how to insert items in a client-side bound RadGrid:
Client-side Insert/Update/Delete

All the best,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ron
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or