User (Old forums)MemberDecember 22, 2006 at 1:19 pmPost count: 23064
I have a Grid that has a mostly bound columns with a pair of unbound columns, plus several hidden bound columns. It is an order entry screen so what I want to do it have them enter a number into a cell then when that value changes do a couple things, one some logic to say if it is backorder or not, second create a line subtotal, and third update another grid that has # of item subtotals and dollar subtotals.
I am using celldataRowTemplate1QuantityOnOrder.LeavingEdit, which seems to fire when a cell is leaving edit mode (go figure). Here is my code in that Sub:
celldataRowTemplate1QuantityOnOrder.Value = e.NewValue
Dim r As Xceed.Grid.DataRow
Dim count As Decimal
For Each r In GridControl1.DataRows
If r.Cells(“colQuantityOnOrder”).Value <> 0 And Not r.Cells(“colQuantityOnOrder”).Value Is DBNull.Value Then
count = r.Cells(5).Value + count
The first part is trying to fix the problem that my data keeps disappearing. It seems to happen when I try to loop through the values of the column. When I had it set for the wrong column it worked just fine. Second, it seems that only the first line of the Subroutine fires and if it goes into a loop it seems to exit the loop after the first time through, it never hits the “next”.
I am very confused as to what is happening here and any help is appreciated.
Imported from legacy forums. Posted by Douglas (had 1824 views)User (Old forums)MemberDecember 28, 2006 at 3:13 pmPost count: 23064
First, the EditLeft event on the cell may be more suitable for your needs. That is, at the time of this event, the new value IS committed to the cell, thus you would not need to assign the new value to cell, and entering and leaving the edit mode.
Second, you are using the cell template in the event handler(celldataRowTemplate1QuantityOnOrder), instead of the actual cell being edited. Use the sender to get the cell itself, by casting it to a DataCell (if you need the cell).
CType( sender, Xceed.Grid.DataCell )
( ( Xceed.Grid.DataCell )sender);
Third, you should have no problem looping through your DataRows in the handler. If using the EditLeft event does not solve your problem, I suggest you send a sample application reproducing your issue to <a href=”mailto:email@example.com”>support</a>, so we can investigate this further.
Imported from legacy forums. Posted by André (had 3010 views)
- You must be logged in to reply to this topic.