v 1.8.083
single/double click su famMacc
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_AnagFamMacc.ascx.cs" Inherits="CMS_SC.WebUserControls.mod_AnagFamMacc" %>
|
||||
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="CodFam" DataSourceID="ods" CssClass="table table-striped" AllowPaging="True" AllowSorting="True">
|
||||
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="CodFam" DataSourceID="ods" CssClass="table table-striped" AllowPaging="True" AllowSorting="True" OnRowDataBound="grView_RowDataBound" OnRowEditing="grView_RowEditing">
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="info" />
|
||||
|
||||
@@ -42,5 +42,26 @@ namespace CMS_SC.WebUserControls
|
||||
// update!
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
protected void grView_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
// single click --> edit
|
||||
e.Row.Attributes["ondblclick"] = Page.ClientScript.GetPostBackClientHyperlink(grView, "Edit$" + e.Row.RowIndex);
|
||||
e.Row.Attributes["style"] = "cursor:pointer";
|
||||
// single click --> select
|
||||
e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(grView, "Select$" + e.Row.RowIndex);
|
||||
e.Row.Attributes["style"] = "cursor:pointer";
|
||||
}
|
||||
}
|
||||
|
||||
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
|
||||
{
|
||||
|
||||
grView.EditIndex = e.NewEditIndex;
|
||||
this.DataBind();
|
||||
//grView.Columns[2].Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user