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

Displays tree structure symbol eventhough no detail table exists

3 Answers 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Medac
Top achievements
Rank 1
Medac asked on 06 May 2010, 10:29 AM
Hi,

I am using telerik:RadGrid with one master table and 2 detail table in it. On load of the grid if no detail table exists for the row then also it is displaying > symbol. If we click on that then the symbol will go off becuase no details table exists for that row. This was not the problem in the earlier versions of telerik. But now I have upgraded the telerik version to Version=2010.1.413.40. In this version I am getting problem like this.

Is it version problem or can i fix it in my code?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 May 2010, 11:36 AM
Hello Medac,

You can refer the following documentation for hiding expand/collapse images when there is no record.
Hiding expand/collapse images when no records

Regards,
Shinu.




0
Medac
Top achievements
Rank 1
answered on 07 May 2010, 05:42 AM
Shinu,

Could not get it....It is not working. See I have done what is been mentioned in the link. After adding the mentioned code I am not able to remove that hierarchy symbol if no records exists in detail table.

'''

 

 

<summary>

 

 

 

 

''' RadGrdCaseChronology before renders

 

 

 

 

''' </summary>

 

 

 

 

''' <param name="sender"></param>

 

 

 

 

''' <param name="e"></param>

 

 

 

 

''' <remarks></remarks>

 

 

 

 

Protected Sub RadGrdCaseChronology_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrdCaseChronology.PreRender

 

 

 

 

Try

 

 

HideExpandColumnRecursive(RadGrdCaseChronology.MasterTableView)

 

 

Catch ex As Exception

 

 

MessageBox(ex.Message)

 

 

End Try

 

 

 

 

End Sub

 

 

 

 

''' <summary>

 

 

 

 

''' Hides and Expands the Rows

 

 

 

 

''' </summary>

 

 

 

 

''' <param name="tableView"></param>

 

 

 

 

''' <remarks></remarks>

 

 

 

 

Public Sub HideExpandColumnRecursive(ByVal tableView As GridTableView)

 

 

 

 

Dim nestedViewItems As GridItem() = tableView.GetItems(GridItemType.NestedView)

 

 

 

 

Dim sDescription As String = String.Empty

 

 

 

 

Dim sSubDescription As String = String.Empty

 

 

 

 

'Loop through the CaseChronology rows and based on the Description length provide the tooltip

 

 

 

 

For Each Item As GridDataItem In RadGrdCaseChronology.MasterTableView.Items

 

sDescription = Item(

 

 

PresentationConstants.DESCRIPTION).Text

 

 

 

 

If sDescription.Length <> 0 Then

 

 

 

 

If sDescription.Length > 100 Then

 

 

sSubDescription = sDescription.Substring(0, 100)

Item(

 

PresentationConstants.DESCRIPTION).Text = sSubDescription & "..."

 

 

Item(

 

PresentationConstants.DESCRIPTION).ToolTip = sDescription

 

 

 

 

End If

 

 

 

 

End If

 

 

 

 

Next

 

 

 

 

For Each nestedViewItem As GridNestedViewItem In nestedViewItems

 

 

 

 

For Each nestedView As GridTableView In nestedViewItem.NestedTableViews

 

 

 

 

If nestedView.Items.Count = 0 Then

 

 

 

 

Dim cell As TableCell = nestedView.ParentItem(PresentationConstants.EXPANDCOLUMN)

 

cell.Controls(0).Visible =

 

 

False

 

 

nestedViewItem.Visible =

 

False

 

 

 

 

End If

 

 

If

 

 

nestedView.HasDetailTables Then

 

 

 

 

 

    HideExpandColumnRecursive(nestedView)

 

 

End If

 

 

 

 

 

 

 

Next

 

 

 

 

Next

 

 

 

 

End Sub

 

 


In aspx page.... I have added for masterTable

HierarchyLoadMode

 

 

="ServerBind"

 

 



Can u please help me????????
0
Yavor
Telerik team
answered on 12 May 2010, 11:05 AM
Hello Medac,

Can you please confirm that the conditional check is properly evaluated, and thet the visibility is toggled off as expected - this can be done by putting a breakpoint, and verifying that the code is reached as expected.

Greetings,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Medac
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Medac
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or