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

RowSpan in Gridview

7 Answers 114 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dhileep Kumar Sampath
Top achievements
Rank 1
Dhileep Kumar Sampath asked on 17 Nov 2009, 06:13 PM
Hi All,
        I want to merge two rows if the values are same. I found that asp.net ajax control supports that and the code snippet is given in the thread 'http://www.telerik.com/community/forums/aspnet-ajax/grid/rowspan-in-radgrid.aspx'. The code snippet is also given below;

 
protected void RadGrid1_PreRender(object sender, EventArgs e)  
    {  
        for (int rowIndex = RadGrid1.Items.Count - 2; rowIndex >= 0; rowIndex--)  
        {  
            GridDataItem row = RadGrid1.Items[rowIndex];  
            GridDataItem previousRow = RadGrid1.Items[rowIndex + 1];  
            if (row["ColumnUniqueName"].Text == previousRow["ColumnUniqueName"].Text)  
            {  
                row["ColumnUniqueName"].RowSpan = previousRow["ColumnUniqueName"].RowSpan < 2 ? 2 : previousRow["ColumnUniqueName"].RowSpan + 1;  
                previousRow["ColumnUniqueName"].Visible = false;  
            }  
        }  
    } 


 I dont see the prerender event in the silverlight radgridview control. So in which event should i do this and is RowSpan property available in gridview column? Can someone please help me on this.

Regards,
Dhileep

7 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 20 Nov 2009, 06:41 AM
Hi Dhileep Kumar Sampath,

Currently we do not support this as an internal feature. However with the help of some visual hacks the same effect may be achieved . I have attached an example for your reference. The approach is similar.

Regards,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dhileep Kumar Sampath
Top achievements
Rank 1
answered on 20 Nov 2009, 02:19 PM
Hi Pavel,
    Thanks for your quick reply. It worked like a charm and I was able to give the visual effect like cells are merged. Currently the row indicator is not having any border. Will it be possible to show the border in the rowindicator also?

Thanks,
Dhileep
0
Tsvyatko
Telerik team
answered on 25 Nov 2009, 09:27 AM
Hi Dhileep Kumar Sampath,

I have modified Pavel's project by specifying RowStyle that displays borders in the row indicator. You can further customize the style to fit your needs.


Regards,
Tsvyatko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John
Top achievements
Rank 1
answered on 12 Jun 2013, 08:04 AM
Hello,

Hi there..I would like to ask something..I've tested the mergedverticalcell app..The result will return a merged cell for column FirstName..
Question: I would like to do a merged cell for several columns..By taking the mergedverticalcell app for example, I would like to merged  2 columns..1st column FirstName & 2nd column Last Name..How should I do this?..A solution example should be helpful..

Thanks guy
0
atran
Top achievements
Rank 1
answered on 20 May 2014, 06:39 PM
sorting breaks the merged cells logic.  how to fix it?
0
atran
Top achievements
Rank 1
answered on 21 May 2014, 12:35 AM
the logic would break if enablerowvirtualization = true. how to fix?
0
Yordanka
Telerik team
answered on 22 May 2014, 12:58 PM
Hello Andy,

In this thread a custom solution has been discussed which is not a build-in feature. Those unexpected problems can arise. 
The request for merged cells is logged as a feature Add: merge cells. You can vote for it. We already started working on it so you can track its status. 

Regards,
Yordanka
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Dhileep Kumar Sampath
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Dhileep Kumar Sampath
Top achievements
Rank 1
Tsvyatko
Telerik team
John
Top achievements
Rank 1
atran
Top achievements
Rank 1
Yordanka
Telerik team
Share this question
or