Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Databinding a Checkedlistbox
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Databinding a Checkedlistbox
Divers
Thread ID:
00785203
Message ID:
00785203
Vues:
36
Hi guys,
How do I databind a checked listbox.

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;ichkListBox.SetItemChecked(i,true);


I have this Checkedlistbox on a TAB on page 2 . Is there a refresh problem ??

TIA
Fred Besterwitch, MCP

The harder you work. The luckier you get.
Répondre
Fil
Voir

Click here to load this message in the networking platform