RowSpan in Gridview

8 posts, 0 answers
  1. Dhileep Kumar Sampath
    Dhileep Kumar Sampath avatar
    35 posts
    Member since:
    Oct 2009

    Posted 17 Nov 2009 Link to this post

    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
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 20 Nov 2009 Link to this post

    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.
  3. DevCraft banner
  4. Dhileep Kumar Sampath
    Dhileep Kumar Sampath avatar
    35 posts
    Member since:
    Oct 2009

    Posted 20 Nov 2009 Link to this post

    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
  5. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 25 Nov 2009 Link to this post

    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.
  6. John
    John avatar
    1 posts
    Member since:
    Jun 2013

    Posted 12 Jun 2013 Link to this post

    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
  7. atran
    atran avatar
    12 posts
    Member since:
    Feb 2010

    Posted 20 May 2014 in reply to Tsvyatko Link to this post

    sorting breaks the merged cells logic.  how to fix it?
  8. atran
    atran avatar
    12 posts
    Member since:
    Feb 2010

    Posted 20 May 2014 in reply to Pavel Pavlov Link to this post

    the logic would break if enablerowvirtualization = true. how to fix?
  9. Yordanka
    Admin
    Yordanka avatar
    634 posts

    Posted 22 May 2014 Link to this post

    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.
     
Back to Top
DevCraft banner