completato comportamento checkbox selezione

This commit is contained in:
Samuele E. Locatelli
2014-04-09 13:15:43 +02:00
parent d7382b03f6
commit ab9266b60b
6 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -223,7 +223,7 @@
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
<asp:CheckBox ID="chkSelect" runat="server" OnCheckedChanged="btnSel_Click" AutoPostBack="true" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="btnSelAll" runat="server" Checked="false" ToolTip='<%# traduci("btnSelAll") %>'
@@ -233,15 +233,38 @@ namespace C2P.WebUserControls
if (!isChecked)
{
chkbox.ToolTip = traduci("btnSelAll");
numSel = 0;
}
else
{
chkbox.ToolTip = traduci("btnDeselAll");
numSel = grView.Rows.Count;
}
foreach (GridViewRow riga in grView.Rows)
{
((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked;
}
setBtnVisib();
}
/// <summary>
/// gestione singolo click
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSel_Click(object sender, EventArgs e)
{
// seleziono tutti i valori visibili nel datagrid
CheckBox chkbox = ((CheckBox)sender);
bool isChecked = chkbox.Checked;
if (isChecked)
{
numSel++;
}
else
{
numSel--;
}
setBtnVisib();
}
}
}
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.