How do I (cast) ServiceParentList.AsEnumerable() this so can make this a DataSource for the Grid?
Please let me know if this correct or there is a better way to do this :)
protected void radGridRate_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
System.Diagnostics.Debug.WriteLine("e.DetailTableView: " + e.DetailTableView.Name);
switch (e.DetailTableView.Name)
{
case "ServiceParent":
{
radGridRate.MasterTableView.DetailTables[0].ShowHeader = true;
string ServiceName = dataItem.GetDataKeyValue("ServiceName").ToString();
DataTable dtServiceParent = (DataTable)Session["dtServicesParent"];
var ServiceParentList = from tinRecord in dtServiceParent.AsEnumerable()
orderby tinRecord.Field<string>("ServiceName")
where tinRecord.Field<string>("ServiceName") == ServiceName
select new
{
ServiceName = tinRecord.Field<string>("ServiceName"),
ParentName = tinRecord.Field<string>("ParentName")
};
e.DetailTableView.DataSource = (DataSet) ServiceParentList.AsEnumerable();
etc...
Thanks!
Dave Gilden MCSD / Ft. Worth Tx.