Rank: Newbie Groups: Member
Joined: 10/6/2009 Posts: 1
|
when click the delete button in the Grid,it just logged the deleted item on the client side,I have to catch the deleted items through the post back. If it is possible to raise the server side event immediately when click the delete button, just like the Microsoft ASP.net Datagrid's event.
thanks.
Ben
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Yes. You would use a regular ButtonColumn instead of DeleteCommandColumn. You need to set the ButtonColumn's CommandName first. You can also set the ButtonColumn's ButtonText to "Delete" and ButtonType to "LinkButton" to display a "Delete" link. You would then handle the Grid's ClientSideOnItemCommand event to both delete the item and immediately trigger a server side event. It will be something like this:
Code: JavaScript
function grid_item_command_handler(
grid, itemIndex, colIndex, commandName)
{
//Replace "button_command_name" with whatever command
//name you set for your ButtonColumn
if (commandName == "button_command_name")
{
//Delete the item
grid.deleteItem(itemIndex);
//Trigger a post back
grid.raiseItemCommandEvent(itemIndex, commandName);
}
}
Code: HTML/ASPX
<eo:Grid ClientSideOnItemCommand="grid_item_command_handler" ....>
....
</eo:Grid>
Hope this helps. Thanks
|