M
Maziar Aflatoun
Hi,
I have a repeater that contains data and I like the ablility to delete each
row once the delete button is clicked. I have placed a delete button in each
row which fires up an event which in return gives me a row id. Now I like
to hide the 'FileName' in my <asp:Button> as well too so I can grab it after
I click the delete button of that row. Right now it works. However, it
return the e.ItemIndex. Is it possible to hide the FileName value in my
<asp:Button> or in the row of that button?
<%# DataBinder.Eval(Container.DataItem,"DeleteFileName")%>
<ItemTemplate>
<tr>
<td><asp:Button Text='' CommandName="Delete" Runat=server
ID="ButtonDelete">
</asp:Button></td>
<td><%# DataBinder.Eval(Container.DataItem, "FileName")
%></td>
<td><%# DataBinder.Eval(Container.DataItem, "FileSize")
%></td>
</tr>
</ItemTemplate>
and
private void RepeaterAttachments_ItemCommand(object source,
System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
int DeleteItem = e.Item.ItemIndex;
if (e.CommandName.CompareTo("Delete") == 0)
{
Response.Write("DeleteItem:" + DeleteItem + "<br>");
}
}
Thank you
Maziar A.
I have a repeater that contains data and I like the ablility to delete each
row once the delete button is clicked. I have placed a delete button in each
row which fires up an event which in return gives me a row id. Now I like
to hide the 'FileName' in my <asp:Button> as well too so I can grab it after
I click the delete button of that row. Right now it works. However, it
return the e.ItemIndex. Is it possible to hide the FileName value in my
<asp:Button> or in the row of that button?
<%# DataBinder.Eval(Container.DataItem,"DeleteFileName")%>
<ItemTemplate>
<tr>
<td><asp:Button Text='' CommandName="Delete" Runat=server
ID="ButtonDelete">
</asp:Button></td>
<td><%# DataBinder.Eval(Container.DataItem, "FileName")
%></td>
<td><%# DataBinder.Eval(Container.DataItem, "FileSize")
%></td>
</tr>
</ItemTemplate>
and
private void RepeaterAttachments_ItemCommand(object source,
System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
int DeleteItem = e.Item.ItemIndex;
if (e.CommandName.CompareTo("Delete") == 0)
{
Response.Write("DeleteItem:" + DeleteItem + "<br>");
}
}
Thank you
Maziar A.