Hi all,
I have a RadGrid that displays "Files" and a details grid that displays "File Records". I've got this working by setting the GridTableView in the DetailTables to use a DataSource, like so:
The only issue that I have is that main "File" datasource (odsMemberUploads) returns an object that has a property with contains the the records. So ideally I would like the DataSource of the GridTableView to be the RecordsProperty. So I tried doing:
But that didn't work.
I tried to use the NeedDataSource and DetailTableDataBind but the DataItem of the ParentItem is empty.
Is there anyway to do what I would like?
Appreciate your words of wisdom.
Kind regards
Sidharth
I have a RadGrid that displays "Files" and a details grid that displays "File Records". I've got this working by setting the GridTableView in the DetailTables to use a DataSource, like so:
<
div
class
=
"row"
>
Uploaded between
<
telerik:RadDatePicker
ID
=
"rdpFrom"
runat
=
"server"
DateInput-AutoPostBack
=
"true"
></
telerik:RadDatePicker
> and
<
telerik:RadDatePicker
ID
=
"rdpTo"
runat
=
"server"
DateInput-AutoPostBack
=
"true"
></
telerik:RadDatePicker
>
</
div
>
<
telerik:RadGrid
ID
=
"rgMemberUploads"
runat
=
"server"
DataSourceID
=
"odsMemberUploads"
AllowPaging
=
"true"
PageSize
=
"10"
>
<
MasterTableView
AutoGenerateColumns
=
"false"
DataSourceID
=
"odsMemberUploads"
DataKeyNames
=
"ID"
>
<
DetailTables
>
<
telerik:GridTableView
AutoGenerateColumns
=
"false"
NoMasterRecordsText
=
"No master record"
NoDetailRecordsText
=
"No invalid records"
DataSourceID
=
"odsMemberFileRecords"
DataKeyNames
=
"ID"
HierarchyLoadMode
=
"ServerOnDemand"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"FileID"
MasterKeyField
=
"ID"
/>
</
ParentTableRelation
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"RecordIndex"
ReadOnly
=
"true"
HeaderText
=
"Row"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ErrorMessage"
ReadOnly
=
"true"
HeaderText
=
"Error Message"
></
telerik:GridBoundColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
<
telerik:GridDateTimeColumn
DataField
=
"UploadedFile.UploadedDate"
ReadOnly
=
"true"
HeaderText
=
"Uploaded On"
></
telerik:GridDateTimeColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Uploaded By"
>
<
ItemTemplate
>
<%# Eval("UploadedFile.UploadedByNT")?? Eval("UploadedFile.UploadedByName") %>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"UploadedFile.Filename"
ReadOnly
=
"true"
HeaderText
=
"File"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"UploadedFile.Status"
ReadOnly
=
"true"
HeaderText
=
"Status"
></
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Error Details"
>
<
ItemTemplate
>
<
span
class
=
"errorMessage"
>
<%# Eval("UploadedFile.ErrorMessage") %>
</
span
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridDateTimeColumn
DataField
=
"UploadedFile.CompletedDate"
ReadOnly
=
"true"
HeaderText
=
"Completed On"
></
telerik:GridDateTimeColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:ObjectDataSource
ID
=
"odsMemberUploads"
runat
=
"server"
OldValuesParameterFormatString
=
"original_{0}"
SelectMethod
=
"Search"
TypeName
=
"File"
>
<
SelectParameters
>
<
asp:ControlParameter
ControlID
=
"rdpFrom"
Name
=
"uploadedFrom"
PropertyName
=
"SelectedDate"
Type
=
"DateTime"
/>
<
asp:ControlParameter
ControlID
=
"rdpTo"
Name
=
"uploadedTo"
PropertyName
=
"SelectedDate"
Type
=
"DateTime"
/>
</
SelectParameters
>
</
asp:ObjectDataSource
>
<
asp:ObjectDataSource
ID
=
"odsMemberFileRecords"
runat
=
"server"
OldValuesParameterFormatString
=
"original_{0}"
SelectMethod
=
"SearchRecords"
TypeName
=
"File"
>
<
SelectParameters
>
<
asp:Parameter
Name
=
"FileID"
DbType
=
"Guid"
/>
</
SelectParameters
>
</
asp:ObjectDataSource
>
The only issue that I have is that main "File" datasource (odsMemberUploads) returns an object that has a property with contains the the records. So ideally I would like the DataSource of the GridTableView to be the RecordsProperty. So I tried doing:
<
telerik:GridTableView
DataSource='<%#Eval("UploadedFile.Records")%>'>
I tried to use the NeedDataSource and DetailTableDataBind but the DataItem of the ParentItem is empty.
Is there anyway to do what I would like?
Appreciate your words of wisdom.
Kind regards
Sidharth