Kim Birkelund
Top achievements
Rank 1
Kim Birkelund
asked on 19 Feb 2010, 09:26 AM
Hi
I'm creating a grid where I'd like to be able to delete a row client-side and have the delete command sent to the server using AJAX. What I did was to add a GridClientDeleteColumn to the grid, set AllowAutomaticDeletes=true on the MasterTableView and hook the RowDeleting client event. However when I click the Delete link nothing happens. The event isn't raised and the row isn't removed. I'm using client-side data binding through a web-service.
If I instead create a button column and set the command name to Delete, the Command event is fired correctly (but with no reference to the row in question). So apparently the command system is working, and if I place a breakpoint in the onclick of the Delete link emitted by the GridClientDeleteColumn I can see that it is called, but returns false before reaching my event handler.
Any ideas?
I'll try to recreate the problem in a smaller example, and post my finding, but wanted to post the question in case anyone had experienced similar problems.
/kim
7 Answers, 1 is accepted
0
Kim Birkelund
Top achievements
Rank 1
answered on 19 Feb 2010, 09:33 AM
I just tried using server-side data binding on a smaller example, and it confirmed my suspicion that it has to do with using client-side data binding.
I would still like a fix or workaround to the above scenario.
/kim
0
Hello Kim,
Tsvetoslav
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.
Please, take a look at our online example along the lines of your scenario.
Greetings,Tsvetoslav
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
Kim Birkelund
Top achievements
Rank 1
answered on 23 Feb 2010, 11:40 AM
Which example are you refering to? I can't seem to find one that uses the client-side events with client-side data binding.
/kim
0
Hello Kim,
Excuse me for having missed the example link:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/databinding/defaultcs.aspxWith client-side binding you should not be sending a request to the server but achieve your operations on the grid through web service or page method calls. I'd like to pay attention to how the sort and filter operations are achieved in the above example: the client OnCommand event is intercepted, a call to the page method needed is executed and the grid is rebound on the client.
In the same way you need to implement the delete operation: intercept the delete command in the OnCommand event on the client, issue a web-service call to a specific method that should delete the row from the underlying data source and rebind the grid.
I hope this information helps.
Regards,
Tsvetoslav
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.
Tsvetoslav
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
Kim Birkelund
Top achievements
Rank 1
answered on 23 Feb 2010, 11:58 AM
That is basically what I attempted to do, but the event args of the OnCommend event doesn't refer the row to be deleted as far as I can tell.
/kim
0
Hello Kim,
Tsvetoslav
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.
The get_commandArgument() method of the event args object does contain the row to be deleted. Do try it for yourself.
Regards,Tsvetoslav
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
Kim Birkelund
Top achievements
Rank 1
answered on 26 Feb 2010, 08:05 AM
Ahh, I'll try that. Thanks.
/kim