<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_trascFormDmtx.ascx.cs" Inherits="GMW.WebUserControls.mod_trascFormDmtx" %>
<asp:GridView runat="server" ID="grView" AutoGenerateColumns="False" DataKeyNames="FormatoDtmxMM,FormatoDtmx" DataSourceID="ods" AllowSorting="True" Width="100%" CssClass="table table-striped table-condensed table-responsive table-sm">
  <HeaderStyle CssClass="default" />
  <PagerStyle CssClass="active GridPager" />
  <PagerSettings Mode="NumericFirstLast" /> 
  <SelectedRowStyle CssClass="table-info" />
  <EmptyDataTemplate>
    Nessun Record
  </EmptyDataTemplate>
  <Columns>
    <asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="27px">
      <ItemTemplate>
        <asp:LinkButton ID="lbtEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>'><i class="fa fa-pencil fa-2x text-warning" aria-hidden="true"></i></asp:LinkButton>
      </ItemTemplate>
      <EditItemTemplate>                        
        <div style="white-space: nowrap;">
          <asp:LinkButton ID="lbtUpdate" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update") %>'><i class="fa fa-check fa-2x text-success" aria-hidden="true"></i></asp:LinkButton>&nbsp;
          <asp:LinkButton ID="lbtCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'><i class="fa fa-times fa-2x text-danger" aria-hidden="true"></i></asp:LinkButton>
        </div>
      </EditItemTemplate>
      <ItemStyle HorizontalAlign="Center" Width="27px"></ItemStyle>
    </asp:TemplateField>
    <asp:BoundField DataField="FormatoDtmxMM" HeaderText="Formato MM" ReadOnly="True" SortExpression="FormatoDtmxMM" />
    <asp:TemplateField HeaderText="Formato" SortExpression="FormatoDtmx">
      <EditItemTemplate>
        <%--<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FormatoDtmx") %>'></asp:TextBox>--%>
        <asp:DropDownList runat="server" ID="dlFormatoDtmx" DataSourceID="odsFormDmtx" DataTextField="FormatoDtmx" DataValueField="FormatoDtmx" SelectedValue='<%# Bind("FormatoDtmx") %>' />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblFormatoDtmx" runat="server" Text='<%# Eval("FormatoDtmx") %>' />
      </ItemTemplate>
    </asp:TemplateField>
  </Columns>

</asp:GridView>
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByTipo" TypeName="GMW_data.DS_DataMatrixTableAdapters.TrascFormatoDmtxTableAdapter" UpdateMethod="updateQuery" OnUpdating="ods_Updating">
  <SelectParameters>
    <asp:ControlParameter ControlID="hfFormatoDtmx" DefaultValue="" Name="FormatoDtmx" PropertyName="Value" Type="String" />
  </SelectParameters>
  <UpdateParameters>
    <asp:Parameter Name="Original_FormatoDtmxMM" Type="String" />
    <asp:Parameter Name="Original_FormatoDtmx" Type="String" />
    <asp:Parameter Name="FormatoDtmx" Type="String" />
  </UpdateParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfFormatoDtmx" />
<asp:ObjectDataSource runat="server" ID="odsFormDmtx" SelectMethod="GetData" TypeName="GMW_data.DS_DataMatrixTableAdapters.AnagFormatiDtmxTableAdapter"></asp:ObjectDataSource>
