Not a child-form, a BBS-Problem?


Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

forget my last topic. After testing a bit more, ir has become clear that the error happens earlier before the the childfprm-dialog is called. So what now is easy to trace is the following:

I have a datagridview with a bbs as datasource. After changing the sort-order by clicking on the header of a grid-column and then adding a new record to the BO with the add()-method. something in the bo gets out of sync and the bo does not point to  the newly added record  but to some other record.

Or, to illustrate it, say I have a tabke with three customers, "Cust1", "Cust2","Cust3". It opens with a select statement in the bo like "select * from customers order by name". The BO is synced to BBS which is attached to Datagrdview. Now I chage the grids sortorder by clicking on a header to "city" ( or any other column.

Now I call the add-method of the bo. A new record is added, but the "active" (or choosen) record the bo points to, is not the new one but for example the one containng "Cust2".

Whe i do a bit of controlling in the code I notice that it does happen immediately after the add-method, für example this code already shows the error:



kundenbo1.add()

msgbox(kundenbo1.name)  shows already "cust2" instead of an empty string



Did I miss something there or is this a bug?. Is the BO/BBS not able to handle the chaning of the sort-order in the grid or do I have to do something extra about it.

Best regards

Thomas
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Thomas,

I use a lot of BBS but with DevExpress controls including the GridView.  I remember long time ago when I tried to use the native .net datagridview, I had all kind of issues.

That asside, be aware that when manipulating data via the Business Objects, just must be very careful with the current BO Sort and Filter because if when adding a record and a filter is in place, the record will not be shown in the BO current view and probably the same would happen with the BO sort, so in your case, before adding a new record, temporarily reset the BO.Sort property and see if that fix the problem, something like this:

Dim currentBoSort as String = kundenbo1.Sort
kundenbo1.Sort = String.Empty
kundenbo1.add()
msgbox(kundenbo1.name)  shows already "cust2" instead of an empty string
kundenbo1.Sort = currentBoSort


Edhy Rijo

Thomas Holste
Thomas Holste
StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)StrataFrame User (370 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Edhy,

thanks a lot for your help. Now it works properly.

Best regards

Thomas
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Thomas,

Glad it worked for you!!!

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search