Hi. I want to resize the width and height of the filter in gridview. I wanna place the filter in the corner of the view along with buttons on the same bar. In order to do that, I have to change the width and height of the filter.
Is that possible?
My second question is that i have 5 columns in the gridview and i want to make search on every column. I mean, i don't want to specify a single ds.filteringKey=@"Column1"... I want to operate search on all columns at the same time...
How could i do that?
Thanks...
Hi,
You'd basically need to do that yourself.
For the filtering on multiple fields, you can read a blog post i wrote a while back, on how to to do filtering in iOS: http://www.infragistics.com/community/blogs/stevez/archive/2013/10/21/ios-objective-c-filtering-a-nsarray-using-nspredicate.aspx
To customize the filter cell, you can override the following selector in your IGGridViewDataSourceHelper:
- (IGGridViewFilterCell *) filterCellForGridView:(IGGridView *)gridView;
Basically, you'd return your own custom version of the IGGridViewFilterCell that looks the way you want it to. You'd then listen to the text changing, and update the data in your DSH manually, to reflect your filtering.
-SteveZ
Hi Stephen;
Thanks for ur answer...
I have implement it. However, I am having a problem. As seen in the screen shoot, I have implemented the IGGridView with headerCell (including columns Pid, MPver etc) and rows generated by a data assigning to CustomDataSourceHelper.
I used CustomDataSourceHelper as u mentioned in previous message to create a custom search field. I did it, however i could only position it under the HeaderCell of GridView.
Above the HeaderCell, there is another UIView i have created in IB and this view should contain the quick action buttons and searchfield. So my searchfield has to be positioned in the white rectangle.
Is there any solution for that?
Best Regards
I don't think your screenshot saved properly, as I can't see it.
However, there isn't a way to make the filter row appear above the header row.
That being said, you're better of just not using the filter row. Instead you can just position your custom view above the grid, like you desired, and let the DSH know about the filtering yourself. (Thats all the FilterRow is doing)
So when your textField's text changes, just do the following:
if([_gridView.dataSource respondsToSelector:@selector(gridView:applyFilterWithText:)])
{
[_gridView.dataSource _gridView applyFilterWithText:newText];
}
[_gridView reloadData];
And thats it. The filtering will work the same as the filter row cell.
Hope his helps!