DataGridColorColumn: Hide HEX Value

Editors for WPF Forum

Posted 12 years ago by MCRXB
Avatar
Hi,

It seems that there are properties to hide most parts of the control (color preview, checkbox, drop down arrow) but not the HEX value. Is there a simple way to manage this through a template?

Thanks

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

I'm not sure what you mean. Do you want to hide the actual data entry portion of the control?


Actipro Software Support

Posted 12 years ago by MCRXB
Avatar
Yes, I'd like to have the control display: Checkbox, Color Preview, Drop Down Arrow. Is that possible?
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

We don't currently have an option to hide the "text" portion, which is actually a part group. We've added one for the next maintenance release though.

In the meantime, you'd have to use a custom class like:
public class MyColorEditBox : ColorEditBox {
        protected override void GenerateDefaultItems(SlottedItemCollection defaultItems) {
            if (defaultItems == null)
                throw new ArgumentNullException("defaultItems");

            base.GenerateDefaultItems(defaultItems);

            for (int i = defaultItems.Count - 1; i >= 0; i--) {
                if (defaultItems[i] is ColorPartGroup)
                    defaultItems.RemoveAt(i);
            }
        }
}


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.