Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weird CheckBox and TabPage Behavior
Message
De
07/10/2010 20:24:31
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01484316
Message ID:
01484436
Vues:
30
Thanks Linda

No, there is no code in any of the methods.
I copped out and and changed the checkboxes to textboxes with Y/N values and changed the bit colums to char and the problem disappeared
It was just taking too long..
I suspect that it had something to do with how I was initializing the bit columns bound to the checkboxes when creating a new row. I searched all over and found no answers so expediency overcame academic curiosity.

I'd still like to know what caused it.



>Here's a weird problem:
>I hope I can explain it clearly.
>
>I have a Win Form with a tab control with 5 pages
>All controls on all pages are bound to one SQL Server table with a lot of columns.
>All seems well with the data handling. All columns are updated properly, and appear properly on the tab pages when the record is selected -
>
>EXCEPT:
>
>If I select a tab page with a checkbox on it, when I exit the paget. I have to exit the form in order to select another record and see the data on the form.
>
>If I select a tab page without a checkbox and exit the page I can select another record and see the data on the form without having to leave the form.
>It seems that exiting a page containing a checkbox is messing up the bindings. In the bebugger, the binding seems to be gone.
>
>I validated this by moving a checkbox on and off a page and got failure and success.
>
>I thought something might be wrong with a particular checkbox so I tried it with several and got the same results.
>
>All the data for the checkboxes shows perfectly and updates perfectly.
>
>
>Here's how I set the bindings
>

> public void SetBindings()
> {
>
> foreach (Control c in tabControlCustomer.Controls)
> {
> foreach (Control d in c.Controls)
> {
> if (d is TextBox)
> {
> int length = d.Name.ToString().Length;
> string columnname = d.Name.ToString().Substring(7, length - 7);
> d.DataBindings.Add(new Binding("Text", customerAccess.ds, "arcust." + columnname));
> continue;
> }
> if (d is CheckBox)
> {
> int length = d.Name.ToString().Length;
> string columnname = d.Name.ToString().Substring(8, length - 8);
> d.DataBindings.Add(new Binding("Checked", customerAccess.ds, "arcust." + columnname));
> continue;
> }
> }
> }
> }
>

>
>Any clues??????????????????
I have gotten odd behavior with check boxes when I want to react to a change in the checked status but I have several tab pages that have check boxes and haven't seen this behavior. I am using the Mere Mortals Framework, so that may change things a bit. Do you have any code in any of the check box methods?
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform