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
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.