i am fairly new at windows forms and i am getting this error when resetting my data datagrid. does anyone have any experience with this error message?
System.NotSupportedException: Culture "en" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
thank you,
-jim
AD
Administrator
Syncfusion Team
July 29, 2003 03:56 PM UTC
Is this with an Essential Grid you are getting this message?
Can you post a little sample project showing what you are doing?
AD
Administrator
Syncfusion Team
July 29, 2003 04:07 PM UTC
yes, this is essential grid. i don't get the error when using the basic datagrid.
if i remove this line from my login screen
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
everything seems to work fine. but once i add that line back in, i get the following stack trace
System.NotSupportedException: Culture "en" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
at System.Globalization.CultureInfo.CheckNeutral(CultureInfo culture)
at System.Globalization.CultureInfo.get_NumberFormat()
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.OnValidate()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Validate()
catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Validate() in :line 0
System.NotSupportedException: Culture "en" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Validate()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges(Boolean closeDropDown)
System.NotSupportedException: Culture "en" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges(Boolean closeDropDown)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Deactivate(Boolean discardChanges)
System.NotSupportedException: Culture "en" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Deactivate(Boolean discardChanges)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options, Boolean discardChanges)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options)
at Syncfusion.Windows.Forms.Grid.GridInternal.GridSelectCellsMouseController.MouseDown(MouseEventArgs e)
at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseDown(MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControllMouseControllerDispatcher.ScrollControlBeforeMouseDown(Object sender, CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.OnScrollControlMouseDown(CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnScrollControlMouseDown(CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.RaiseCancelMouseEvent(MouseEventArgs e, CancelMouseDelegate d)
System.NotSupportedException: Culture "en" is a neutral culture. It can not be used in formatting and parsing and therefore cannot be set as the thread's current culture.
at System.Globalization.CultureInfo.CheckNeutral(CultureInfo culture)
at System.Globalization.CultureInfo.get_NumberFormat()
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.OnValidate()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Validate()
catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges(Boolean closeDropDown) in :line 0
catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Deactivate(Boolean discardChanges) in :line 0
catched at Syncfusion.Windows.Forms.ScrollControl.RaiseCancelMouseEvent(MouseEventArgs e, CancelMouseDelegate d) in :line 0
catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Validate() in :line 0
any ideas?
thank you.
AD
Administrator
Syncfusion Team
July 30, 2003 06:22 AM UTC
The grid uses the CultureInfo to do formatting for cell values like integers or doubles or ...
And specifying "en" without a Country\Region does not support formatting.
So, if you specify the Country as well, "en-US", then the formatting is permitted, and you will not get the exceptions.
Another option is to use System.Globalization.CultureInfo.InvariantCulture. It is a type of culture that is culture-insensitive. It is associated with the English language but not with a country or region.
AD
Administrator
Syncfusion Team
July 30, 2003 02:10 PM UTC
thank you, clay, it worked just like you said.