0
I have a grid with Repeater:
<asp:Repeater ID="rtInlineBlock" runat="server">
<ItemTemplate>
<div class="block">
<asp:HiddenField ID="idDirectorio" runat="server" Value='<%# Eval("guid") %>' />
<asp:HiddenField ID="isFolder" runat="server" Value='<%# Eval("isFolder") %>' />
<asp:ImageButton ID="btSend" runat="server" ImageUrl='<%# Eval("imgPath") %>' OnClick="btSend_Click" />
<div class="bottom">
<asp:CheckBox ID="check" runat="server" OnCheckedChanged="check_CheckedChanged" AutoPostBack="true" />
<asp:Label ID="lblNome" runat="server" Text='<%# Eval("xInfo") %>' />
</div>
</div>
</ItemTemplate>
</asp:Repeater>
And my selection event:
protected void check_CheckedChanged(object sender, EventArgs e)
{
var cbSend = sender as CheckBox;
var rtItem = cbSend.Parent as RepeaterItem;
int cont = 0;
foreach (var item in rtInlineBlock.Items)
{
if (cbSend.Checked)
{
cont = cont + 1;
}
}
}
I tried that way, but always takes all the checkboxes, I want only the selected.
I’ve done it that way, but then it shows everyone. I just want an external boot (delete in case) to delete more than one.So I was just preparing before. store these values, but then it didn’t work.
– War Lock
No need to store in a Preview way, the external Button can scroll through the Repeater Items and read the Repeater Items data
– Tobias Mesquita
So how would you look at another event? the deletar event calls a Deletardiretorio() method, within this method it takes the selected cb, but only takes 1 the current one that comes in the Viewstate, then as it would be, because if I call the Rtitem in another method, from null
– War Lock