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

Fast way of adding many items to RadGrid

3 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 20 Nov 2012, 07:44 PM
Hi,

I need to provide a grid with the possibility of fast input. My "dream scenario" is:

1. Grid loads existing items. We have two columns one invisible with database ID and one text column "Name".
2. Then I want the user to client-side be able to fast add new items without the need of pressing a "New item" button and just press enter to confirm the actual row to begin editing another new row. Then the button "Save" is pressed, a post-back is generated and on the server I can iterate through "RadGrid.ClientChanges" and add all newly added rows to the database.

Is this possible?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 23 Nov 2012, 09:35 AM
Hi Martin,

Thank you for contacting us.

I believe you are looking for a functionality resembling the following demos:
   Batch Server Update    
   Performing Batch Updates
   http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/shareddatepicker/defaultcs.aspx?product=grid

I hope this will prove helpful. Please let us know if you need further assistance.

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.
0
Martin
Top achievements
Rank 1
answered on 23 Nov 2012, 09:55 AM
Hello and thank you for your answer.

Unfortunately none of the demos you supplied makes it possible to ADD new items just using an "Enter" press. I do not want the end user to move his hand to the mouse and click something to add a new row. 

As well, I cannot move around and edit nodes using the arrow keys. I need to double click each cell for edit and I donĀ“t want the end user to need to do that.
0
Eyup
Telerik team
answered on 27 Nov 2012, 02:55 PM
Hi Martin,

In such case, you could enable the keyboard support provided by RadGrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/keyboardnavigation/defaultcs.aspx

or use its OnKeyPress ClientSide event to catch the Enter key press and execute your custom logic.

Please note that opening multiple insert forms is not supported:
   One postback inserting multiple rows
   Grid multiple inserts

You could fire an InitInsert command from client side:
http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-firecommand.html

or open an insert form by default and make it visible only when a given function is called:
Copy Code
Copy Code
protected void RadGrid1_DataBinding(object sender, EventArgs e)
{
    RadGrid1.MasterTableView.InsertItemDisplay = GridInsertItemDisplay.Bottom;
    RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace;
    RadGrid1.MasterTableView.IsItemInserted = true;
}
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    RadGrid1.MasterTableView.GetInsertItem().Display = false;
}

JavaScript:
Copy Code
Copy Code
Copy Code
function openInsertForm() {
    var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    masterTable.get_insertItem().style.display = "";
}

I hope this helps.

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
Martin
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Martin
Top achievements
Rank 1
Share this question
or