I have a grid and I will like to filter all the rows of the grid based on one or more columns.For example the data in the grid displays a list of employees. the employees belong to a department.I would like to filter by that column so that I can programmatically filter out rows based on the current user's department.
If for example the current logged-in user is in the Human Resources department, then the grid should only display employees that belong to the same department.
I would like to know also whether this functionality is available for the UltraCombo as well. (Displaying only the employees that belong at the specified department)
Note: I am using Stored Procedures to get the data, but I don't want to apply any filtering at that level. I want all rows returned and then I want to filter out rows programmatically.
Regards,
Nicolas
Hi Nicloas,
Yes, you would use the ColumnFilters collection, either on the Rows collection of the Band (depending on the RowFilterMode property) for the this.
Hi,
Is it possible to post some sample code?
You mean like this?
Creating a dropdown list in a grid cell whose list values are dependent on another cell - Windows Forms - Infragistics Community
Hey Guys,
Since we on the topic of filtering a grid. Lets say we have a grid with about 100 rows of data, and you filter the data to the point that only 30 records are left in the grid. if i should save the data, is it that only the 30 visible rows will be saved or will the other 70 records will also be saved. in other words, how can i ensure that only the visible records are saved?
Thanks in advance
Yeah, it really depends on what kind of save you are talking about here.
Are you referring to saving the grid data to it's DataSource? Or saving the DataSource data to the back end?
If it's the former, then the grid will typically update the data source any time a row loses focus. This is based on the UpdateMode property, though, so you have some options there.
For the latter, the grid has no part in updating the back end. That's between the DataSource and whatever back end you are using (if any).
Hi Mike, let me explain further. I have a ultragrid that i populate with data. let us say the initial record count is 70. I filter the rid to the effect that only 30 records remain (are visible). What i should also mention is that an untyped dataset is binded to the grid. Not an ultradataset, but a regular dataset. I then do the following
string xmlstr = dsData.GetXML();
what is does is give me the xml format for the dataset, which i pass directly into my stored procedure for processing.
This is the question. How to i ensue that only the visible 30 records are sent to my SP?
Please help. Thanks
there is a filtered in rows property you should probably use for this