I have been searching the web and have found work around suggestions, - the best was probably setting the rowheight = 0 - but that would require looping through each row.
In my case, I have an unbound flexgrid that includes a column that can equal one of two values. Is there a setting that can be used to make the grid show only the rows with one of these values?
Anthony,
i think u r trying to show or hide column / row depends on value exist or not, as spoo told, try to populate as prefiltered, other wise u hav to set row height = 0 to hide.
I have an unbound grid populated from various sources and want the user to be able to selectivly view all records, or only ones with value A or Value B (so the selection cannot be restricted).
Filtering flexgrid means you have to re-populate it with new set of data.
With that said read my first reply and try to answer that in a bit more detailed way.
I am populating the grid from a spreadsheet - containing Bank Transactions. The user will tick some of these transactions as reconciled. I have a combo box that holds three values - reconciled, unreconciled and All. When the user selects one of the values in the combo box, I want the grid to display all of the transactions that have the value selected - ie show all reconciled or all unreconciled or everything - depending on their selection.
I realise that I could loop through the grid setting the row height to zero for any transaction that does not match the users selection, but was wondering if the grid had a property that would display only rows where column N = "Reconciled" etc to avoid the loop.
I purposly asked you (few times) how you populate grid ans was hoping that you would get the idea...
Anyway, rather than changing row height I would re-populate grid. You must have some produre that does it, don't you.
You may pass an argument to that procedure (say: filterCriteria as String) and the possible values could be "reconciled", "unreconciled" or "all".
Based on that argument value your procedure should "know" what to select from the source.
Sorry Rhino but I must be really thick or something.
I just dont see how repopulating from the spreadsheet would help, when the values "Reconciled" etc have been entered on the grid, and therefore do not exist in the spreadsheet.
Your original idea of looping thru the rows (which you are trying to avoid) is the simplest method of achieving what you want, and should only be a few lines of code.
You could use 2 grids
1.- Pass from spreadsheet to grid1
2.- User tick some of these transactions as reconciled, then, pass this row to grid2 and remove from grid1
...
... but was wondering if the grid had a property that would display only rows where column N = "Reconciled" etc to avoid the loop.
Tony
Short answer is no.
FG's do not have such a property.
Hence the jist of the several approaches that have been suggested:
Si - setting row height to 0 may be the quickest and easiest
Rhino, et al - put contents of Excel sheet into an array.
The array will have all data.
Then, after the user has "ticked" the reconciled ones and subsequently
selects which ones should be displayed, clear the grid and repopulate
it from the array accordingly.
In either case, (setting row height or populating from array), do this:
first, set the Visible property to False.
then do your thing
finally, set Visible = True
This may seem counter-intuitive, but it will significantly speed up
the processing (and thus the "refresh") of the FG. No flicker will occur.
Anthony, i tried ADO with excel as database, without looping, i hav attached as project, just check and feedback, while first time run it gives an error 'selected collating seq not supported by the OS' but it wont show after compiled, so dont wory abt it
Hi Seenu - thats a cool bit of code - really clean.
It does not help my current issue (cos the Reconciled flag is being set on the grid when the user clicks on a row) - but I can probably use that method elsewhere
By the way - how do I mark a thread as Resolved - I have put Resolved in the Title of my reply - is that enough? Cheers.
why dont u use the combo box to let the user to select category so u can use the fast fill method with out looping, just a suggestion to avoid loop.
and u can use Thread tools above to mark thread as resolved.
that's the way to go - query source, populate recordset, use Clip to avoid looping...
In fact all of the above is available via "ms flexgid tips & tricks" link in my signature.
that's the way to go - query source, populate recordset, use Clip to avoid looping...
In fact all of the above is available via "ms flexgid tips & tricks" link in my signature.