Have a page that displays some notes from our database and as it will display properly for a certain type of notes. However it doesn't display for our Board Report notes where the databinding is done a bit differently. Wondering if you could spot our problem and help us with solving this mystery. It will load the Master level records but list "No child records to display".
The DetailView.jpg will show how the Board Report notes are to be displayed but NoRecordChildView.jpg is what it comes out to be. How do we bind the detail grid?
The DetailView.jpg will show how the Board Report notes are to be displayed but NoRecordChildView.jpg is what it comes out to be. How do we bind the detail grid?
<
telerik:radgrid
id
=
"_grdNotes"
runat
=
"server"
cellspacing
=
"-1"
datasourceid
=
"SqlDataSource1"
showheader
=
"False"
gridlines
=
"None"
style
=
"margin-bottom: 0px;"
>
<
MasterTableView
DataSourceID
=
"SqlDataSource1"
HierarchyLoadMode
=
"Client"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"SubNoteID"
Name
=
"Parent"
GridLines
=
"None"
>
<
DetailTables
>
<
telerik:GridTableView
HierarchyLoadMode
=
"Client"
DataKeyNames
=
"SubNoteID"
DataSourceID
=
"_srcSubNotes"
Width
=
"100%"
runat
=
"server"
EnableHeaderContextMenu
=
"false"
Name
=
"Child"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"SubNoteID"
MasterKeyField
=
"SubNoteID"
>
</
telerik:GridRelationFields
>
</
ParentTableRelation
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"Comments"
FilterControlAltText
=
"Filter Comments column"
HeaderText
=
"Comments"
SortExpression
=
"Comments"
UniqueName
=
"Comments"
>
<
ItemTemplate
>
<
b
>(<
asp:Label
ID
=
"CreatedOnLabel"
runat
=
"server"
Text='<%# Eval("FormatedCreatedOn") %>' ></
asp:Label
> - <
asp:Label
ID
=
"FullNameLabel"
runat
=
"server"
Text='<%# Eval("FullName") %>'></
asp:Label
>) </
b
>
<
asp:Label
ID
=
"CommentsLabel"
runat
=
"server"
Text='<%# Eval("Comments") %>'></
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"UploadedFiles"
FilterControlAltText
=
"Filter UploadedFiles column"
>
<
ItemTemplate
>
<
asp:HiddenField
ID
=
"_hdnNoteID"
runat
=
"server"
Value='<%# DataBinder.Eval(Container.DataItem, "NoteID")%>' />
<
ul
>
<
asp:Repeater
ID
=
"_rptNoteFiles"
runat
=
"server"
>
<
ItemTemplate
>
<
li
><
asp:HyperLink
runat
=
"server"
ID
=
"_hlNoteFile"
NavigateUrl='<%# "~/NoteFiles/" & DataBinder.Eval(Container.DataItem, "FileLoc")%>' Text='<%# DataBinder.Eval(Container.DataItem,"FileDesc") %>'></
asp:HyperLink
></
li
>
</
ItemTemplate
>
</
asp:Repeater
>
</
ul
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"CorrectFollowUpDate"
FilterControlAltText
=
"Filter CorrectFollowUpDate column"
HeaderText
=
"CorrectFollowUpDate"
SortExpression
=
"CorrectFollowUpDate"
UniqueName
=
"CorrectFollowUpDate"
>
<
ItemTemplate
>
<
b
>Follow-up Date: </
b
>
<
asp:Label
ID
=
"CorrectFollowUpDateLabel"
runat
=
"server"
Text='<%# Eval("CorrectFollowUpDate") %>'></
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
FilterControlAltText
=
"Filter Status column"
HeaderText
=
"Status"
SortExpression
=
"Status"
UniqueName
=
"Status"
>
<
ItemTemplate
>
<
asp:HiddenField
ID
=
"_hdnCompleted"
Value='<%# Eval("Completed") %>' runat="server" />
<
asp:HiddenField
ID
=
"_hdnIncomplete"
Value='<%# Eval("Incomplete") %>' runat="server" />
<
b
>Status: <
asp:Label
ID
=
"StatusLabel"
runat
=
"server"
></
asp:Label
></
b
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
FilterControlAltText
=
"Filter Add column"
UniqueName
=
"AddComplete"
HeaderText
=
""
SortExpression
=
"AddComplete"
>
<
ItemTemplate
>
<
asp:HiddenField
ID
=
"_hdnNoteIDAdd"
runat
=
"server"
Value='<%# DataBinder.Eval(Container.DataItem, "NoteID")%>' />
<
a
onclick='<%# "AddCompleteNote(" & Eval("NoteID") & ");"%>' href="javascript:void(0);">Add/Complete Note</
a
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:radgrid
>
</
div
>
</
div
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString='<%$ ConnectionStrings:FMS_Conn %>' SelectCommand="sp_getFMSNotes" SelectCommandType="StoredProcedure">
<
SelectParameters
>
<
asp:SessionParameter
SessionField
=
"charter_num"
Name
=
"charter_num"
Type
=
"Int32"
></
asp:SessionParameter
>
<
asp:QueryStringParameter
QueryStringField
=
"Section"
Name
=
"Section"
Type
=
"String"
></
asp:QueryStringParameter
>
</
SelectParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"_srcNoteFiles"
runat
=
"server"
ConnectionString='<%$ ConnectionStrings:FMS_Conn %>' SelectCommand="sp_getFMSNoteFiles" SelectCommandType="StoredProcedure">
<
SelectParameters
>
<
asp:Parameter
Name
=
"NoteID"
Type
=
"Int32"
></
asp:Parameter
>
</
SelectParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"_srcSubNotes"
runat
=
"server"
ConnectionString='<%$ ConnectionStrings:FMS_Conn %>' SelectCommand="sp_getFMSSubNotes" SelectCommandType="StoredProcedure">
<
SelectParameters
>
<
asp:ControlParameter
ControlID
=
"_grdNotes"
Name
=
"SubNoteID"
PropertyName
=
"DataMember"
Type
=
"Int32"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
Private
Sub
Page_PreRender(sender
As
Object
, e
As
EventArgs)
Handles
Me
.PreRender
_dateFollowUpAdd.MinDate = DateTime.Today.
Date
.AddDays(1)
If
Request(
"Section"
) =
"FMS-Board"
And
clscommon.RecursiveFindControl(Page,
"_hdnBoardRptID"
) IsNot
Nothing
Then
oConn.Open()
Dim
ocmd
As
New
SqlCommand(
"sp_seBoardRptFMSNotes"
, oConn)
ocmd.CommandType = CommandType.StoredProcedure
With
ocmd.Parameters
Dim
hdnBoardRptID
As
HiddenField =
CType
((clscommon.RecursiveFindControl(Page,
"_hdnBoardRptID"
)), HiddenField)
.Add(
New
SqlParameter(
"@BoardRptID"
, hdnBoardRptID.Value))
End
With
_grdNotes.DataSourceID =
Nothing
_grdNotes.DataSource = ocmd.ExecuteReader
_grdNotes.DataBind()
'_srcSubNotes.DataBind()
'_grdNotes.MasterTableView.DetailTables(0).DataSourceID = "_srcSubNotes"
'_grdNotes.MasterTableView.DetailTables(0).Rebind()
oConn.Close()
End
If
End
Sub