Hi
Not sure if this is just me or a bug.
Calling a Method in a model to search for a particular row.
The search method in the model does the following
defines a buffer for my search for the current models temp-table.
Finds the correct row in the temp-table
Repositions the handle of the models query to the rowid of the temp-table just found. using the query handles reposition-to-rowid method.
SearchCommand in the View does the following
Calls the Models search method.
refreshes the ProBindingsource using the refresh() method.
Everything works fine if I have not previously had focus on the UltraGrid.
Once I have moved between rows in the grid with the mouse or keyboard and then performed the search I correctly get moved to the new row but the previous row is still highlighted.
I have tried a refresh() on the grid but that makes no difference.
Using 10.2B02
Row selectors or shown on the UltraGrid and the UltraGrid is set to single select.
Any ideas?
I have just tried another sample where if I have clicked into a read-only cell on the grid and then refresh the model by a query-close and query-open.
Everything works as expected. The highlighted row goes back to the top without leaving any highlight on the previous highlighted row.
If I click on the row-selector and then refresh. The top row is highlighted as expected but the previous highlighted row stays highlighted.
Ok setting THIS-OBJECT:uGridSpec:ActiveRow:Selected = FALSE
before THIS-OBJECT:moBSSpec:RefreshAll() /* bindingsource */ seems to work with the simple refresh example
and on the repostion-to-rowid example I did the following
THIS-OBJECT:uGridSpec:ActiveRow:Selected = FALSE.
THIS-OBJECT:mosmSpecModel:FindSpec(cSearchSpec). /* peforms a reposition-to-rowid on teh query in the model */
THIS-OBJECT:uGridSpec:Refresh().
Thanks
bheavican schrieb:
I believe we have seen something similar with a single row select grid. Our steps are to click on a row and drag your mouse down the grid and when you release the mouse 2 records are selected. We have not submitted a bug for this.
Try setting
ultraGrid1:DisplayLayout:Override:SelectTypeRow = SelectType:SingleAutoDrag .
or on every Band:
oBand:Override:SelectTypeRow = SelectType:SingleAutoDrag.
to fix this.
dhubbuck schrieb:
THIS-OBJECT:uGridSpec:ActiveRow:Selected = FALSE.
Did you try:
THIS-OBJECT:uGridSpec:Selected:Rows:Clear () .
instead? I'd prefer not to rely on the active row for such a fix.
fixed a typo in the sample code.
Thanks Mike. The behavior changes slightly but it fixes what we were seeing.
mikefe wrote:
dhubbuck schrieb:
THIS-OBJECT:uGridSpec:ActiveRow:Selected = FALSE.
Did you try:
THIS-OBJECT:uGridSpec:Selected:Rows:Clear () .
instead? I'd prefer not to rely on the active row for such a fix.
fixed a typo in the sample code.
Hi Mike
Thanks. That seems to do the trick when I'm performing a search.
If I have a single select Grid why when the Bindingsource position changes does the grid not update correctly. Is it a feature?
Also if the row selectors are shown and I use a button to move the bindingsource to the previous or next row then teh same problem occurs.
Do I need to perform the same fix during these operations or is it a gird property problem?
Not sure if you have noticed that if the update of a bindingsources position by code is to a position prevoius to the current top most gridrow (Eg Position - 1) then its really slow.
If you move up using the keyboard then its fine. Any Ideas?
Thanks again. You seem to be a saviour on these forums.
Dale