Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CheckedListBox - Checking Multiple Items
Message
 
À
18/02/2010 23:03:46
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01449851
Message ID:
01449861
Vues:
23
That would cause it to continue to loop thru the inner loop after the item is found.



>Take the "break;" out.
>Tim
>
>>I have a CheckedListBox with 75 items in it. I then get a DS of 5 items. For each of the 5 items, I want to check the item in the CheckListBox. I'm searching for items by their caption.
>>
>>Only the first one is being checked.
>>
>>
>>private void _LoadContactFilters()
>>{
>>    SqlParameter pContactId = new SqlParameter("@ContactId", _Contact.RecordId);
>>    List<DbParameter> Params = new List<DbParameter>();
>>    Params.Add(pContactId);
>>
>>    DataSet dsContactFilters = csMain.DataProcs.ExecuteQuery("lb_GetFiltersForContact", Params, CommandType.StoredProcedure);
>>    if (dsContactFilters.Tables[0].Rows.Count > 0)
>>    {
>>        foreach (DataRow Row in dsContactFilters.Tables[0].Rows)
>>        {
>>            string FilterCaption = dsContactFilters.Tables[0].Rows[0]["Caption"].ToString();
>>
>>            for (int i = 0; i < chklFilters.Items.Count; i++)
>>            {
>>                if (chklFilters.Items[i].ToString() == FilterCaption)
>>                {
>>                    chklFilters.SetItemChecked(i, true);
>>                    break;
>>                }
>>            }
>>        }
>>    }
>>}
>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform