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

[Solved] Grouping with nested tables

1 Answer 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
emidio rana
Top achievements
Rank 1
emidio rana asked on 26 Mar 2013, 10:05 AM
When I have grouped a grid, with nested table, in columns and in the prerender event i hided some of gruped results happen that remain a spaces in the grid.
I'm try in all ways to remove that spaces but without success.
I see that the spaces disappear when I open and collapse a grouped row.
In the attached file can you see the result's grid.
This is the code.

For Each item As GridGroupHeaderItem In gridTelerik.MasterTableView.GetItems(GridItemType.GroupHeader)

item.Expanded = False

Dim groupDataRow As DataRowView = CType(item.DataItem, DataRowView)

If item.DataCell.Text.IndexOf("Partita:") > -1 Then

item.DataCell.Text = item.DataCell.Text.Replace(item.DataCell.Text.Substring(9, 8), "")

Dim StrdtReverse As String = item.DataCell.Text.Substring(item.DataCell.Text.Length - 10, 10)

Dim StrdtReverseConcat As String = String.Concat(StrdtReverse.Substring(6, 4), StrdtReverse.Substring(3, 2), StrdtReverse.Substring(0, 2))

Dim dtRowPartita() As DataRow = dataTableEstrattoConto.Select(String.Concat("Partita='", StrdtReverseConcat, item.DataCell.Text.Replace("Partita: ", ""), "'"))

For ik As Integer = 0 To dtRowPartita.Length - 1

totaleNettoPartita += Convert.ToDecimal(dtRowPartita(ik).Item("Importonetto"))

Next

item.DataCell.Text = String.Concat("Saldo partita: <b>", String.Format("{0:n2}", totaleNettoPartita), "</b>")

totaleNettoPartita = 0

End If

'item.DataCell.Text = "$" + groupDataRow("Cliente").ToString() + " (" + groupDataRow("Importonetto").ToString() + ")"

If item.DataCell.Text.IndexOf("Cliente:") > -1 Then

Dim dtRowCliente() As DataRow = dataTableEstrattoConto.Select(String.Concat("Cliente='", item.DataCell.Text.Replace("Cliente: ", ""), "'"))

For ik As Integer = 0 To dtRowCliente.Length - 1

totaleNetto += Convert.ToDecimal(dtRowCliente(ik).Item("Importonetto"))

totaleRitenuta += Convert.ToDecimal(dtRowCliente(ik).Item("Importoritenuta"))

totaleLordo += Convert.ToDecimal(dtRowCliente(ik).Item("Importolordo"))

totaleImponibileRitenuta += Convert.ToDecimal(dtRowCliente(ik).Item("Imponibileritenutaacconto"))

Next

item.DataCell.Text = String.Concat(groupDataRow("Cliente").ToString().TrimStart, "<br> <b>TOTALI: Importo lordo:</b> ", String.Format("{0:n2}", totaleLordo), _

" - <b>Imponibile ritenuta acconto:</b> ", String.Format("{0:n2}", totaleImponibileRitenuta), _

" - <b>Importo ritenuta:</b> ", String.Format("{0:n2}", totaleRitenuta), " - <b>Importo netto:</b> ", String.Format("{0:n2}", totaleNetto))

If totaleLordo = 0 Then

If (Request.QueryString("st") Is Nothing) Or _

(Not Request.QueryString("st") Is Nothing AndAlso Request.QueryString("St").ToString <> "1") Then

'se le partite si pareggiano tra di loro, perch ad es. c' una nota di credito in un altra partita

'non rendo visibile il tab

item.Visible = False

item.Display = False

item.Expanded = False

End If

End If

totaleGenerale += totaleNetto

totaleLordo = 0

totaleNetto = 0

totaleRitenuta = 0

totaleImponibileRitenuta = 0

End If

Next

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 29 Mar 2013, 10:08 AM
Hello Emidio,

I was not able to reproduce the issue. I prepared a small sample and attached it to this thread. Please give it a try and let me know how it differs from your real setup.

Kind regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
emidio rana
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or