Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Panel/Tab Control Bug?

Status
Not open for further replies.

vwhite

Programmer
Oct 4, 2001
87
AU
Hello,

I have a mysterious problem that is driving me nuts. This has happened to me once before and the last time the problem seemed to resolve itself at some point - but I don't know how.

I have a windows form with a panel control and a tab control with various tab pages, some of which have panel controls on them, all of which have various text boxes, combo boxes etc.

The data is all bound to datasets that are filled by dataadaptors that connect to a database. All of this was working fine, the data from the database was displaying nicely and it was updating back to the database.

Then all of a sudden the data from the one of the datasets would no longer display on the form. However if I move the textbox for example off the panel and place it somewhere else on the form (not on a panel or a tab control)- the data displays fine. The same goes for some of the data sitting on panels on the tab control from just one dataset only (other data is displaying fine)

Is it something to do with the order in which the panels etc are added? I have been using visual studio .net 2003 and have been using the windows designer toolbox to add the controls...

Any help appreciated.

Cheers

....vwhite

"Benefit others. If you cannot benefit others then do them no harm"
- His Holiness Tenzin Gyatso, the 14th Dalai Lama
 
I dont have any solution, I can just say that if you use a tabcontrol the binding will only occur on the tabpage that has or had the focus, I think they do it to save resources. So in the beginning when i opend my form and the first tabpage appeared it looked fine but when i tried to access a textbox's text propertie from code that was on a second tabpage the propetie came up empty allthough the dataset had a value in it. when then clicked on the second tabpage and run the code again it all worked fine. I hope you understand what i am trying to say.

I guess the tabcontrol from .net isnt very good and perhaps you should try a third party one.

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
thanks Chrissie,

I had come accross that other tab control anomaly previously, which I solved by doing a quick flick to the other tabs and back again when saving (if I had data validation etc going on). Probably not the best solution but all I could come up with at the time.

My other problem seems to exist with the panel control as well as the tab control. If I have the text box on the panel control the data does not display, off the panel control the data does display.

I will try to play around a bit more with the order things are added to the form.





....vwhite

"Benefit others. If you cannot benefit others then do them no harm"
- His Holiness Tenzin Gyatso, the 14th Dalai Lama
 
After many wasted days I have now recreated the data adapter and datasets and rebound the data to each control and now it works again…

When I looked into it further it seems that the control was binding but that value is not being transferred to the control

e.g. txtLicenseNo is a control on a panel

Me.daLicense.Fill(DsLicense1, "GW_LICENSES_TBL")
Debug.WriteLine(Me.DsLicense1.Tables("GW_LICENSES_TBL").Rows(0).Item("LAS_LICENSE_NO"))
Debug.WriteLine(Me.txtLicenseNo.DataBindings.Item("Text").BindingMemberInfo.BindingMember)
Debug.WriteLine(Me.txtLicenseNo.Text)


Gives me

30BL000000
GW_LICENSES_TBL.LAS_LICENSE_NO
Nothing

I have found many problems with the tab and panel controls….e.g. the mouse gets stuck within the control, if you delete the panel, the controls within it disappear but are not deleted in the code and many more..

I think I should go look for some 3rd party controls.



....vwhite

"Benefit others. If you cannot benefit others then do them no harm"
- His Holiness Tenzin Gyatso, the 14th Dalai Lama
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top