fix comportamento sel/edit

This commit is contained in:
Samuele E. Locatelli
2018-07-16 10:44:32 +02:00
parent 64711fe5c6
commit a1d83b38da
2 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -82,7 +82,7 @@
</div>
<div class="row">
<div class="col-12">
<asp:GridView runat="server" ID="grViewElRich" AutoGenerateColumns="False" DataKeyNames="idxRichiesta" DataSourceID="odsElRich" AllowPaging="True" Width="100%" AllowSorting="True" PageSize="5" CellPadding="4" ForeColor="#333333" GridLines="None" CssClass="table table-responsive table-striped">
<asp:GridView runat="server" ID="grViewElRich" AutoGenerateColumns="False" DataKeyNames="idxRichiesta" DataSourceID="odsElRich" AllowPaging="True" Width="100%" AllowSorting="True" PageSize="5" CellPadding="4" ForeColor="#333333" GridLines="None" CssClass="table table-responsive table-striped" OnRowCancelingEdit="grViewElRich_RowCancelingEdit" OnRowEditing="grViewElRich_RowEditing" OnSelectedIndexChanging="grViewElRich_SelectedIndexChanging">
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
@@ -91,8 +91,26 @@ namespace PUB.WebUserContols
protected void lbtReset_Click(object sender, EventArgs e)
{
grViewElRich.EditIndex = -1;
grViewElRich.SelectedIndex = -1;
grViewElRich.DataBind();
}
protected void grViewElRich_RowEditing(object sender, GridViewEditEventArgs e)
{
// imposto selezione a riga in edit
grViewElRich.SelectedIndex = -1;
}
protected void grViewElRich_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
grViewElRich.EditIndex = -1;
}
protected void grViewElRich_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
grViewElRich.EditIndex = -1;
grViewElRich.SelectedIndex = -1;
}
}
}