public static int GetCheckedItemsBitwiseAddFlag(this BaseCheckedListBoxControl chkl, string name)
        {
            var flags = 0;

            FieldInfo    fi = null;
            PropertyInfo pi = null;

            if (chkl.ItemCount > 0)
            {
                fi = chkl.GetItem(0).GetType().GetField(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
                pi = chkl.GetItem(0).GetType().GetProperty(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
            }

            if (fi != null)
            {
                foreach (var item in chkl.CheckedItems)
                {
                    flags = BitwiseHelper.AddFlag(flags, ConvertHelper.ToInt32(fi.GetValue(item)));
                }
            }

            if (pi != null)
            {
                foreach (var item in chkl.CheckedItems)
                {
                    flags = BitwiseHelper.AddFlag(flags, ConvertHelper.ToInt32(pi.GetValue(item, null)));
                }
            }

            if (fi == null && pi == null && chkl.GetItem(0) is DataRowView)
            {
                foreach (var item in chkl.CheckedItems)
                {
                    flags = BitwiseHelper.AddFlag(flags, ConvertHelper.ToInt32(((DataRowView)item)[name]));
                }
            }

            return(flags);
        }
        public static void SetCheckedItemsBitwiseHasFlag(this BaseCheckedListBoxControl chkl, string name, int flags)
        {
            FieldInfo    fi = null;
            PropertyInfo pi = null;

            if (chkl.ItemCount > 0)
            {
                fi = chkl.GetItem(0).GetType().GetField(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
                pi = chkl.GetItem(0).GetType().GetProperty(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
            }


            if (fi != null)
            {
                for (var i = 0; i < chkl.ItemCount; i++)
                {
                    chkl.SetItemChecked(i, BitwiseHelper.HasFlag(flags, ConvertHelper.ToInt32(fi.GetValue(chkl.GetItem(i)))));
                }
            }

            if (pi != null)
            {
                for (var i = 0; i < chkl.ItemCount; i++)
                {
                    chkl.SetItemChecked(i, BitwiseHelper.HasFlag(flags, ConvertHelper.ToInt32(pi.GetValue(chkl.GetItem(i), null))));
                }
            }

            if (fi == null && pi == null && chkl.GetItem(0) is DataRowView)
            {
                for (var i = 0; i < chkl.ItemCount; i++)
                {
                    chkl.SetItemChecked(i, BitwiseHelper.HasFlag(flags, ConvertHelper.ToInt32(((DataRowView)chkl.GetItem(i))[name])));
                }
            }
        }