Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Datagrid filter row selected.
 

Datagrid filter row selected.

Hi,

I have a datagrid which displays 100 rows. User can apply filter on datagrid. It works fine but it doesnt remember the selected row. 

If user has selected one or multiple row and applies filter then all the rows which were selected before filter and are now present in new result set (after applying filter) then those rows should be selected. But I am not able to achieve it because the row position now changes. 

Any help would be appreciated.

Thanks,
Nilay
MigrationUser 1  Tuesday, March 30, 2004 12:53 AM
Save the key information (primary key) to a collection before filtering then after the filter loop though the collection and find the rows with matching keys and then select them.

Easy as pie
MigrationUser 1  Thursday, April 01, 2004 11:37 AM
Please post code how to filter a datagridview from an textbox.text
KENTY  Sunday, September 25, 2005 3:07 PM

You can use google to search for other answers

Custom Search

More Threads

• Datagridview conditional formatting rows
• combobox behavior?
• Failed to update datatable after delete row.
• Listbox XML file databining
• Bug? Bound listboxes with dataviews - Problems with SelectedIndex and view
• Picking cells in a DataGridView
• Help me! I want when I edit value in my datagrid, press Enter...
• DataGridView GetFirstRow() problems
• Databinding from a DataSet to a Forms.TextBox
• Stored Procedure shows resultset one pc, not on the other.