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

Underline CurrencyCell

Hi all, I''m trying to underline the text in a currencycell but setting GridStyleInfo.Font.Underline = true is not working. When you click on the cell to edit it, it will show it as underlined, but when focus leaves that cell the text is no longer underlined. Is there a way to fix this? TIA, Cole

4 Replies

AD Administrator Syncfusion Team May 26, 2004 02:19 PM UTC

Try setting it dynamically in PrepareViewStyleInfo.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	if(e.RowIndex == cc.RowIndex && e.ColIndex == cc.ColIndex)
		e.Style.Font.Underline = true;

CS Cole Shelton May 26, 2004 03:20 PM UTC

Clay, I had tried this before, but tried at again at your suggestion. Still does not work though. Cole

AD Administrator Syncfusion Team May 26, 2004 04:00 PM UTC

I am sorry, I misread, thinking you wanted to underline the CurrentCell instead of a CurrencyCell. In the CellTypes\Currency sample, I added style.Font.Underline = true. On first appearance, it does look like the underline is not being shown on statically drawn cells. But if you drag the row heights a little larger, I do in fact see the underline. So, is this what is happening in your case? If so, will slightly enlarging the rowheights work for you? Adding this line in that sample makes the underline should up for me. private void Form1_Load(object sender, System.EventArgs e) { this.gridControl1.DefaultRowHeight += 1; }

CS Cole Shelton May 26, 2004 04:43 PM UTC

Clay, That fixed my problem, Thanks a million. Cole

Live Chat Icon For mobile
Up arrow icon