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

Column seperators

1 Answer 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 26 Jun 2009, 01:44 PM
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

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 03 Jul 2009, 08:14 AM
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.
Tags
General Discussions
Asked by
Philip
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or