Column seperators

2 posts, 0 answers
  1. Philip
    Philip avatar
    28 posts
    Member since:
    May 2009

    Posted 26 Jun 2009 Link to this post

    Hello,

    I had a question regarding the creating of a singular separator line between two columns in a grid. To explain, the issue has to do with further development on a project using features provided in another thread (one dealing with creating over-headers). The requested feature now is to separate two parts of the grid with a thick vertical line. I've yet to find a way to do this, and I as wondering if anyone on the boards could provide a way to implement this.

    Thanks to everyone for their time,

    Philip Coffey
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 03 Jul 2009 Link to this post

    Hello Philip,
    Please excuse me for the late answer . I was trying to prepare a XAML based solution but found it heavy.

    Bellow is an easier and fast way to make a column separation line:
    public Page()  
            {  
                InitializeComponent();  
                this.RadGridView1.ItemsSource = Person.GetSampleListOfPersons();  
                this.RadGridView1.RowLoaded += new EventHandler<Telerik.Windows.Controls.GridView.RowLoadedEventArgs>(RadGridView1_RowLoaded);  
            }  
     
            void RadGridView1_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)  
            {  
                if ( e.Row.Cells.Count > 0)  
                    e.Row.Cells[0].ChildrenOfType<Border>()[0].BorderThickness = new Thickness(1, 1, 5, 1);  
            }  
     

    What this code actually does is - In the RowLoaded event  it sets a larger thickness to the right border of the first cell. Here it is hardcoded for the first cell but you can modify the code according  to your needs.
    Also please note that you may need to check the type of e.Row as the event is fired for all rows - including header row.

    Hope that helps.

    Sincerely yours,

    Pavel Pavlov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top