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

redgrid show insert row on client-side

5 Answers 213 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yotam
Top achievements
Rank 1
Yotam asked on 01 May 2012, 03:40 PM
Hi
I'm currently finding my way on radgrid client side scripting
i want to open the insert row (when client click on "add new record") without postback - is there a way to do it?

or even better - how can i work with radgrid entirly from the client side
I mean that my ultimate goal is to get the records from my data source when the page is initialized
but then work "offline" when inserting/updaing/deleting records will be made only in the grid itself
(and later when the client submit the page - i will extract the changes and do stuff on the server side...)

thank you
Yotam

5 Answers, 1 is accepted

Sort by
0
Accepted
Richard
Top achievements
Rank 1
answered on 02 May 2012, 07:52 PM
Yotam:

I would suggest that you take a close look at the following online demos.

Grid/Client Edit with Batch Server Update for insights on how to allow for extensive client-side editing and a single postback to process all changes on the server-side.

Grid/Client-Side Insert/Update/Delete for insights on client-side editing.

I hope this helps!
0
Yotam
Top achievements
Rank 1
answered on 10 May 2012, 07:13 AM
Thanks
these demos helped me update the grid on client side
now i have to figure out how to insert empty row and fill it as well
I guess it's practicaly the same
thanks
1
Eyup
Telerik team
answered on 14 May 2012, 03:46 PM
Hi Yotam,

You could fire an insert command client-side as shown below:
function FireInitInsertCommand() {
 var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
 masterTable.fireCommand("InitInsert", "");
}
For PerformInsert and other client-side commands, please refer to the following article:
Fire Grid Command Client-Side

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jeffrey
Top achievements
Rank 1
answered on 26 Sep 2012, 09:43 PM
I'm a little confused as to what this is supposed to do. 

I'm in a similar scenario - I have a grid that i'm binding to a web service that works fine, but I want to be able to allow the user to insert and edit data entirely on the client before clicking on a Save button that would actually perform the postback. 

The only thing I'm missing is how to add a row to the grid on the client side.  I tried the example above, but it doesn't seem to do anything.  I want to add the row and them have them edit it inline, not using a form as shown here: http://demos.telerik.com/aspnet-ajax/grid/examples/client/insertupdatedelete/defaultcs.aspx 
1
Eyup
Telerik team
answered on 28 Sep 2012, 10:45 AM
Hello Jeffrey,

You could use InPlace edit mode:
  mark-up:
<MasterTableView ... EditMode="InPlace">
And fire an InitInsert command as demonstrated in the previous reply:
function FireInitInsertCommand() {
    var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    masterTable.fireCommand("InitInsert", "");
}

If the command does not get fired, could you please enable your script debugging and check whether there are any errors interfering?

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Yotam
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Yotam
Top achievements
Rank 1
Eyup
Telerik team
Jeffrey
Top achievements
Rank 1
Share this question
or