本帖最后由 feitianchong 于 2021-8-10 14:11 编辑
private void UserMenu_Load(object sender, EventArgs e)
{
// SearchData();
string[] strMenu = { "11","22","33" ,"44"};
PopListGroup grpSel = new PopListGroup();
for (int i = 0; i < 5; i++)
{
PopListGroup grpContainer = new PopListGroup();
grpContainer.TitleVisible = true;
grpContainer.Title ="Title"+ i.ToString();
for (int j = 0; j < 5; j++)
{
PopListItem ivi = new PopListItem();
ivi.Value = i.ToString()+j.ToString();
ivi.Text = j.ToString();
grpContainer.Items.Add(ivi);
if (strMenu.Contains(ivi.Value))
{
grpSel.Items.Add(ivi);
}
}
popList1.Groups.Add(grpContainer);
}
popList1.ClearSelection();
foreach (PopListItem item in grpSel.Items)
{
popList1.SetSelections(item);
}
popList1.ShowDialog();
}
|