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 

BUG?: Row.Selected = true -> no clear of current selectio

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



Joined: 06 Oct 2005
Posts: 15
Location: Regensburg, Germany

PostPosted: Mon Dec 19, 2005 4:21 pm    Post subject: BUG?: Row.Selected = true -> no clear of current selectio Reply with quote

Hi,
I need to find a row a show it in my VirtualTree.

I have made my own find method depending of the objects in my Tree (I am using ObjectBinding) and then,
Code:
Row foundRow = MyFindRowByID(...);
foundRow.EnsureVisible();

then I need to mark this foundRow.
A simple solution is to mark it selected:
Code:
if (!foundRow.Selected)
{
   foundRow.Tree.SelectedRows.Clear();
   foundRow.Selected = true;}


I have set the "AllowMultiSelect" property to false for that tree.

I should add the foundRow.Tree.SelectedRows.Clear(); to clear the selection.
I am wondering why?

According to me, you should add this line (selectedRows.Clear) in the set property Selected of row when AllowMultiSelect of the tree is false;
This this indeed the case when selecting a row with the mouse, why not programmatic?

How do you think?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Dec 19, 2005 9:48 pm    Post subject: Reply with quote

This is by design. To quote from the online help for AllowMultiSelect

Quote:
This does not affect the ability of the application to select multiple rows via code.


Basically if you are setting selection programmatically then it is easy to achieve what you want by calling VirtualTree.SelectedRow = row. This will clear the selection prior to making the given row the only selected 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