Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird CheckBox and TabPage Behavior
Message
 
To
07/10/2010 20:24:31
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01484316
Message ID:
01491636
Views:
31
Bill,
I've just resurfaced after a crazy couple of months and noticed that your substring functions for the check boxes are starting the name substring at 8 rather than 7. I suspect that's your binding problem, because the substring is zero-based. You have it correct in the textbox binding code. Sorry I didn't catch that the first time, when it would have been more helpful.
Linda

>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?
Linda Harmes
HiBit Technologies, Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform