View previous topic :: View next topic |
Author |
Message |
Sherif Abdeen Guest
|
Posted: Sun Feb 19, 2006 9:43 am Post subject: Editing Error |
|
|
Dear,
I assigned UniversalEditbox as an editor to a column. the Binding Field to this column is of decimal type.
the problem is when i entered this column where its value is empty. then leave it without adding any value(i.e leave it empty as it is). the system gives error and the form that contains the virtualtree is closed.
first ,how could solve this problem?
second , which event i could entered to handle this errors and write needed code when the cell value is changhed?
Thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Feb 19, 2006 10:25 pm Post subject: |
|
|
Some details of the error would probably be helpful. A sample project illustrating the problem sent to support@infralution.com would help us resolve the issue even more quickly.
When exceptions occur while setting changes to data back into the data source these are typically caught by virtual tree reported to the debug output window. So it is worthwhile checking this window as well.
You can handle the SetCellValue event (or override the SetValueForCell method) to handle setting data values back into the data source yourself. The following code comes from the DataSet Browser sample:
Code: | private void _virtualTree_SetCellValue(object sender, Infralution.Controls.VirtualTree.SetCellValueEventArgs e)
{
RowBinding binding = _virtualTree.GetRowBinding(e.Row);
if (e.Column == this.colDiscount)
{
// divide the percentage discount column by 100
//
binding.SetCellValue(e.Row, e.Column, Convert.ToDouble(e.OldValue) / 100.0, Convert.ToDouble(e.NewValue) / 100.0);
}
else
{
binding.SetCellValue(e.Row, e.Column, e.OldValue, e.NewValue);
}
} |
_________________ Infralution Support |
|
Back to top |
|
|
Sherif Abdeen Guest
|
Posted: Mon Feb 20, 2006 11:24 am Post subject: |
|
|
Dear,
yes,the SetCellValue event fires only when the value inside the cell is changed.
But if not( i.e. you don't change the value inside the cell) this event will not fire.
so my question what is the event that will be fired if i just enter the cell and leave it without changing its value. Specially if the current cell value=Null.
Thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Feb 20, 2006 9:09 pm Post subject: |
|
|
There is no event fired if nothing is changed. In this case Virtual Tree does not set any value back into the data source. So the error must be originating somewhere else. Again more details of the error you are getting would help as would a sample project. _________________ Infralution Support |
|
Back to top |
|
|
|