unable to update cell value in an Ultragrid programatically

Posted by MBeynon on 25-Mar-2013 07:02

Hi,

I'm trying to update a cell in my grid programmitacaly but after calling update the value has gone from the cell.

If I don't call update the value is visible in the cell but I get the little pencil edit icon.

The bindingsoure is attached to a query handle and I've set the update mode to OnUpdate.

      bindingSource1:HANDLE    = lvhQuery.


      ultraGrid1:UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode:OnUpdate.



METHOD PRIVATE VOID ultraGrid1_InitializeRow(..........


    DEFINE VARIABLE lvrRow    AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.

   
    IF NOT e:ROW:IsDataRow THEN
      RETURN.
     
    lvrRow = e:ROW.


      IF UNBOX(lvrRow:Cells["RequestedQty"]:Value) > UNBOX(lvrRow:Cells["RemainingQty"]:Value) THEN
      DO:


        lvrRow:Cells["ColourValue"]:value = lvcRedColour.

        lvrRow:Update().


      END.

Thanks in advance,

Mark.

All Replies

Posted by MBeynon on 25-Mar-2013 08:39

Sorted this by re-using my open query to test the required values and update the data source directly.

Obvious really!! :-)

Posted by jquerijero on 06-Aug-2013 17:15

Is there a reason why you didn't just update ColourValue inside the AfterRowFill event of FILL() or FOR EACH whichever you use to build the temp-table? Something like; IF tt.RequestedQty > tt.RemainingQty THEN  tt.ColourValue = lvcRedColour.

Posted by jquerijero on 07-Aug-2013 12:23

By the way, I think what you're originally experiencing is bug. The UltraGrid doesn't display the new value correctly if you update the Value property of the cell then calling Update().

This thread is closed