This is a migrated thread and some comments may be shown as answers.

Implement Type Ahead in Grid

3 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Betsy
Top achievements
Rank 1
Betsy asked on 21 Dec 2010, 08:25 PM
Has anyone implemented type-ahead capability in the WPF RadGridView like in a windows grid where you can click on a given cell, start to type and have the grid position the current row to the row that starts with whatever letters have been typed?  If so can you share some code?

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 22 Dec 2010, 09:25 AM
Hello Heather,

We have a similar online demo. Please check it here.

All the best,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Betsy
Top achievements
Rank 1
answered on 22 Dec 2010, 03:13 PM
Yeah I've seen that, but was looking for an example of actually typing onto the grid like you can in a windows grid or list box.
0
Vlad
Telerik team
answered on 28 Dec 2010, 12:53 PM
Hi,

 You can use KeyDown event to find and scroll into view desired item. For example:

private void RadGridView_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
    e.Handled = true;
 
    var grid = (RadGridView)sender;
    var item = grid.Items.OfType<Customer>().Where(c => c.CompanyName.StartsWith(e.Key.ToString())).FirstOrDefault();
    if (item != null)
    {
        grid.ScrollIntoView(item);
    }
}


Kind regards,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
GridView
Asked by
Betsy
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Betsy
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or