View previous topic :: View next topic |
Author |
Message |
JohnSummit2
Joined: 18 Jan 2011 Posts: 12
|
Posted: Thu Jan 16, 2014 1:39 am Post subject: How to get rid of the selection highlighting? |
|
|
I'm using the VT in a form to show some data. The nature of this form is such that there is not really a concept of 'selecting' data as its purpose is to allow the user to view and change the data in each cell. I have not found a way to completely get rid of the cell or row selection highlighting. If I set the RowSelectedStyle to RowStyle then it has no effect.
Edit: I managed to get rid of the selection via the below code. Is there an easier way?
Code: | // Do not show any row selection bar.
this.virtualTree_Sequence.RowSelectedStyle.BackColor = this.virtualTree_Sequence.RowStyle.BackColor;
this.virtualTree_Sequence.RowSelectedStyle.ForeColor = this.virtualTree_Sequence.RowStyle.ForeColor;
this.virtualTree_Sequence.RowSelectedStyle.BorderColor = this.virtualTree_Sequence.RowStyle.BorderColor;
|
Thanks. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Jan 16, 2014 3:08 am Post subject: |
|
|
That solution works - an alternative is to handle the SelectionChanging event and set Cancel to true. This prevents any selection occurring:
Code: | private void _virtualTree_SelectionChanging(object sender, SelectionChangingEventArgs e)
{
e.Cancel = true;
} |
_________________ Infralution Support |
|
Back to top |
|
|
JohnSummit2
Joined: 18 Jan 2011 Posts: 12
|
Posted: Thu Jan 16, 2014 5:47 am Post subject: |
|
|
Thanks. At least I now know that there isn't a much more elegant solution |
|
Back to top |
|
|
|