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