We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

combobox font

In OnQueryCellInfo(), some cells are set : e.style.font.underline = true In OnCurrentCellShowingDropDown(), the combobox cell list is populated at the runtime, however, all the item list was underlined. Is possible to remove those underline for the list items in the combo box? Thanks Hui

3 Replies

AD Administrator Syncfusion Team April 24, 2006 07:11 AM UTC

Hi Hui, Yes, it is possible to avoid underline for the list items by setting the font style to the cr.ListBoxPart.Font in the CurrentCellShowingDropDown. Below is a code snippet. GridCurrentCell cc = grid.CurrentCell; GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer; cr.ListBoxPart.Font = new System.Drawing.Font(cr.ListBoxPart.Font, System.Drawing.FontStyle.Regular); cr.ListBoxPart.DataSource = this.sourceList; Regards, Calvin.


HZ Hui Zhong April 24, 2006 01:59 PM UTC

Thanks very much Calvin. It worked. However, after the item is selected from the combobox list, and the dropdown is disappear, I hope the font of the selected item is shown as underlined. how to do that? Hui >Hi Hui, > >Yes, it is possible to avoid underline for the list items by setting the font style to the cr.ListBoxPart.Font in the CurrentCellShowingDropDown. Below is a code snippet. > >GridCurrentCell cc = grid.CurrentCell; >GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer; > >cr.ListBoxPart.Font = new System.Drawing.Font(cr.ListBoxPart.Font, System.Drawing.FontStyle.Regular); >cr.ListBoxPart.DataSource = this.sourceList; > > >Regards, >Calvin.


HZ Hui Zhong April 24, 2006 02:05 PM UTC

I already figured it out. Thanks Hui >Thanks very much Calvin. It worked. >However, after the item is selected from the combobox list, and the dropdown is disappear, I hope the font of the selected item is shown as underlined. how to do that? > >Hui > >>Hi Hui, >> >>Yes, it is possible to avoid underline for the list items by setting the font style to the cr.ListBoxPart.Font in the CurrentCellShowingDropDown. Below is a code snippet. >> >>GridCurrentCell cc = grid.CurrentCell; >>GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer; >> >>cr.ListBoxPart.Font = new System.Drawing.Font(cr.ListBoxPart.Font, System.Drawing.FontStyle.Regular); >>cr.ListBoxPart.DataSource = this.sourceList; >> >> >>Regards, >>Calvin.

Loader.
Live Chat Icon For mobile
Up arrow icon