Re: Type convertsion from string
- From: "Andrus" <kobruleht2@xxxxxx>
- Date: Tue, 16 Oct 2007 16:47:50 +0300
Marc,
Thank you.
If I enter characters to numeric column I get exception "eee is not a valid
value for Decimal." at line
object val = p.Converter.ConvertFromString(ctx, propertyValue);
How to fix ?
Why CanConvertFrom() returns true ?
I want to allow users to add calculated columns to table at runtime.
Is it possible to add new calculated property to object at runtime or is
there any other solution ?
Andrus.
Exception which I got:
System.Exception was unhandled
Message="eee is not a valid value for Decimal."
Source="System"
StackTrace:
at
System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext
context, CultureInfo culture, Object value)
at
System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext
context, String text)
at My.Business.StringConverter.SetValue(Object obj, String
propertyName, String propertyValue)
at
My.Windows.Forms.VirtualGrid`1.OnCellValuePushed(DataGridViewCellValueEventArgs
e)
at System.Windows.Forms.DataGridView.OnCellValuePushed(Int32
columnIndex, Int32 rowIndex, Object value)
at System.Windows.Forms.DataGridViewCell.SetValue(Int32 rowIndex,
Object value)
at
System.Windows.Forms.DataGridView.PushFormattedValue(DataGridViewCell&
dataGridViewCurrentCell, Object formattedValue, Exception& exception)
at System.Windows.Forms.DataGridView.CommitEdit(DataGridViewCell&
dataGridViewCurrentCell, DataGridViewDataErrorContexts context,
DataGridViewValidateCellInternal validateCell, Boolean fireCellLeave,
Boolean fireCellEnter, Boolean fireRowLeave, Boolean fireRowEnter, Boolean
fireLeave)
at
System.Windows.Forms.DataGridView.EndEdit(DataGridViewDataErrorContexts
context, DataGridViewValidateCellInternal validateCell, Boolean
fireCellLeave, Boolean fireCellEnter, Boolean fireRowLeave, Boolean
fireRowEnter, Boolean fireLeave, Boolean keepFocus, Boolean
resetCurrentCell, Boolean resetAnchorCell)
at System.Windows.Forms.DataGridView.CommitEditForOperation(Int32
columnIndex, Int32 rowIndex, Boolean forCurrentCellChange)
at System.Windows.Forms.DataGridView.ScrollIntoView(Int32
columnIndex, Int32 rowIndex, Boolean forCurrentCellChange)
at System.Windows.Forms.DataGridView.TabToNextCell()
at System.Windows.Forms.DataGridView.ProcessTabKey(Keys keyData)
at System.Windows.Forms.DataGridView.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
....
.
- Follow-Ups:
- Re: Type convertsion from string
- From: Marc Gravell
- Re: Type convertsion from string
- References:
- Type convertsion from string
- From: Andrus
- Re: Type convertsion from string
- From: Jon Skeet [C# MVP]
- Re: Type convertsion from string
- From: Andrus
- Re: Type convertsion from string
- From: Marc Gravell
- Re: Type convertsion from string
- From: Andrus
- Re: Type convertsion from string
- From: Marc Gravell
- Type convertsion from string
- Prev by Date: Re: Handling locked files with C#
- Next by Date: import/export of forms, possible?
- Previous by thread: Re: Type convertsion from string
- Next by thread: Re: Type convertsion from string
- Index(es):
Relevant Pages
|