Hi there, I need your help
I have a problem with publishing data from the database table in the GridView using C# ASP.Net.
I don't understand why column number 7 is not displayed in the GridView.
I don't know how to solve it
My code below
<asp:GridView ID="gvProducts"
runat="server"
DataKeyNames="ID"
EmptyDataText="No Data"
EnableViewState="true"
CssClass="mGrid"
Width="100%"
HorizontalAlign="Center"
AutoGenerateColumns="false"
AllowPaging="True"
PageSize="15"
OnPageIndexChanging="OnPageIndexChanging"
OnRowDataBound="gvProducts_RowDataBound">
<AlternatingRowStyle CssClass="altrows" />
<Columns>
<%-- Column 1 --%>
<asp:TemplateField
HeaderText="N."
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<%#String.Format("{0:N0}",Container.DataItemIndex + 1)%>
</ItemTemplate>
</asp:TemplateField>
<%-- Column 2 --%>
<asp:BoundField DataField="User"
HeaderText="User"
ReadOnly="true" HtmlEncode="false"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center" />
<%-- Column 3 --%>
<asp:BoundField DataField="User_code"
HeaderText="User_code"
ReadOnly="true" HtmlEncode="false"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center" />
<%-- Column 4 --%>
<asp:TemplateField
HeaderText="Check_User"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<br />
<asp:DropDownList ID="ddlCheck_User" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
</ItemTemplate>
</asp:TemplateField>
<%-- Column 5 --%>
<asp:TemplateField
HeaderText="Date_User_hr"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<asp:TextBox ID="txtDate_Start_User_hr" runat="server"
CssClass="ddl_Class_new"
Width="55"
Text='<%# Convert.ToDateTime(Eval("Date_Start_User_hr")).ToString("dd/MM/yyyy") %>'
Enabled="false"></asp:TextBox>
<asp:TextBox ID="txtDate_End_User_hr" runat="server"
CssClass="ddl_Class_new"
Width="55"
Text='<%# Convert.ToDateTime(Eval("Date_End_User_hr")).ToString("dd/MM/yyyy") %>'
Enabled="false"></asp:TextBox>
</div>
<br />
<div>
<asp:DropDownList ID="ddlDate_User_hr" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
<br />
</ItemTemplate>
</asp:TemplateField>
<%-- Column 6 --%>
<asp:TemplateField
HeaderText="Start_IGM_End_IGM"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<asp:TextBox ID="txtStart_IGM" runat="server"
CssClass="ddl_Class_new"
Width="100"
Text='<%# !String.IsNullOrEmpty(Eval("Start_IGM").ToString()) ?
Convert.ToDateTime(Eval("Start_IGM")).ToString("dd/MM/yyyy HH:mm:ss") : "" %>'
Enabled="false"></asp:TextBox>
<asp:TextBox ID="txtEnd_IGM" runat="server"
CssClass="ddl_Class_new"
Width="100"
Text='<%# !String.IsNullOrEmpty(Eval("End_IGM").ToString()) ?
Convert.ToDateTime(Eval("End_IGM")).ToString("dd/MM/yyyy HH:mm:ss") : "" %>'
Enabled="false"></asp:TextBox>
</div>
<br />
<div>
<asp:DropDownList ID="ddlStart_IGM_End_IGM" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
<br />
</ItemTemplate>
</asp:TemplateField>
<%-- Column 7 --%>
<asp:TemplateField
HeaderText="Origin"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<asp:TextBox ID="txtOrigin" runat="server"
CssClass="ddl_Class_new"
Style="text-align: center"
Width="20"
Text='<%# Eval("Origin").ToString().ToUpper() %>'
Enabled="false"></asp:TextBox>
</div>
<br />
<div>
<asp:DropDownList ID="ddlOrigin" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
<br />
</ItemTemplate>
</asp:TemplateField>
<%-- Column 8 --%>
<asp:TemplateField
HeaderText="Cause"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<asp:TextBox ID="txtCause" runat="server"
CssClass="ddl_Class_new"
Style="text-align: center"
Width="20"
Text='<%# Eval("Cause").ToString().ToUpper() %>'
Enabled="false"></asp:TextBox>
</div>
<br />
<div>
<asp:DropDownList ID="ddlCause" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
<br />
</ItemTemplate>
</asp:TemplateField>
<%-- Column 9 --%>
<asp:TemplateField
HeaderText="Forewarning"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<asp:TextBox ID="txtForewarning" runat="server"
CssClass="ddl_Class_new"
Width="20"
Style="text-align: center"
Text='<%# Eval("Forewarning").ToString().ToUpper() %>'
Enabled="false"></asp:TextBox>
</div>
<br />
<div>
<asp:DropDownList ID="ddlForewarning" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
<br />
</ItemTemplate>
</asp:TemplateField>
<%-- Column 10 --%>
<asp:TemplateField
HeaderText="SDI"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<br />
<asp:DropDownList ID="ddlSDI" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
</ItemTemplate>
</asp:TemplateField>
<%-- Column 11 --%>
<asp:TemplateField
HeaderText="SRD"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<br />
<asp:DropDownList ID="ddlSRD" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
</ItemTemplate>
</asp:TemplateField>
<%-- Column 12 --%>
<asp:TemplateField
HeaderText="RMM"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<br />
<asp:DropDownList ID="ddlRMM" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
</ItemTemplate>
</asp:TemplateField>
<%-- Column 13 --%>
<asp:TemplateField
HeaderText="Schematic"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<br />
<asp:DropDownList ID="ddlSchematic" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="OnSelectedIndexChanged"
BackColor="Yellow"
CssClass="ddl_Class_new">
<asp:ListItem Text="[ === === === ]" Value=""></asp:ListItem>
<asp:ListItem Text="OK" Value="OK"></asp:ListItem>
<asp:ListItem Text="KO" Value="KO"></asp:ListItem>
</asp:DropDownList>
</div>
</ItemTemplate>
</asp:TemplateField>
<%-- Column 14 --%>
<asp:TemplateField
HeaderText="Note"
ItemStyle-CssClass="ddl_Class_new"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div>
<br />
<asp:TextBox ID="txtnote" runat="server"
CssClass="ddl_Class_new"
TextMode="MultiLine"
Width="100"
Enabled="true"></asp:TextBox>
<asp:ImageButton ID="btnnote"
ImageUrl="/img/save.gif"
runat="server"
OnClick="btnnote_Click"
CssClass="ddl_Class_new"
Visible="true" />
</div>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkBxHeader"
onclick="javascript:HeaderClick(this);" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<div>
<br />
<asp:CheckBox ID="chkRow" runat="server" />
<asp:ImageButton ID="btnchkRow"
ImageUrl="/img/checkbox_closed.gif"
runat="server"
CssClass="ddl_Class_new"
Visible="false" />
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>