/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/usercontrols/editablegridnew.ascx
474 строки
23 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="editableGridNew.ascx.vb" Inherits="UserControls_editableGridNew" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <%--<%@ Register Src="gridEditControl.ascx" TagName="gridEditControl" TagPrefix="uc1" %>--%> <%@ Register Src="advancedFilesList.ascx" TagName="advancedFilesList" TagPrefix="uc2" %> <%@ Register Src="txtDatePicker.ascx" TagName="txtDatePicker" TagPrefix="uc3" %> <%@ Register Src="confirmationPopup.ascx" TagName="confirmationPopup" TagPrefix="uc4" %> <%@ Register Src="gridActionControl.ascx" TagName="gridActionControl" TagPrefix="uc5" %> <%@ Register Src="gridStatusControl.ascx" TagName="gridStatusControl" TagPrefix="uc6" %> <%@ Register Src="numberValidator.ascx" TagName="numberValidator" TagPrefix="uc7" %> <%@ Register Src="Graph.ascx" TagName="Graph" TagPrefix="uc8" %> <%@ Register Src="multiselect.ascx" TagName="multiselect" TagPrefix="uc9" %> <%@ Register Src="~/UserControls/graphForTable.ascx" TagPrefix="uc1" TagName="graphForTable" %> <%--<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>--%> <%@ Register Src="condensedText.ascx" TagName="condensedText" TagPrefix="uc9" %> <link id="gridStyle" runat="server" rel="stylesheet" /> <link id="pageStyle" runat="server" rel="stylesheet" /> <asp:Panel ID="pnlGrid" runat="server" Visible="false"> <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> <Services> <asp:ServiceReference Path="~/Services/Service.svc" /> </Services> <Scripts> <asp:ScriptReference Path="~/Scripts/jquery-1.9.1.min.js" /> <asp:ScriptReference Path="~/Scripts/editableGrid.js" /> </Scripts> </asp:ScriptManagerProxy> <asp:HiddenField ID="InstanceId" runat="server" /> <uc4:confirmationPopup ID="confirmationPopup1" runat="server" /> <%--<asp:HiddenField ID="lblMessage" runat="server" Value="" />--%> <%--<asp:HiddenField ID="lblEditingObject" runat="server" Value="" />--%> <asp:HiddenField ID="lblTableName" runat="server" Value="" /> <asp:HiddenField ID="lblTableId" runat="server" Value="" /> <asp:HiddenField ID="lblViewId" runat="server" Value="" /> <asp:HiddenField ID="hfUserName" runat="server" Value="" /> <asp:HiddenField ID="formulas" runat="server" /> <asp:HiddenField ID="controlState" runat ="server" Value ="{}"/> <asp:HiddenField ID="pr_refresh_after_event" runat ="server" Value ="" ClientIDMode="Static" /> <table style="margin: 0 auto; border: 1px Solid #E6E6E6" id="tblFilters" runat="server"> <tr> <td> <asp:PlaceHolder ID="phFilters" runat="server"> </asp:PlaceHolder> </td> <td style="vertical-align: middle; padding-left: 5px;"> <asp:PlaceHolder ID="phBtnFilterReset" runat="server"> </asp:PlaceHolder> </td> <td style="vertical-align: middle; padding-left: 5px;"> <asp:ImageButton ID="btnRefresh" runat="server" ImageUrl="~/Images/Refresh.png" /> </td> <td style="vertical-align: middle; padding-left: 5px;"> <asp:Image ID="ExDown" runat="server" AlternateText="Excel Download" Height="28px" ImageUrl="~/Images/Microsoft Office 2003 Excel.png" ToolTip="Excel download" CssClass="click exdown" Width="28px" /> </td> <td style="vertical-align: middle; padding-left: 5px;"> <%-- -----------Add new item------------ --%> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:HiddenField ID="lblGridStatus" runat="server" Value="VIEW" /> <asp:ImageButton ID="AddNewItem" runat="server" AlternateText="AddNewItem" ImageUrl="~/Images/Buttons/24/Plus.png" ToolTip="Add new item" /> <asp:Panel runat="server" ID="pnlAddNewItem" CssClass="borderRadius popup pnlAddNewItem" ClientIDMode="Static" Widht="300px" Visible="false" DefaultButton="ibSaveNewItem"> <div id="dvHeader" style="font-weight: bold;"> <table style="width: 100%; cursor: move;"> <tr> <td style="width: 100%; text-align: center;">Add new item </td> <td style="padding-left: 10px"> <asp:ImageButton runat="server" ID="ibSaveNewItem" ImageUrl="~/Images/Buttons/set2/save.png" /> </td> <td style="padding-left: 10px"> <asp:ImageButton runat="server" ID="ibCancelNewItem" ImageUrl="~/Images/Buttons/set2/no.png" /> </td> </tr> </table> </div> <hr /> <asp:PlaceHolder runat="server" ID="AddFormFields"></asp:PlaceHolder> <table runat="server" id="tblAddNewItem"> </table> <asp:HiddenField ID="tempNewItemId" runat="server" Value="0" /> </asp:Panel> <asp:DragPanelExtender ID="pnlAddNewItem_DragPanelExtender" runat="server" DragHandleID="dvHeader" Enabled="True" TargetControlID="pnlAddNewItem"></asp:DragPanelExtender> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="AddNewItem" /> <asp:PostBackTrigger ControlID="ibSaveNewItem" /> </Triggers> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="50" style="text-align: center;"> <ProgressTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/gif/24.gif" Style="position: absolute; left: 48%; top: 30%;" /> </ProgressTemplate> </asp:UpdateProgress> </td> <td style="vertical-align: middle; padding-left: 5px;"> <asp:PlaceHolder ID="phActions" runat="server"></asp:PlaceHolder> </td> <td style="vertical-align: middle; padding-left: 5px;"> <asp:Image ID="DataUpload" CssClass="click dataupload" runat="server" AlternateText="Data Upload" ImageUrl="~/Images/Buttons/24/Database.png" ToolTip="Data bulk upload" Visible="false" /> </td> <td style="vertical-align: middle; padding-left: 5px;"> <asp:Image ID="ibSendEmail" runat="server" AlternateText="Send email" ImageUrl="~/Images/Buttons/24/mail.png" ToolTip="Send this grid by email" CssClass="click sendemail" Visible="False" /> </td> <td style="vertical-align: middle; padding-left: 15px;"> <asp:Image ID="ibDeleteData" CssClass="click deleteall" runat="server" AlternateText="Delete all selected data" ImageUrl="~/Images/Buttons/24/trash_red.png" ToolTip="Delete all selected data" Visible="False" /> </td> </tr> </table> <table style="width: 800px;" cellpadding="2" cellspacing="0"> <tr> <td style="border: 1px Solid #E6E6E6"> <div style="margin: 0 auto; width: 90%; text-align: center; vertical-align: middle"> Total records selected <asp:Literal ID="lblStatus" runat="server"></asp:Literal>(<asp:TextBox ID="txtPagerSIze" runat="server" Width="20px" AutoPostBack="True"></asp:TextBox> per page) </div> </td> <td style="border: 1px Solid #E6E6E6"> <asp:RadioButtonList ID="rblOperationMOde" runat="server" RepeatDirection="Horizontal" AutoPostBack="True"> <asp:ListItem Selected="True" Value="ajaxedit">Double click</asp:ListItem> <asp:ListItem Value="ajaxedit_click">Single click</asp:ListItem> </asp:RadioButtonList> </td> <td style="border: 1px Solid #E6E6E6"> <asp:Label ID="lblMessageText" runat="server" Visible="true"></asp:Label></td> <td style="border: 1px Solid #E6E6E6"><asp:DropDownList ID="ddlView" runat ="server" AutoPostBack ="true" ></asp:DropDownList></td> </tr> </table> <hr /> <div style="text-align: center"> <asp:Label runat="server" ID="lblCaption" Text=" Caption" Font-Size="Large" ForeColor="Blue"></asp:Label> </div> <hr /> <%-- -----------Bulk data upload------------ --%> <asp:Panel runat="server" ID="pnlDataUpload" CssClass="borderRadius popup hidden" Width="500px"> <div id="dvHeaderDataUpload" style="font-weight: bold;"> <table style="width: 100%; cursor: move;"> <tr> <td style="width: 100%; text-align: center;">Data upload from Excel<br /> <span style="color: Navy; font-size: small;">First download excel form for this table, arrange your data in excel according to the given format and copy/paste data from excel to text box below (without header). </span> </td> <td style="padding-left: 10px"> <asp:Image runat="server" ID="CancelDataUpload" CssClass="closepopup" ImageUrl="~/Images/cancel.png" /> </td> </tr> </table> </div> <hr /> <table style="width: 100%; display: none;"> <tr> <td>Select your decimal notation format: </td> <td> <asp:RadioButtonList ID="rblDecimalNotation" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1" Selected="True">0.000</asp:ListItem> <asp:ListItem Value="0">0,000</asp:ListItem> </asp:RadioButtonList> </td> <td>Select your date format: </td> <td> <asp:RadioButtonList ID="rblDateFormat" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="0" Selected="True">dd.MM.yyyy</asp:ListItem> <asp:ListItem Value="1">yyyy-MM-dd</asp:ListItem> </asp:RadioButtonList> </td> </tr> </table> <hr /> <table class="center centerAlign "> <tr> <td> <asp:ImageButton ID="ibUpload" CssClass="closepopup" runat="server" ImageUrl="~/Images/Buttons/24/Download.png" ToolTip="Upload" /> </td> </tr> <tr> <td> <asp:Literal ID="ltrUploadResults" runat="server"></asp:Literal> </td> </tr> </table> <asp:TextBox ID="txtDataToUpload" runat="server" TextMode="MultiLine" Height="242px" Width="500px"></asp:TextBox> </asp:Panel> <asp:DragPanelExtender ID="DragPanelExtender1" runat="server" DragHandleID="dvHeaderDataUpload" Enabled="True" TargetControlID="pnlDataUpload"></asp:DragPanelExtender> <%-- -----------Mail recipients------------ --%> <asp:Panel runat="server" ID="pnlMailRecepients" CssClass="borderRadius popup hidden" Width="300px"> <div id="Div1" style="font-weight: bold;"> <table style="width: 100%; cursor: move;"> <tr> <td style="width: 100%; text-align: center;">Send data to mail<br /> <%--<span style="color: Navy; font-size: small;">Copy/Paste as list of mail recepients - Single Id's - to the textbox below</span>--%> </td> <td> <asp:ImageButton ID="doSendEmail" runat="server" CssClass="closepopup" AlternateText="Send email" ImageUrl="~/Images/Buttons/24/mail.png" ToolTip="Send" /> </td> <td style="padding-left: 10px"> <asp:Image runat="server" ID="CancelEmail" ImageUrl="~/Images/cancel.png" CssClass="click closepopup" ToolTip="Cancel" /> </td> </tr> </table> </div> Title: <br /> <asp:TextBox ID="mailTitle" runat="server" Width="100%"></asp:TextBox> <br /> To (single ID each in a new row):<br /> <asp:TextBox ID="txtMailRecepients" runat="server" TextMode="MultiLine" Height="50px" Width="100%"></asp:TextBox> <br /> <asp:CheckBox ID="separateCopy" runat="server" Text="individual copy to each id" ToolTip="Checked - each recipient will receive his own copy. Unchecked - one copy send to all" Checked="False" /> <br /> Text: <br /> <asp:TextBox ID="txtMessageText" runat="server" TextMode ="MultiLine" /> </asp:Panel> <asp:DragPanelExtender ID="DragPanelExtender2" runat="server" DragHandleID="Div1" Enabled="True" TargetControlID="pnlMailRecepients"> </asp:DragPanelExtender> <%-------------Excel download options--------------%> <asp:Panel runat="server" ID="pnlEXcelDownloadOptions" CssClass="borderRadius hidden popup" Width="200px"> <div id="dvExcelDownloadOptions" style="font-weight: bold;"> <table style="width: 100%; cursor: move;"> <tr> <td colspan ="3" style="width: 100%; text-align: center;">Excel download options </td> </tr> <tr> <td>Download with format</td> <td>Fast download</td> <td></td> </tr> <tr> <td> <asp:ImageButton ID="ibExcelDownloadWithOoptions" runat="server" CssClass="closepopup" AlternateText="Download with format" ImageUrl="~/Images/excel1.png" ToolTip="Download" /> </td> <td> <asp:ImageButton ID="ibExcelDownloadFust" runat="server" CssClass="closepopup" AlternateText="Fast download" ImageUrl="~/Images/excel2.png" ToolTip="Download" /> </td> <td style="padding-left: 10px"> <asp:Image runat="server" ID="ExDownCancel" CssClass="click closepopup" ImageUrl="~/Images/Cancel.png" ToolTip="Cancel" /> </td> </tr> </table> </div> <asp:CheckBox ID="chkWithInvisibleFields" runat="server" Text="With invisible fields" Visible=" false"/> </asp:Panel> <asp:DragPanelExtender ID="DragPanelExtender3" runat="server" DragHandleID="dvExcelDownloadOptions" Enabled="True" TargetControlID="pnlEXcelDownloadOptions"> </asp:DragPanelExtender> <%----------------------------------------%> <%------------- Delete all data --------------%> <asp:Panel ID="pnlDeleteAll" runat="server" CssClass="borderRadius popup hidden" Width="200px"> <strong> <p id="confirmationMessage">Are you sure to delete all selected items?</p> </strong> <table style="width: 100%; border-style: none; border-collapse: collapse;" class="center centerAlign"> <tr> <td> <asp:ImageButton ID="btnYes" CssClass="closepopup" runat="server" Text="Yes" ImageUrl="~/Images/ok.png" /> </td> <td> <asp:Image ID="btnNo" CssClass="click closepopup" runat="server" Text="No" ImageUrl="~/Images/Cancel.png" /> </td> </tr> </table> <asp:HiddenField ID="hfItemId" ClientIDMode="Static" runat="server" Value="-1" /> </asp:Panel> <%---------------------File upload-----------------------------%> <div id="choosefile" runat="server" clientidmode="static" class="popup" style="display: none; background-color: lightyellow; border: 2px solid Gray; text-align: center; padding: 5px;"> <input id="selectedfile" clientidmode="Static" runat="server" type="file" style="background-color: lightgreen;" class="selectedfile" /> <br /> <br /> <asp:Image ID="savefile" ClientIDMode="Static" runat="server" ImageUrl="~/Images/Buttons/set2/save.png" CssClass="savefile click" /> <asp:Image ID="cancelfile" ClientIDMode="Static" runat="server" ImageUrl="~/Images/Buttons/set2/no.png" CssClass="cancelfile click" /> </div> <%--------------------------------------------------%> <%---------------------File delete-----------------------------%> <div id="confirmdeletefile" runat="server" clientidmode="static" class="popup" style="display: none; background-color: lightyellow; border: 2px solid Red; text-align: center; padding: 5px;"> Sure to delete? <br /> <br /> <asp:Image ID="deletefile" ClientIDMode="Static" runat="server" ImageUrl="~/Images/Buttons/set2/save.png" CssClass="deletefile click" /> <asp:Image ID="canceldeletefile" ClientIDMode="Static" runat="server" ImageUrl="~/Images/Buttons/set2/no.png" CssClass="canceldeletefile click" /> </div> <%---------------------Row delete-----------------------------%> <div id="confirmdeleterow" runat="server" clientidmode="static" class="popup" style="display: none; background-color: lightyellow; border: 2px solid Red; text-align: center; padding: 5px;"> Sure to delete? <br /> <br /> <asp:Image ID="deleterowbutton" ClientIDMode="Static" runat="server" ImageUrl="~/Images/Buttons/set2/save.png" CssClass="deleterow click" /> <asp:Image ID="canceldeleterow" ClientIDMode="Static" runat="server" ImageUrl="~/Images/Buttons/set2/no.png" CssClass="canceldeleterow click" /> </div> <%--------------------------------------------------%> <div style="text-align: center"> <asp:PlaceHolder ID="phSubReport" runat="server"></asp:PlaceHolder> </div> <div id="dvPlaySound" runat="server" style="visibility: hidden;" /> <asp:Panel ID="noticeBaloon" Visible="false" runat="server" Style="background-color: #FEFCC8; border: 1pt solid gray; padding: 5px; position: absolute; top: 3px; left: 3px;" CssClass="borderRadius notice"> <asp:Image runat="server" ImageUrl="~/Images/Buttons/set2/no.png" Style="float: right;" class="click" onclick="hideNotice();" /> <b>System Updates:</b><br /> Edit - double click on cell<br /> Cancel edit - ESC button<br /> Save - enter<br /> New row in a TEXT BOX - Shift+Enter<br /> <b>Обновление системы:</b><br /> Редактирование - двойной щелчек <br /> Отмена редактирования - кнопка ESC<br /> Сохранение - Enter<br /> Новая строка в TEXT BOX - Shif+Enter </asp:Panel> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" CellPadding="4" EmptyDataText="No Data found" ForeColor="#333333" GridLines="Both" ShowFooter="True" ShowHeaderWhenEmpty="True" Style="margin: 0 auto;" CssClass="ScrollTable edtable" Font-Size="8pt" CaptionAlign="Top" PageSize="1"> <AlternatingRowStyle BackColor="White" /> <EditRowStyle BackColor="#2461BF" /> <EmptyDataRowStyle BackColor="Red" /> <FooterStyle BackColor="#4682B4" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#4682B4" Font-Bold="True" ForeColor="White" /> <PagerSettings Mode="NumericFirstLast" PageButtonCount="5" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="#EFF3FB" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <SortedAscendingCellStyle BackColor="#F5F7FB" /> <SortedAscendingHeaderStyle BackColor="#6D95E1" /> <SortedDescendingCellStyle BackColor="#E9EBEF" /> <SortedDescendingHeaderStyle BackColor="#4870BE" /> </asp:GridView> </asp:Panel> <asp:Panel ID="pnlNoAccess" runat="server" HorizontalAlign="Center"> <h2>Sorry, you don't have an access to view that table. </h2> <br /> <h3>Please, contact the person resposible: <asp:Label runat="server" ID="lblResponsble"></asp:Label> </h3> </asp:Panel> <asp:Panel ID="pnlNoTableInfo" runat="server" Visible="false" HorizontalAlign="Center"> <h2>No table selected</h2> </asp:Panel>