This is a migrated thread and some comments may be shown as answers.

on Refresh page functionality

2 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mano
Top achievements
Rank 1
mano asked on 20 Oct 2008, 07:13 AM

i have a templete column in which asp image is placed. i want the following functionality:

When the onclick is fired,

1) first the icon is changed
2) that row in which the icon is placed is deleted on next refresh.

how can i mark the row in onclick event?? so that i can delete it next it. plz help

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Oct 2008, 11:18 AM
Hello Mano,

You can save the row index in a session variable as shown below and then retrieve the value and delete that row on refreshing the grid.
cs:
// On button Click or DeleteCommand
 Session["RowIndex"] = e.Item.ItemIndex.ToString();             
              

Thanks
Shinu.
0
mano
Top achievements
Rank 1
answered on 28 Oct 2008, 08:03 AM

if

(e.CommandName.Equals("Delete"))

 

{

    GridDataItem item = (GridDataItem)e.Item;

 

 

    ImageButton img = (ImageButton) item["Action2"].FindControl("Action2");

 

 

    img.ImageUrl = "images/accept.gif" + e.Item.ItemIndex.ToString() ;

 

 

    Session["RowIndex"] = e.Item.ItemIndex.ToString();

 

}

 

 

<telerik:GridTemplateColumn UniqueName="Action2" DataField="Action" HeaderText="2">

 

 

<ItemTemplate>

 

 

 

 

 

<asp:ImageButton ID="Action2" runat="server" CommandName="Delete" ImageUrl='<%# Eval("Action") %>'/>

 

 

</ItemTemplate>

 

 


this would work... i have achieved to delete the row on next refresh but
the url of image is not changed immediately.

i want to do both the things...
on click , the url changes immediately either on client side or server side and stores the row index in session.
 then on next refresh the row is deleted.

i have achieved to delete the row, but url is not changing??

any clue ?

Tags
Grid
Asked by
mano
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
mano
Top achievements
Rank 1
Share this question
or