joe_pool_is Posted February 27, 2008 Posted February 27, 2008 I have a DataBound DataGridView on a form that ties into our company's records of all employees, both past and present. We want the DataGridView to include all of the employees, but also include the ability to view only active or only past employees. I have tried hiding individual rows like so:DataGridView1.Rows[i].Visible = false; // C# syntaxBut, the compiler will not allow this. Does anyone have any other ideas? Can this be done with a DataBound DataGridView? Quote Avoid Sears Home Improvement
Machaira Posted February 28, 2008 Posted February 28, 2008 Requery the database for the set of employees you want to view. Quote Here's what I'm up to.
Administrators PlausiblyDamp Posted February 28, 2008 Administrators Posted February 28, 2008 Are you binding the datagridview directly to a dataset / datatable? If so you might want to look at using a dataview and binding to that, then you could set a filter on the dataview. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
joe_pool_is Posted February 28, 2008 Author Posted February 28, 2008 Are you binding the datagridview directly to a dataset / datatable? If so you might want to look at using a dataview and binding to that, then you could set a filter on the dataview. I understand, and I got it working. I added a new FillBy clause to my TableAdapter, and refilled my DataGridView. Thanks! Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.