<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:db_compilerConnectionString %>" SelectCommand="SELECT [Column_Name], [Data_Type], [null_], [Date] FROM [tbl_field]"> </asp:SqlDataSource> <asp:GridView ID="GridView1" runat="server" ShowHeaderWhenEmpty="True" AutoGenerateColumns="False" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" DataSourceID="SqlDataSource1" ShowFooter="True" Style="margin-left: 133px; margin-top: 49px; margin-right: 0px;" Height="16px" Width="782px"> <Columns> <asp:TemplateField HeaderText="Column_Name" SortExpression="Column_Name"> <EditItemTemplate> <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Column_Name") %>'></asp:TextBox> <asp:RequiredFieldValidator Text="*" ID="colname" ControlToValidate="txtName" runat="server" ErrorMessage="Column Name is Required" ForeColor="Red"> </asp:RequiredFieldValidator> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("Column_Name") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="txtColName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ValidationGroup="INSERT" Text="*" ID="insertcolname" ControlToValidate="txtColName" runat="server" ErrorMessage="Column Name is Required" ForeColor="Red"> </asp:RequiredFieldValidator> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Data_Type" SortExpression="Data_Type"> <EditItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("Data_Type") %>'> <asp:ListItem>Select Datatype</asp:ListItem> <asp:ListItem>int</asp:ListItem> <asp:ListItem>Float</asp:ListItem> <asp:ListItem>Varchar(50)</asp:ListItem> <asp:ListItem>Varchar(100)</asp:ListItem> <asp:ListItem>double</asp:ListItem> </asp:DropDownList> <asp:RequiredFieldValidator ID="datatype" ControlToValidate="DropDownList1" runat="server" ErrorMessage="Data Type is Required" ForeColor="Red" InitialValue="Select Datatype"> </asp:RequiredFieldValidator> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("Data_Type") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:DropDownList ID="DropDownList2" runat="server"> <asp:ListItem>Select Datatype</asp:ListItem> <asp:ListItem>int</asp:ListItem> <asp:ListItem>Float</asp:ListItem> <asp:ListItem>Varchar(50)</asp:ListItem> <asp:ListItem>Varchar(100)</asp:ListItem> <asp:ListItem>double</asp:ListItem> </asp:DropDownList> <asp:RequiredFieldValidator ValidationGroup="INSERT" Text="*" ID="datatype" ControlToValidate="DropDownList2" runat="server" ErrorMessage="Data Type is Required" ForeColor="Red" InitialValue="Select Datatype"> </asp:RequiredFieldValidator> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="null_" SortExpression="null_"> <EditItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("null_") %>' /> </EditItemTemplate> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("null_") %>' Enabled="false" /> </ItemTemplate> <FooterTemplate> <asp:CheckBox ID="null" runat="server" /> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Date" SortExpression="Date"> <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Date") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("Date") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:LinkButton ValidationGroup="INSERT" ID="lblInsert" runat="server">Insert</asp:LinkButton> </FooterTemplate> </asp:TemplateField> <asp:CommandField AccessibleHeaderText="Delete" ShowDeleteButton="True" /> <asp:CommandField AccessibleHeaderText="Edit" ShowEditButton="True" /> </Columns> <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" /> <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" /> <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" /> <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" /> <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" /> <SortedAscendingCellStyle BackColor="#FFF1D4" /> <SortedAscendingHeaderStyle BackColor="#B95C30" /> <SortedDescendingCellStyle BackColor="#F1E5CE" /> <SortedDescendingHeaderStyle BackColor="#93451F" /> </asp:GridView> <asp:ValidationSummary ValidationGroup="INSERT" ID="ValidationSummary1" ForeColor="Red" runat="server" Height="44px" /> <asp:ValidationSummary ID="ValidationSummary2" ForeColor="Red" runat="server" />
<asp:GridView ID="GridView1" ShowHeaderWhenEmpty="true" DataSourceID="SqlDataSource1" runat="server"> </asp:GridView>
<asp:gridview.......... ShowHeaderWhenEmpty="true"........ </asp:gridview>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)