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 

Select a row by typing

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



Joined: 04 Aug 2008
Posts: 22

PostPosted: Fri Dec 05, 2008 2:13 pm    Post subject: Select a row by typing Reply with quote

Hi,

is it possible for the user to change the row selection by typing in the list? (Well, I tried it and it doesn't work. But maybe there is a property I can set?)
I'd prefer it to be like in Windows Explorer where you can type the first part of a file name to jump to the corresponding item in the list.

Thanks in advance for any advice.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Dec 05, 2008 10:02 pm    Post subject: Reply with quote

Virtual Tree is optimized to work with very large data sources. The only way to implement this type of feature within Virtual Tree itself would be to iterate through every row of the tree and load data for each. For large trees this can potentially be very slow. If you need this feature then you can handle the KeyDown event and process it yourself.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
floele



Joined: 04 Aug 2008
Posts: 22

PostPosted: Sat Dec 06, 2008 10:20 am    Post subject: Reply with quote

How would I iterate through each row? More specifically, I'd in fact only need the values of the first column.

I know that it *could* be slow, but this kind of searching does still work very well with the standard virtual ListView and many thousand items.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Dec 07, 2008 12:51 am    Post subject: Reply with quote

The best way would be to work with the data source directly (ie not through Virtual Tree) and locate the data item you wish to move to. Then use the FindRow or GetRow methods to locate the Row in the VirtualTree and set FocusRow to this Row. That way VirtualTree does not have to retrieve all the data and create visual representations of rows that may never be displayed.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
floele



Joined: 04 Aug 2008
Posts: 22

PostPosted: Sun Dec 07, 2008 2:10 pm    Post subject: Reply with quote

Hm, is there a simple way to get the value of a given object for a column of your choice? If I want to keep this functionality generally usable, I can't do a switch() for the column and then check the property of my objects.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Dec 07, 2008 10:56 pm    Post subject: Reply with quote

If you want it to be completely generic then you may have to work through Virtual Tree and iterate over the child rows of the RootRow object by calling RootRow.ChildRowByIndex for each index. You can then use the RowBinding to get the CellData for the required column. Something like:

Code:
for (int i=0; i < vt.RootRow.NumChildren; i++)
{
    Row row = vt.RootRow.ChildRowByIndex(i);
    RowBinding binding = vt.GetRowBinding(row);
    CellData cellData = new CellData(column);
    binding.GetCellData(row, column, cellData);
    string text = cellData.GetText();
}

_________________
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