I've had a customer submit a bug report where setting the value on a track bar caused a crash. Here is the stack trace:
Normal 0 false false false EN-US X-NONE X-NONE System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinEditors.UltraTrackBar.set_Value(Int32 value) at MachineServiceForm.set_MachineFillPercentTrackBarValue(Int32 value) in C:\Projects\MachineServiceForm.cs:line 390 at Controllers.MachineServiceFormController.SyncServiceRulesWithView() in
What would cause this, the property Value is an Int32 { get; set; } , not possible to throw a null reference?
Hello,
This exception could occur if you are trying to assign Value to UltraTracBar which is not initialized or you are bind UltraTrackBar to an object, which could accept null as value.
What is the code, which contains line 390 of MachineServiceForm.cs ? Does your application is multi-threading application ? Does UltraTarckBar is in a custom Control ?
I am waiting for your feedback.
Yes, the application is multi-threaded, but this code is always called in the UI thread. The data source cannot be null either. This is the code from MachineServiceForm where the track bar property is being set from the controller. As you can see the data type of the property is a simple int.
public int MachineFillPercentTrackBarValue {
get { return (int)this.trkMachineFillPercent.Value ; }
set { this.trkMachineFillPercent.Value = value ; }
}
The code in the controller is very simple, here it in from SyncServiceRulesWithView(): view .MachineFillPercentTrackBarValue = this.machineFillPercent; <- this is a member class variable: private int machineFillPercent = 50; thanks
view
.MachineFillPercentTrackBarValue = this.machineFillPercent; <- this is a member class variable: private int machineFillPercent = 50;
private
int machineFillPercent = 50;
thanks
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this issue?
Thank you for using Infragistics Components.