Welcome Guest Search | Active Topics | Sign In | Register

about Grid_ItemDeleted Options
Ben Peng
Posted: Tuesday, October 6, 2009 10:25:34 PM
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
eo_support
Posted: Tuesday, October 6, 2009 11:11:21 PM
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.