Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
9919 | Jan 16,2004 09:44 AM UTC | Jan 17,2004 07:24 PM UTC | WinForms | 5 |
![]() |
Tags: GridControl |
private void gridControl1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if(e.ColIndex > 0 && e.RowIndex > 0 && e.Style.CellType == "Currency") { double d = 0; try { d = double.Parse(e.Style.Text, e.Style.CurrencyEdit.NumberFormatInfoObject); } catch{} if( d == 0) { e.Style.CurrencyEdit.PositiveColor = Color.Purple; } } }
>private void gridControl1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) >{ > if(e.ColIndex > 0 && e.RowIndex > 0 && e.Style.CellType == "Currency") > { > double d = 0; > try > { > d = double.Parse(e.Style.Text, e.Style.CurrencyEdit.NumberFormatInfoObject); > } > catch{} > if( d == 0) > { > e.Style.CurrencyEdit.PositiveColor = Color.Purple; > } > } >} >It did not work like you suggested. Everytime you set a Color either Positive, Negative or ForeColor there is a call to a SetControlColor() method in Tools.NumberTextBoxBase resetting the ZeroColor propety always to "Color [ControlText]".
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.