示例#1
0
        private void BindTeam()
        {
            cboxTeam.Items.Clear();
            cboxTeam2.Items.Clear();
            teamMemList.Clear();
            var list = GlobalVariable.GetTeamChatList();

            foreach (ChatStore item in list)
            {
                cboxTeam.Items.Add(item);
                cboxTeam2.Items.Add(item);
            }
            cboxTeam.DisplayMember  = "ChatDisplayName";
            cboxTeam.ValueMember    = "ChatUserName";
            cboxTeam2.DisplayMember = "ChatDisplayName";
            cboxTeam2.ValueMember   = "ChatUserName";
            if (cboxTeam.Items.Count > 0)
            {
                cboxTeam.SelectedIndex = 0;
            }
            if (cboxTeam2.Items.Count > 0)
            {
                cboxTeam2.SelectedIndex = 0;
            }
        }