This is a migrated thread and some comments may be shown as answers.

[Solved] Fully-expanded RadGrid

4 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 03 Mar 2008, 09:00 PM
Hi all,

I have a Prometheus RadGrid with a master table / detail table.  So when the master table loads for the first time, it displays a list of rows with a "+" sign as the first column.  If I click any "+" sign, I see my detail grid correctly.  This all works good.

My question is, can I load the radgrid so that all the detail tables are displayed initially?  That is, no having to click the "+".  It would be like they were all clicked when the page loads.

I hope this makes sense.

Thanks,
Bob

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 04 Mar 2008, 08:45 AM
Hello Bob,

You can set HierarchyDefaultExpanded to true to achieve this for desired GridTableView.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 04 Mar 2008, 02:58 PM
Hi Vlad,

This almost works.  The page is expanded like I waned.  But my first detail table has System.Data.DataRowView in each column.  It looks like an event is firing too soon.  Here is my vb.net code:

Protected

Sub rgWorkflowTasks_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgWorkflowTasks.NeedDataSource

If Not e.IsFromDetailTable Then

rgWorkflowTasks.DataSource = WorkflowTask.GetWorkflowTasks()

End If

End Sub

Protected Sub rgWorkflowTasks_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles rgWorkflowTasks.DetailTableDataBind

Dim dataItem As Telerik.Web.UI.GridDataItem = CType(e.DetailTableView.ParentItem, Telerik.Web.UI.GridDataItem)

Dim WorkflowID As String = dataItem.GetDataKeyValue("WorkflowID").ToString()

rgWorkflowTasks.MasterTableView.DetailTables(0).DataSource = WorkFlowStepTask.GetWorkFlowStepTasks(

CInt(WorkflowID))

End Sub

What am I doing wrong?

Thanks,
bob

0
Vlad
Telerik team
answered on 04 Mar 2008, 03:03 PM
Hi Bob,

You should use e.DetailTableView.DataSource in DetailTableDataBind. Please check this example:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/DetailTableDataBind/DefaultVB.aspx

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 04 Mar 2008, 03:09 PM
That worked!

Thanks Vlad.
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Bob
Top achievements
Rank 1
Share this question
or