Hi,
I added a GridRowEditTemplete and it worked just fine. In one situation. i need to programmatically change the text value for the GridCellProxy control. For example:
I have the user select the OpenFileDialog. I want to store the directory path to the GridCellProxy control:
Me.ugcpImageLocation.Text = "c:\test\steve.txt"
This clearly does not work. Is there another way?
Best, Steve
Hi Steve,
I'm not sure I follow you. What exactly isn't working? I see no reason why you should not be able to set the Text property on one of the proxy controls.
Hi Mike,
This does not work. If you type into the control it works fine. But setting the .text property does nothing.
I'm using NetAdvantage 2010.2.
Sorry About that. Here you go.
In the sample you posted here, nothing is calculated at all, whether you use the RowEditTemplate or not, because there is no UltraCalcManager component on the form.
Once I added one, it works fine for me. When I click on the AddNewRow, the RowEditTemplate pops up. If I then type a number in the first field and tab out of that field, the proxy for Column 2 immediately updates with the number I entered.
Hello,
I did the calulation and it is working fine.
However if I add a Summary Row on it, It is not doing the Calculation on the Formula Column.
I am attaching the Sample Application.
In the Application, I have two Grids Grid1 and Grid2
Grid1 has 2 summary columns for Column0 and Column1
Grid2 has 3 Summary Columns For Column0, Column1 and Column2
In both the Grid Column2 is a Sum of Column1 and Column0.
However when I want to add a new row Grid1 shows the sum of columns 0 and 1
Whereas Grid2 doesnot.
Kindly can you explain why is this happening?
:)
Regards
I've been looking into this issue and it turns out to be pretty complex.
To understand what's happening here, you have to understand some of the deep inner working for the grid and the CalcManager.
In simplest terms, the problem here is caused by the FormulaRowSourceIndex. This property on the grid's Override determines how the CalcManager deal with grid rows. It determines whether visible rows are included in a summary, for one thing, and also how relative references are handled.
By default, this property resolved to VisibleIndex, meaning that invisible rows don't count and are not calculated.
Obviously, the TemplateAddRow in this case is visible, but since it's a fixed add row, it has no meaningful VisibleIndex, so it is treated as not visible until it is committed and becomes a real row.
This begs the question of why the presence of a summary matters. The reason for this is also complicated, but basically, it's just a fluke of how the grid is implemented. In fact, the column in the Fixed AddRow probably should not be calculated when there is no summary, since it still has no meaningful VisibleIndex. It is getting calculated because when there is no summary, the calculations in the grid are deferred so that visible rows are calculated first and this goes directly to the UIElements on the screen.
So... if we were to "fix" this bug, the fix would be to stop the grid from calculating the column in the fixed addrow all the time.
That's obviously not what you want and such a fix would not benefit anyone, so we've decided not to do that unless there's a good reason.
In the mean time, you can very easily work around the issue by setting the FormulaRowSourceIndex to anything other than VisibleIndex.
ov.FormulaRowIndexSource = FormulaRowIndexSource.RowIndex
Hello Mike,
I added the above code. Now it works fine on the template row. However it stops working on the existing rows...
SO now i add on the template row and it shows the running total. After adding and saving it to the database and next time when i open it shows the total correctly, however it does not do the running total on the existing row.
I'm not sure I understand what you mean. I tried this out with the sample you attached here and everything appears to be working correctly for me when I set the FormulaRowSourceIndex to RowIndex.