We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Type ahead

Thread ID:





14459 May 27,2004 11:13 AM UTC May 28,2004 11:37 AM UTC WinForms 1
Tags: Grouping
Gregg Reed
Asked On May 27, 2004 11:13 AM UTC

I would like to do a type ahead that would scroll the Grouping grid down to the first match. I know capturer the key strokes and display a dialog showing there current strokes, but how do I programmatically scroll the grid to the best match of the first column?

Administrator [Syncfusion]
Replied On May 28, 2004 11:37 AM UTC

At this time, you can only find the group by looping through the Groups collection in TopLevelGroup and compare the category of each group with your search string. But that is not very efficient, especially since the Groups are already sorted by the category name. Adding support for finding the closest match is not difficult in our source base and we''ll do that for future version. (Sorry - you need to acess internal members therefore our source code needs to be modified). If you have source code and want to check it out add the following lines in Grouping\src\Collections\Groups.cs public Group FindHighestSmallerOrEqualKey(object category) { if (_groupWithGroups != null && _groupWithGroups.ParentGroup != null) { _groupWithGroups.EnsureInitialized(this, true); int c = this._groupWithGroups.ParentTable.GetVisibleCount(); Type type = this._groupWithGroups.columnDescriptors[0].FieldDescriptor.GetPropertyType(); object key = Convert.ChangeType(category, type); GroupsTreeTableEntry gte = (GroupsTreeTableEntry) _inner.TreeTable.FindHighestSmallerOrEqualKey(new object[] { key }); if (gte == null) return null; return gte.Element; } return null; } public Group FindLowestHigherOrEqualKey(object category) { Group g = FindHighestSmallerOrEqualKey(category); if (g.Category.Equals(category)) return g; GroupsTreeTableEntry gte = (GroupsTreeTableEntry) g.GetElementEntry(); ITreeTable tree = gte.Tree; GroupsTreeTableEntry next = tree.GetNextEntry(gte) as GroupsTreeTableEntry; if (next == null) return null; return next.Element; } These functions will now let you find the closest match as follows: Group g = this.groupingGrid1.Table.TopLevelGroup.Groups.FindLowestHigherOrEqualKey("Germa"); Stefan


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon