Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get rid of the selection highlighting?

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
JohnSummit2



Joined: 18 Jan 2011
Posts: 12

PostPosted: Thu Jan 16, 2014 1:39 am    Post subject: How to get rid of the selection highlighting? Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5000

PostPosted: Thu Jan 16, 2014 3:08 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
JohnSummit2



Joined: 18 Jan 2011
Posts: 12

PostPosted: Thu Jan 16, 2014 5:47 am    Post subject: Reply with quote

Thanks. At least I now know that there isn't a much more elegant solution Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group