<asp:GridView ID="grdAttendance1" runat="server" AutoGenerateColumns="False" CellPadding="4"
ForeColor="#333333" GridLines="None" Width="100%" HorizontalAlign="Center">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="InstID" HeaderText="College ID" />
<asp:BoundField DataField="Fid" HeaderText="Employee ID" />
<asp:BoundField DataField="FName" HeaderText="Employee Name" />
<asp:BoundField DataField="Designation" HeaderText="Designation" />
<asp:BoundField DataField="Department" HeaderText="Department" />
<asp:BoundField DataField="Date" HeaderText="Date" />
<asp:TemplateField HeaderText="In Time">
<ItemTemplate>
<asp:TextBox ID="txtIntime1" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Out Time">
<ItemTemplate>
<asp:TextBox ID="txtOuttime1" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Leave Type">
<ItemTemplate>
<asp:TextBox ID="txtLeaveType1" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<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>
我接受了这个但它没有绑定数据库文本框显示空白。
答案 0 :(得分:1)
首先,我建议浏览Microsoft's ASP.NET data access tutorials
我会为您提供一般指南,让您走上正确的轨道
<asp:CommandField ButtonType=”Link” ShowEditButton=”true”
ShowDeleteButton=”true” ShowCancelButton=”true” />
readonly="true"
EditItemTemplates
。这是第一次做起来有点棘手,但是一旦你把它弄下来就很容易了。