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

[Solved] Show headers by group in Rad grid

4 Answers 215 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gerardo
Top achievements
Rank 1
Gerardo asked on 19 Jun 2008, 01:38 AM
Hi
My problem happens when I group rows in a grid, headers of columns are shown only in the first rosw of all grid and i need to show this in every group , any suggestion?
thnx in advance!

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Jun 2008, 05:29 AM
Hi Gerardo,

Go through the following demo link.
Client group load

Shinu.
0
Gerardo
Top achievements
Rank 1
answered on 19 Jun 2008, 02:11 PM
Hi Shinu
My doubt is (by example in link you give me) how to make the header row (where appears country, city,company name,...)appears after or before of every row group(Country:Argentina, Country:Austria..). Exist any way to make it?
Thanks
0
Princy
Top achievements
Rank 2
answered on 20 Jun 2008, 05:59 AM
Hi Gerardo,

Here is a help article which explains hot to customize the GridGroupHeader.
Customizing GridGroupHeaderItem

Princy.
0
Gerardo
Top achievements
Rank 1
answered on 20 Jun 2008, 08:32 PM
I saw the link and was very useful
With this code, i add cells for every grouop in the way i wanted



Private Sub radGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.WebControls.GridItemEventArgs) Handles radGrid1.ItemDataBound 
 
 
        Dim cellToAdAll As System.Web.UI.WebControls.TableCell 
 
        If TypeOf e.Item Is GridGroupHeaderItem Then 
            Dim item As GridGroupHeaderItem = CType(e.Item, GridGroupHeaderItem) 
            Dim groupDataRow As DataRowView = CType(e.Item.DataItem, DataRowView) 
 
            'Hide original cell for group 
            item.Cells(1).Visible = False 
 
 
            'Add customize cells for group 
 
            cellToAdAll = New System.Web.UI.WebControls.TableCell 
            cellToAdAll.Text = groupDataRow("colData1").ToString()  
            item.Cells.Add(cellToAdAll) 
             
            cellToAdAll = New System.Web.UI.WebControls.TableCell 
            cellToAdAll.Text = "textCol2"  
            item.Cells.Add(cellToAdAll) 
             
            cellToAdAll = New System.Web.UI.WebControls.TableCell 
            cellToAdAll.Text = "textCol3"  
            item.Cells.Add(cellToAdAll) 
 
 
 
        End If 
End Sub 


Thank you very much :D


Tags
Grid
Asked by
Gerardo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Gerardo
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or