Hi,
I am new to WinGrid and ultraCalcManager.
I am developing a windwos application in VB.net and using the grid in one of my forms. There are 4 columns in the grid. User enters the amount manually and i would like WinGrid calculates the VAT and the total by using the formula. i have added UltraCalcManager to the form and also writen my math function which is a normal adding.
when i set the grid datasource, i get an error message "NullReferenceException was unhandlled". if i set CalcFrequnecy to Manual, the error message goes away and formula does not work. If I set it to the other options, it throws the above error message.
Could you please help in this matter?
Many thanks
Kamal
You should create a small sample project that demonstrates this error and Submit an incident to Infragistics Developer Support
I set the Formula to the column "Total" and the formula is "Amount + Vat". Amount and Vat are two columns in the table and I set the datasource in my code.
this is the StackTrace of the error:
at Infragistics.Win.UltraWinGrid.RefCellCollection.RefCellCollectionEnumerator.MoveNext() at Infragistics.Win.CalcEngine.UltraCalcEngine.RecalcReferences(IUltraCalcReference reference) at Infragistics.Win.CalcEngine.UltraCalcEngine.ProcessTopologicalEvent(QueueInfo item) at Infragistics.Win.CalcEngine.UltraCalcEngine.CleanTopologicalEventQueue(Int64 ticks) at Infragistics.Win.CalcEngine.UltraCalcEngine.Recalc(Int64 ticks) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalcInternal(Int64 ticks) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalc(Int64 millis) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.onTimerTick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[ commandLine) at Mobex.My.MyApplication.Main(String[ Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[ args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[ args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
thanks for your help.
Hi Kamal,
I beleive you can add formulas to bound columns. But the column really can't be editable by the user, since the calculated value will overwrite anything the user types into the cell.
The easiest way to add a formula to a grid column is to set the Formula property on the column. You cannot apply a formula to a single cell. And you must have an UltraCalcManager component on the form with the grid.
Hi Mike,
Thanks for your reply. While I am setting up a demo application, could you tell me what is the easiest way to add formula to a cell please? Can I add a formula to a bind column? or should it be unbound column?
Thanks,
HI Kamal,
There's really not enough here for me to go on. Perhaps your best option is to create a small sample project which demonstrates the error and Submit an incident to Infragistics Developer Support.