OK, this one has me stumped. I am reading XML into a Dataset and then
binding values to a label control. When displayed on the screen, the label
control has the correct value in it.
When I read back the value from the label control, the text field is "".
But ONLY if the label field is on a tab in a tab control. If the label
field is on the main form, the code works!
Here's my example code:
------------------------
Public dsConfig As New DataSet
Try
dsConfig.ReadXml(AppPath() & "default.config.xml")
' OK, we're attached to our file, let's put the values into the label
control
lblPath.DataBindings.Add("text", dsConfig, "Config.ConfigPath")
lblConfig.DataBindings.Add("text", dsConfig, "Config.ConfigFile")
Catch ex As Exception
MsgBox("Error Loading default configuration", MsgBoxStyle.OKOnly +
MsgBoxStyle.Critical, "Critical error")
Me.Close() ' get the heck out!
End Try
---------------------------------
So, if lblPath or lblConfig is on a tab, then lblPath.Text is empty. If it
is on the main form, it has the proper value from the XML. Either way, it
displays properly on the form
Any solutions?
Thanks in advance,
Tom 1 1755
"Tom Scales" <tj******@gmail.com> wrote in message
news:sr********************@tornado.tampabay.rr.co m... OK, this one has me stumped. I am reading XML into a Dataset and then binding values to a label control. When displayed on the screen, the label control has the correct value in it.
When I read back the value from the label control, the text field is "".
But ONLY if the label field is on a tab in a tab control. If the label field is on the main form, the code works!
Well, I don't often answer my own questions, but....
Turns out the problem is that the label field is not correctly updated until
the tab is actually shown. Seems like a bug to me, but easy to work around.
Tom This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: HAN(removethis)twister |
last post by:
I've tried to create 11 textboxes as variables (not actually visible in
the program, not in Windows Form Designer) and have set DataBindings to
the text properties of the TextBoxes BUT according to...
|
by: jcrouse |
last post by:
Is there a quick and easy way to change the color of a label controls border
from the default black to white?
Thank you,
John
|
by: C Glenn |
last post by:
This is admitedly vague. But so is my understanding of the problem.
I'm using this chunk of code:
retControl.DataBindings.Add(ctrlBinding.PropertyName,DataSource,BindingField);
This resolves...
|
by: PW |
last post by:
Using VS2005 I drag a label control onto my formview.
I set the smart tag custom binding to Eval("qty")*Eval("amount") and then
run the web site. My label will happily display the subtotaled...
|
by: vbnewbie |
last post by:
I am having problems accessing properties of dynamically generated
objects in VB2005. Can someone please help?
In a nutshell:
My app creates an equal number of checkboxes and labels that share the...
|
by: Ralph |
last post by:
Hi
I have small function to generate my form controls:
function buildInput(sType, vValue, vId, sName, sLabel){
var oInput = null;
var oLabel = document.createElement('label');
var oCont =...
|
by: Manoj Mittal |
last post by:
I have created the Dynamic control in asp.net c#
like
for (int i = 1; i <= 5; i++)
{
Label label = new Label();
label.ID = "Label" + i;
label.Text = "Label"+i;
form1.Controls.Add(label);
}
|
by: BobLaughland |
last post by:
Hi There,
I am trying to get some fields to align on a web page, like this,
To:
From:
Subject:
Each of the fields above have a corresponding asp:Textbox control next
to it that I cannot...
|
by: XenReborn |
last post by:
Ok this should be simple.
I made a form, added a combobox (for selecting items to edit, not for updating fields), several textboxes, a few checkboxes etc. On formshow it connects to my database,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |