Issue with Inactive DataControl Fields

Post

Posted
Rating:
#1 (In Topic #1402)
Avatar
Trainee
Hi,
I’m experiencing an issue with DataControl fields in my project. Even though the Field properties are correctly assigned, the DataControl fields remain inactive. Has anyone encountered a similar problem? Could I be missing some configuration or approaching data binding incorrectly?

Code

Public Sub Form_Open()

                Dim $con As New Connection
                Try $con.Close()             ' Close the connection. The try allows it to fail without error
                $con.Type = "sqlite3"        ' Defines the type of connection
                $con.Host = Application.path ' Host will be the path where the sqlite db file is
                $con.Name = "klienci.db"    ' database name is the name of the database file
                $con.Open                 ' We activate and open the connection, the try is to allow an error

                Print "Connected? : " & $con.Opened ' It will return TRUE or FALSE depending on whether "try $con.Open()" was successful in "conectarodbc()"
                DataSource1.Connection = $con
                DataBrowser1.Labels = ["ID", "IMIĘ", "NAZWISKO", "EMAIL", "TELEFON", "ADRES", "DATA REJ.", "STATUS", "NOTATKI"]
                DataBrowser1.Update
End

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
 Looks like a layout problem

Post a copy of the form so we can see how you have laid out the text controls.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Trainee
 OK

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’
 no i meant a copy of the .form file not a picture of it.
(you can make it into a .zip and add it to post)

most likely you have set "Arrangement" on  the form so it is trying to auto-position/size things.

If Arrangement property is set then you must do some other things like place the Label/Textbox pairs into containers (Panel/HBox's)

Or do not set the form Arrangement property and make it non-resizable window

if you post the actual from i could help with it's layout.
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Trainee
Ok, sorry  :D
Thanks for Your help.

EDIT:
New form, new DB, same problem. Label1 + Data Control1 are in container.  etc. Some fields DataControl are invisible.

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’
 Sorry i cannot find the bug.
(I was wrong about it being a layout issue)

With no database to load i find ALL the DataControl boxes are hidden.

Maybe it's a problem with the Field names?

can you send a piece of the database to test with?
Online now: No Back to the top

Post

Posted
Rating:
#7
Guru
BruceSteers is in the usergroup ‘Guru’
An alternative may be to use the DataBrowser.Editable property so you can just edit the items in the browser and not have the DataControls at all.
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Trainee
Ok, db uploaded. 2 diffrent db. Same problem.

BruceSteers said

An alternative may be to use the DataBrowser.Editable property so you can just edit the items in the browser and not have the DataControls at all.
 Yea, maybe its good idea, but problem not solved. Thanks…


EDIT:small
From Gambas Software Farm, demonstrate program Database Editor. There is a small info:
' Use Main To start up this program because there Is a bug In gambas that
' causes data-bound controls (e.g.DataCombo) to misbehave if connection is
' set to a DataSource after the controls have been already initialized.
' This means that creating the connection in Form_Open() is too late.
:idea:  :idea:  :idea:

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#9
Guru
BruceSteers is in the usergroup ‘Guru’

LeszekK said

Ok, db uploaded. 2 diffrent db. Same problem.

BruceSteers said

An alternative may be to use the DataBrowser.Editable property so you can just edit the items in the browser and not have the DataControls at all.
 Yea, maybe its good idea, but problem not solved. Thanks…


EDIT:small
From Gambas Software Farm, demonstrate program Database Editor. There is a small info:
' Use Main To start up this program because there Is a bug In gambas that
' causes data-bound controls (e.g.DataCombo) to misbehave if connection is
' set to a DataSource after the controls have been already initialized.
' This means that creating the connection in Form_Open() is too late.
:idea:  :idea:  :idea:

Aah i see

Maybe try opening connection in _new() instead of Form_Open()

Public Sub _new()

End
Online now: No Back to the top

Post

Posted
Rating:
#10
Guru
BruceSteers is in the usergroup ‘Guru’
 What version of gambas are you using?

I have 3.20 and now i can test with your example db file I do not get any problems

So i would say your approach is just fine.

have you tried a different gtk theme? or using qt instead of gtk to see if it's different?

Image

(Click to enlarge)

Online now: No Back to the top
1 guest and 0 members have just viewed this.