S
Satheesh
Hi all,
When the below code executed it is not binding the Dropdownlist in
insertitemtemplate. But the same is binding the Dropdownlist in
EditItemTemplate. Also, when i use LINQDataSource in insertitemtemplate is
also binding but only if i do like below it is not working...
<InsertItemTemplate>
<aspropDownList ID="DropDownList1" DataSource="<%# BindDept() %>"
DataTextField="DepartmentName" DataValueField="DeptID" runat="server">
</aspropDownList>
</InsertItemTemplate>
CodeBehind:
public IEnumerable BindDept()
{
EmployeeInfoDataContext dbEmp = new EmployeeInfoDataContext();
var LINQQuery = from dept in dbEmp.Departments
select dept;return LINQQuery as IEnumerable;
}
Am i missing something?
When the below code executed it is not binding the Dropdownlist in
insertitemtemplate. But the same is binding the Dropdownlist in
EditItemTemplate. Also, when i use LINQDataSource in insertitemtemplate is
also binding but only if i do like below it is not working...
<InsertItemTemplate>
<aspropDownList ID="DropDownList1" DataSource="<%# BindDept() %>"
DataTextField="DepartmentName" DataValueField="DeptID" runat="server">
</aspropDownList>
</InsertItemTemplate>
CodeBehind:
public IEnumerable BindDept()
{
EmployeeInfoDataContext dbEmp = new EmployeeInfoDataContext();
var LINQQuery = from dept in dbEmp.Departments
select dept;return LINQQuery as IEnumerable;
}
Am i missing something?