This question is locked. New answers and comments are not allowed.
Kapil Koli
Top achievements
Rank 1
Kapil Koli
asked on 03 Mar 2010, 01:08 PM
Hi,
I am using telerik grid and my last column of last row contains a link button "Add".
On this button click, I want to add a row to the grid. How can I do so?
Second, the same last column contains link buttons "Edit" for all rows.
Now I need to edit the row, in Grid itself, on clicking edit.
Is it possible to achieve this?
Thanks in advance,
Kapil
I am using telerik grid and my last column of last row contains a link button "Add".
On this button click, I want to add a row to the grid. How can I do so?
Second, the same last column contains link buttons "Edit" for all rows.
Now I need to edit the row, in Grid itself, on clicking edit.
Is it possible to achieve this?
Thanks in advance,
Kapil
5 Answers, 1 is accepted
0
Accepted
Hi Kapil Koli,
To add a row to the grid simply add a new item to the underlying data source. The grid will rebind and show the new item.
Inline editing is a built-in feature. You can see a preview here. I suggest you try the Q1 2010 futures release.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
To add a row to the grid simply add a new item to the underlying data source. The grid will rebind and show the new item.
Inline editing is a built-in feature. You can see a preview here. I suggest you try the Q1 2010 futures release.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Kapil Koli
Top achievements
Rank 1
answered on 04 Mar 2010, 05:41 AM
Thanks Atanas for your quick response.
I have couple of doubts again.
1. Can I have link buttons instead of buttons?
2. How can I insert a new table on "INSERT" button click?
3. Do I need any specific script for this?
Thanks again.
I have couple of doubts again.
1. Can I have link buttons instead of buttons?
2. How can I insert a new table on "INSERT" button click?
3. Do I need any specific script for this?
Thanks again.
0
Hello Kapil Koli,
No, you cannot use link buttons. Actually the Edit and Cancel buttons are links but are styled to look like buttons for consistency. The Update and Delete are buttons because they should post the edit form.
I do not understand your question "How can I insert a new table on "INSERT" button click". Could you elaborate?
As for required JavaScript - everything shown in the online demos is built-in and the user needs to write only the server side code for deleting and saving records.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
No, you cannot use link buttons. Actually the Edit and Cancel buttons are links but are styled to look like buttons for consistency. The Update and Delete are buttons because they should post the edit form.
I do not understand your question "How can I insert a new table on "INSERT" button click". Could you elaborate?
As for required JavaScript - everything shown in the online demos is built-in and the user needs to write only the server side code for deleting and saving records.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Levi
Top achievements
Rank 1
answered on 25 Oct 2011, 06:20 PM
Atana, you mention an interesting approach. I like the idea of having the grid rebind with an appended datasource. The true question is how is this implemented?
I am using an Ajax databinding: .DataBinding(dataBinding => dataBinding.Ajax().Select("Default", new { action = "TagsData" ))
But I cannot figure out how to append a parameter to the request url for the data in order to tell the Action to append a new and blank entry to the datasource that it returns, in the likely event of adding a new row of data.
Now I'm wondering, when you say "To add a row to the grid simply add a new item to the underlying data source.", do you mean:
1. Add a new item to the clientside datasource. For instance, the $("#Grid2").data('tGrid').DataItem.
2. Or, add a new item to the list of DataModels in the action when a request is made for the data.
If you meant option #1, what all is involved? Is there event listeners that will automatically add a new row if a new item is added to DataItem? Or will a Bind or Rebind function need to be called?
If you meant option #2, how would you recommend telling the Action to add the new item? Should we use the rebind function or some other or possibly overloaded function?
I am using an Ajax databinding: .DataBinding(dataBinding => dataBinding.Ajax().Select("Default", new { action = "TagsData" ))
But I cannot figure out how to append a parameter to the request url for the data in order to tell the Action to append a new and blank entry to the datasource that it returns, in the likely event of adding a new row of data.
Now I'm wondering, when you say "To add a row to the grid simply add a new item to the underlying data source.", do you mean:
1. Add a new item to the clientside datasource. For instance, the $("#Grid2").data('tGrid').DataItem.
2. Or, add a new item to the list of DataModels in the action when a request is made for the data.
If you meant option #1, what all is involved? Is there event listeners that will automatically add a new row if a new item is added to DataItem? Or will a Bind or Rebind function need to be called?
If you meant option #2, how would you recommend telling the Action to add the new item? Should we use the rebind function or some other or possibly overloaded function?
0
Hello Levi,
Atanas Korchev
the Telerik team
I don't really understand what you are asking. Adding records to the grid is demonstrated in all editing online demos. The record is added to the underlying data source and then data is returned back to the grid. You can check the Controller code viewer tab in the editing examples.
Regards,Atanas Korchev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now