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 

Deselect Row with single click

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



Joined: 27 Jun 2006
Posts: 15
Location: Switzerland

PostPosted: Tue Jul 04, 2006 9:37 am    Post subject: Deselect Row with single click Reply with quote

Hello,

i've got a simple problem.

if you want to deselect an selected row you have to press ctrl while you click. this is to less intuitiv in our case. i want it make it possible to deselect with a simple click on a row allready selected. the tree is always single-selected.

how can i do that?

thanks
egl
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jul 05, 2006 12:41 am    Post subject: Reply with quote

You would need to derive a new class from Virtual Tree and override the SelectRow method as follows:

Code:
protected override void SelectRow(Row row)
{
    if (row.Selected)
    {
        if (AllowSelectionChange(row, row, SelectionChange.Clear))
        {
             SelectedRows.Clear();
        }
    }
    else
    {
        base.SelectRow(row);
    }
}

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
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