private List<GalleryItem> checkedItems = new List<GalleryItem>();
private void galleryControl_Gallery_ContextButtonCustomize(System.Object sender, DevExpress.XtraBars.Ribbon.Gallery.GalleryContextButtonCustomizeEventArgs e)
{
CheckContextButton checkItem = e.Item as CheckContextButton;
if (checkItem != null)
checkItem.Checked = checkedItems.Contains(e.GalleryItem);
}
private void galleryControl_Gallery_ContextButtonClick(object sender, DevExpress.Utils.ContextItemClickEventArgs e)
{
CheckContextButton checkItem = e.Item as CheckContextButton;
GalleryItem item = (GalleryItem)e.DataItem;
if (checkItem != null)
{
if ((checkItem.Checked && !checkedItems.Contains(item)))
checkedItems.Add(item);
else if ((!checkItem.Checked && checkedItems.Contains(item)))
checkedItems.Remove(item);
}
}
GalleryControl内CheckContextButton复选框多选
最新推荐文章于 2023-08-09 14:41:42 发布