I have a bunch of grids and i need to be able to delete rows, then undelete them if needed. Right now i have a red x for the delete column, which is in a GridButtonColumn, but i would like to change the icon to something that represents an undelete action. I'm able to undelete the row by going through each row in the onitemdatabound function and changing the commandname for the GridButtonColumn to undelete, but i can't seem to change the image. this is what i have for the onitemdatabound right now:
I check to see if the row in in a deleted state in there, but i removed it for simplicity
protected void ManageUsersGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
GridDataItem item = e.Item as GridDataItem;
if (item != null)
{
LinkButton button = item["DeleteColumn"].Controls[0] as LinkButton;
button.CommandName = "Undelete";
}
}
I check to see if the row in in a deleted state in there, but i removed it for simplicity