Friends,
I am using Entityframe work in my project now what I am trying to do is bind a grid with objectdatasource , I have to load data from three tables.
There are around 5-6 tables I am trying to read data from.
Below is the table structure but I have issue I am not able to get value of all tables column, is I am doing wrong or there is any other best way!
http://s10.postimage.org/l9eufbvt5/Capture.jpg
Thanks,
Shakti
I am using Entityframe work in my project now what I am trying to do is bind a grid with objectdatasource , I have to load data from three tables.
There are around 5-6 tables I am trying to read data from.
public
IEnumerable<BetsDifficultToRead> GetBetsDifficultToReadsWithDetail()
{
return
context.BetsDifficultToReads.Include(
"BetToBeSettled"
).Include(
"BetToBeSettled.BetDetails"
).Include(
"BetToBeSettled.BetDetails.Meeting"
).Include(
"BetToBeSettled.BetDetails.Event"
).ToList();
//var test = (from h in context.BetsDifficultToReads
// select new
// {
// BetsDifficultToReadId = h.BetsDifficultToReadId,
// BetToBeSettledId = h.BetToBeSettled.BetToBeSettledId,
// UserId = h.UserId,
// ShortName = h.BetToBeSettled.BetDetails.Select(t => t.Meeting.ShortName),
// Expr1 = h.BetToBeSettled.BetDetails.Select(t => t.Event.ShortName),
// IsStartingPrice = h.BetToBeSettled.BetDetails.Select(t => t.IsStartingPrice),
// Stake = h.BetToBeSettled.Stake,
// });
}
<telerik:RadGrid ID=
"radGridAllBets"
runat=
"server"
Skin=
"Metro"
DataSourceID=
"odsAllBets"
CellSpacing=
"0"
GridLines=
"None"
>
<MasterTableView DataSourceID=
"odsAllBets"
AutoGenerateColumns=
"False"
>
<CommandItemSettings ExportToPdfText=
"Export to PDF"
></CommandItemSettings>
<RowIndicatorColumn Visible=
"True"
FilterControlAltText=
"Filter RowIndicator column"
>
<HeaderStyle Width=
"20px"
></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn Visible=
"True"
FilterControlAltText=
"Filter ExpandColumn column"
>
<HeaderStyle Width=
"20px"
></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField=
"BetsDifficultToReadId"
DataType=
"System.Int32"
FilterControlAltText=
"Filter BetsDifficultToReadId column"
HeaderText=
"BetsDifficultToReadId"
SortExpression=
"BetsDifficultToReadId"
UniqueName=
"BetsDifficultToReadId"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"UserId"
DataType=
"System.Guid"
FilterControlAltText=
"Filter UserId column"
HeaderText=
"UserId"
SortExpression=
"UserId"
UniqueName=
"UserId"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"BetToBeSettled.BetDetails.Meeting.ShortName"
DataType=
"System.String"
FilterControlAltText=
"Filter EntityState column"
HeaderText=
"EntityState"
ReadOnly=
"True"
SortExpression=
"Meeting.ShortName"
UniqueName=
"Meeting.ShortName"
>
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText=
"Filter EditCommandColumn column"
>
</EditColumn>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableImageSprites=
"False"
>
</FilterMenu>
</telerik:RadGrid>
<asp:EntityDataSource ID=
"edsAllBets"
runat=
"server"
>
</asp:EntityDataSource>
<asp:ObjectDataSource ID=
"odsAllBets"
runat=
"server"
TypeName=
"EPOS.Web.Business.BetsDifficultToReadBL"
SelectMethod=
"GetBetsDifficultToReadsWithDetail"
OldValuesParameterFormatString=
"original_{0}"
></asp:ObjectDataSource>
Below is the table structure but I have issue I am not able to get value of all tables column, is I am doing wrong or there is any other best way!
http://s10.postimage.org/l9eufbvt5/Capture.jpg
Thanks,
Shakti