Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Databinding Checkedlistbox - Right Code this Time
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00785205
Message ID:
00785219
Vues:
11
Hi Fred,

Check out the link below to a thread about your same issue. There is a bug in .NET that is causing this behavior but the link provides some work-arounds

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=055801c2f949%24da221230%242f01280a%40phx.gbl&rnum=8&prev=/groups%3Fq%3DSetItemChecked%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D055801c2f949%2524da221230%25242f01280a%2540phx.gbl%26rnum%3D8


>sorry guys,
>I got the code wrong the first time
>
>I have the foll code
>
>//I populate the CheckedListbox with the users table
>
>chkListBox.DataSource = ds.Tables["Users"].DefaultView
>chkListBox.DisplayMember = ds.Tables["Users"].Columns[1].ToString()
>chkListBox.ValueMember = ds.Tables["Users"].Columns[0].ToString()
>
>This Display the all users in the Checked List Box without any problem.
>
>//Now I have a Job which is restricted to only certain users. If I have say
>//10 users only 2 or 3 can be selected to view this job. The users goes and
>//selects the users they want. I have a Job_Users table which has Job_Id &
>// User_ID. Now I want to Bind this User_Id to the Checked Box Table
>
>//I tried
>
>ChkListBox.DataBinding.Add(new Binding("SelectedValue",ds,"Job_Managers.user_id")
>
>Nothing Happens.
>
>Do we have to manually check each item ?
>Even when I try(the code below) to manually check each item nothing happens
>
>for (int i =0;i>chkListBox.SetItemChecked(i,true);
>
>
>I have this Checkedlistbox on a TAB on page 2 . Is there a refresh problem ??
>
>TIA
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform