I cannot get the detail view of a nested table to view the correct relational data. I think it's because of the way I am binding the data, but I am not sure what I am doing wrong. I followed the examples online.
Thanks so much for any help.
Here is my code:
Thanks so much for any help.
Here is my code:
<%@ Page Language="C#" Title="Book Of Formulas" MasterPageFile="~/BoF.master" AutoEventWireup="true"%>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
asp:Content
ContentPlaceHolderID
=
"PageContent"
runat
=
"server"
>
<
h2
>Nestlé Book Of Formulas</
h2
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"RadGrid1"
DataSourceID
=
"LinqDataSource1"
AllowAutomaticUpdates
=
"false"
AllowAutomaticInserts
=
"false"
AllowAutomaticDeletes
=
"True"
AllowFilteringByColumn
=
"True"
AutoGenerateColumns
=
"False"
EnableLinqExpressions
=
"false"
AllowSorting
=
"true"
AllowPaging
=
"True"
CellSpacing
=
"0"
GridLines
=
"None"
>
<
ClientSettings
EnablePostBackOnRowClick
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
CurrentResetPageIndexAction
=
"SetPageIndexToFirst"
AutoGenerateColumns
=
"False"
DataSourceID
=
"LinqDataSource1"
DataKeyNames
=
"routes_pk"
RetrieveDataTypeFromFirstItem
=
"true"
AllowPaging
=
"true"
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
></
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
></
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"RouteNumber"
HeaderText
=
"Route Number"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter RouteNumber column"
SortExpression
=
"RouteNumber"
UniqueName
=
"RouteNumber"
AutoPostBackOnFilter
=
"true"
ShowFilterIcon
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"Region"
FilterControlAltText
=
"Filter Region column"
HeaderText
=
"Region"
SortExpression
=
"Region"
UniqueName
=
"Region"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Area"
FilterControlAltText
=
"Filter Area column"
HeaderText
=
"Area"
SortExpression
=
"Area"
UniqueName
=
"Area"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"District"
FilterControlAltText
=
"Filter District column"
HeaderText
=
"District"
SortExpression
=
"District"
UniqueName
=
"District"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
DetailTables
>
<
telerik:GridTableView
DataSourceID
=
"LinqDataSource2"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"routes_pk_fk"
AllowPaging
=
"false"
Width
=
"100%"
InsertItemPageIndexAction
=
"ShowItemOnCurrentPage"
EditMode
=
"PopUp"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"routes_pk_fk"
MasterKeyField
=
"routes_pk"
/>
</
ParentTableRelation
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
></
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
></
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
/>
<
telerik:GridBoundColumn
DataField
=
"StartDate"
HeaderText
=
"Start Date"
/>
<
telerik:GridBoundColumn
DataField
=
"WeeklyBase"
HeaderText
=
"Weekly Base"
/>
<
telerik:GridBoundColumn
DataField
=
"CommissionRate"
HeaderText
=
"CommissionRate"
/>
<
telerik:GridBoundColumn
DataField
=
"VROT"
HeaderText
=
"VROT"
/>
<
telerik:GridBoundColumn
DataField
=
"RoutePremium"
HeaderText
=
"Route Premium"
/>
<
telerik:GridBoundColumn
DataField
=
"ThreeByTwo"
HeaderText
=
"3x2"
/>
<
telerik:GridBoundColumn
DataField
=
"Depot"
Visible
=
"false"
HeaderText
=
"Depot"
/>
<
telerik:GridBoundColumn
DataField
=
"Market"
Visible
=
"false"
HeaderText
=
"Market"
/>
<
telerik:GridBoundColumn
DataField
=
"Comments"
Visible
=
"false"
HeaderText
=
"Comments"
/>
<
telerik:GridBoundColumn
DataField
=
"RouteType"
Visible
=
"false"
HeaderText
=
"Route Type"
/>
<
telerik:GridBoundColumn
DataField
=
"Incentive"
Visible
=
"false"
HeaderText
=
"Incentive"
/>
<
telerik:GridBoundColumn
DataField
=
"Format"
Visible
=
"false"
HeaderText
=
"Format"
/>
<
telerik:GridBoundColumn
DataField
=
"Band"
Visible
=
"false"
HeaderText
=
"Band"
/>
<
telerik:GridBoundColumn
DataField
=
"MarketTarget"
Visible
=
"false"
HeaderText
=
"Market Target"
/>
<
telerik:GridBoundColumn
DataField
=
"Region"
Visible
=
"false"
HeaderText
=
"Region"
/>
<
telerik:GridBoundColumn
DataField
=
"Area"
Visible
=
"false"
HeaderText
=
"Area"
/>
<
telerik:GridBoundColumn
DataField
=
"District"
Visible
=
"false"
HeaderText
=
"District"
/>
<
telerik:GridBoundColumn
DataField
=
"RouteTarget"
Visible
=
"false"
HeaderText
=
"Route Target"
/>
<
telerik:GridBoundColumn
DataField
=
"PercentFromMarketTarget"
Visible
=
"false"
HeaderText
=
"PercentFromMarketTarget"
/>
<
telerik:GridBoundColumn
DataField
=
"StartDate"
Visible
=
"false"
HeaderText
=
"Start Date"
/>
<
telerik:GridBoundColumn
DataField
=
"EndDate"
Visible
=
"false"
HeaderText
=
"End Date"
/>
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this route?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
/>
</
Columns
>
<
EditFormSettings
ColumnNumber
=
"3"
CaptionFormatString
=
"Edit information for route with ID {0}"
CaptionDataField
=
"RouteNumber"
>
<
FormTableItemStyle
Wrap
=
"False"
></
FormTableItemStyle
>
<
FormCaptionStyle
CssClass
=
"EditFormHeader"
></
FormCaptionStyle
>
<
FormMainTableStyle
GridLines
=
"None"
CellSpacing
=
"0"
CellPadding
=
"3"
Width
=
"100%"
/>
<
FormTableStyle
GridLines
=
"Horizontal"
CellSpacing
=
"0"
CellPadding
=
"2"
CssClass
=
"module"
Height
=
"110px"
Width
=
"100%"
/>
<
FormTableAlternatingItemStyle
Wrap
=
"False"
></
FormTableAlternatingItemStyle
>
<
FormStyle
Width
=
"100%"
BackColor
=
"#eef2ea"
></
FormStyle
>
<
EditColumn
UpdateText
=
"Update record"
UniqueName
=
"EditCommandColumn1"
CancelText
=
"Cancel edit"
>
</
EditColumn
>
<
FormTableButtonRowStyle
HorizontalAlign
=
"Left"
CssClass
=
"EditFormButtonRow"
></
FormTableButtonRowStyle
>
</
EditFormSettings
>
<
PagerStyle
AlwaysVisible
=
"True"
></
PagerStyle
>
</
telerik:GridTableView
>
</
DetailTables
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
<
PopUpSettings
Modal
=
"true"
/>
</
EditFormSettings
>
<
PagerStyle
AlwaysVisible
=
"True"
></
PagerStyle
>
</
MasterTableView
>
<
PagerStyle
AlwaysVisible
=
"true"
/>
<
FilterMenu
EnableImageSprites
=
"False"
>
<
WebServiceSettings
>
<
ODataSettings
InitialContainerName
=
""
></
ODataSettings
>
</
WebServiceSettings
>
</
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
<
WebServiceSettings
>
<
ODataSettings
InitialContainerName
=
""
></
ODataSettings
>
</
WebServiceSettings
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
<
asp:LinqDataSource
ID
=
"LinqDataSource1"
runat
=
"server"
ContextTypeName
=
"BoFLinqDataContext"
EnableDelete
=
"True"
EnableInsert
=
"True"
EnableUpdate
=
"True"
TableName
=
"view_routes_radrs"
>
</
asp:LinqDataSource
>
<
asp:LinqDataSource
ID
=
"LinqDataSource2"
runat
=
"server"
ContextTypeName
=
"BoFLinqDataContext"
EnableDelete
=
"True"
EnableInsert
=
"True"
EnableUpdate
=
"True"
TableName
=
"tbl_route_informations"
Where
=
"routes_pk_fk == @routes_pk"
>
<
WhereParameters
>
<
asp:Parameter
Name
=
"routes_pk"
Type
=
"Int32"
DefaultValue
=
"2021"
/>
</
WhereParameters
>
</
asp:LinqDataSource
>
</
asp:Content
>