protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
this.BindGrid();
}
private void BindGrid()
Entities entities = new Entities();
GridView1.DataSource = from customer in entities.DutyPoints.ToList() select customer;
GridView1.DataBind();
<asp:TemplateField HeaderText="Name" ItemStyle-Width="150"> <ItemTemplate> <asp:Label ID="lblName" runat="server" Text='<%# Eval("Description") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtName" runat="server" Text='<%# Eval("Description") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="lblEmp" runat="server" Text='<%# Eval("Employee") %>'></asp:Label> </ItemTemplate> <asp:dropdownlist id="Employee"></asp:dropdownlist> </asp:TemplateField>
dutyPoint Employee xxx Emplist Emplist Emplist