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

Can rowspan apply to radgird?

2 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex Yung
Top achievements
Rank 1
Alex Yung asked on 23 Oct 2008, 06:44 AM
Dear Telerik Support Team,

Can rowspan apply to radgird after assign DataSource? (RadGrid.DataSource = DataTable)

Any help is highly appreciated!

Thanks,
Alex

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Oct 2008, 10:39 AM
Hello Alex,

You can add the RowSpan attrribute for cells in the ItemDataBound event which will fire after the grid is bound with data. If this is your what you require,try out the code below.
cs:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
       if (e.Item is GridDataItem) 
        { 
            GridDataItem dataItem = (GridDataItem)e.Item; 
            if (dataItem["CompanyName"].Text == "Soft Traders") 
            { 
               dataItem["CompanyName"].RowSpan = 2
            }   
        } 
     } 

Thanks
Princy.
0
Alex Yung
Top achievements
Rank 1
answered on 24 Oct 2008, 12:52 AM
Hi Princy,

Thanks for your reply. I use DataTable as the source so the row below the rowspan will move right for one cell. How can I overcome this?

Thanks,
Alex
Tags
Grid
Asked by
Alex Yung
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Alex Yung
Top achievements
Rank 1
Share this question
or