RedXavier2k4
asked on
How can I bound this gridview with this List<> code?
How can I bound this gridview with this List<> code? I want to use the '<asp:ObjectDataSource ID' to bind the data with little to no code behind. Thanks
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Psc.EmployeeAdmin.wrkStation
{
public class EmployeeWorkStation
{
private Admin.iAdmin _ws;
public List<Admin.vwEmployee> GetEmployees(out string strReturnMessage, int tSiteID, bool blInActive)
{
List<Admin.vwEmployee> EmployeeAdminList = new List<Admin.vwEmployee>();
try
{
EmployeeAdminList = this._ws.GetEmployees(out strReturnMessage, tSiteID, blInActive);
}
catch (Exception ex)
{
strReturnMessage = ex.Message.ToString();
}
return EmployeeAdminList;
}
}
}
<asp:GridView ID="grdEmpAdmin" runat="server">
<Columns>
<asp:BoundField DataField = "FirstName" HeaderText = "First Name" />
<asp:BoundField DataField = "MiddleName" HeaderText = "Middle Name" />
<asp:BoundField DataField = "LastName" HeaderText = "Last Name" />
<asp:BoundField DataField = "HireDate" HeaderText = "Hire Date" />
<asp:BoundField DataField = "BirthDate" HeaderText = "Birth Date" />
<asp:BoundField DataField = "TerminationDate" HeaderText = "Termination Date" />
</Columns>
</asp:GridView>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER