Using FontComboBox in PropertyGrid

I am trying to replace the FontStyle Family property to display a list of Fonts using the FontComboBox instead of the standard string box. Can somebody help as I am always getting one item (none) in my drop-down list and a list of all FontComboBox properties as sub-properties?

3 Replies

AD Administrator Syncfusion Team August 16, 2004 07:42 PM UTC

Hi Francois, Please follow the code below to achieve this : this.propgrid.SelectedObject = new FontComboBoxInPropertyGrid(); public class FontComboBoxInPropertyGrid { bool _cb; [Editor(typeof(FontComboBoxInPropertyGridEditor),typeof(System.Drawing.Design.UITypeEditor))] public bool Cb { get{return _cb;} set{_cb=value;} } } public class FontComboBoxInPropertyGridEditor : UITypeEditor { public override bool GetPaintValueSupported(ITypeDescriptorContext context) { return true; } public override void PaintValue(PaintValueEventArgs e) { // Have your custom method here to draw the FontComboBox } } Please let me know if you need further assiatance. Thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


FR Francois R. Renaud August 17, 2004 12:26 AM UTC

Thank you for the advice. I was trying to draw the FontListBox directly in UIEditor EditValue instead of using the method DropDownControl: FontListBox flb = new FontListBox(); edSvc.DropDownControl(flb);


AD Administrator Syncfusion Team August 17, 2004 08:25 PM UTC

Hi Francois, Thanks for the update. I would appreciate if you could create a Direct-Trac incident in this regard, and provide us with the following information : 1. A test sample that shows your implementation of this. 2. Does this "FontStyle Family property" that you are referring to belong to a custom control that you have created ? Regards, Guru Patwal Syncfusion, Inc.

Loader.
Up arrow icon