Good day.. busy day on the forums for me. sadly.
Mastertable view has two DetailTables within it. They are nested as :
<MasterTableView>
<DetailTable>
</DetailTable>
<DetailTable>
</DetailTable>
</MasterTableView>
I need to evaluate whether or not there are records within the detailtable and if the detailtable is emplty, then hide the header. Problem is that I can't see where or how to count the records when the mastertable is expanded. I have tried to run RemoveHeaders() within the radgrid pre_render, DetailTableDataBound, ItemDatabound and ItemDataBinding.. but none are working as expected. thank you for any assistance you can provide.
mac
code is as follows
Mastertable view has two DetailTables within it. They are nested as :
<MasterTableView>
<DetailTable>
</DetailTable>
<DetailTable>
</DetailTable>
</MasterTableView>
I need to evaluate whether or not there are records within the detailtable and if the detailtable is emplty, then hide the header. Problem is that I can't see where or how to count the records when the mastertable is expanded. I have tried to run RemoveHeaders() within the radgrid pre_render, DetailTableDataBound, ItemDatabound and ItemDataBinding.. but none are working as expected. thank you for any assistance you can provide.
mac
code is as follows
Protected Sub RadGrid1_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind |
removeheaders() |
End Sub |
Sub removeheaders() |
' RadGrid1.Controls.Add(New LiteralControl(RadGrid1.MasterTableView.DetailTables.Count)) //This should return mastertable recordcount |
' RadGrid1.Controls.Add(New LiteralControl(RadGrid1.MasterTableView.DetailTables(0).Items.Count))//This should return Detail 1 recordcount |
' RadGrid1.Controls.Add(New LiteralControl(RadGrid1.MasterTableView.DetailTables(1).Items.Count))//This should return Detail 2 recordcount |
For i As Integer = 0 To RadGrid1.MasterTableView.DetailTables.Count - 1 ' Count the Detail table within MasterTable |
If RadGrid1.MasterTableView.DetailTables(i).Items.Count <= 0 Then |
RadGrid1.MasterTableView.DetailTables(i).ShowHeader = False |
Else |
RadGrid1.MasterTableView.DetailTables(i).ShowHeader = True |
End If |
Next End Sub |