Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
295
UltraGrid Cells not entering Edit Mode After Saving Data
posted

I wrote a similar post on here last October, and having used the information I was given in that thread to solve the same issue, I've been unable to solve the issue this time around.

I have an orders program, where there is a column for entering a payment date, and a checkbox column to mark the order as 'Customer Paid' allowing it to progress to the next stage.

When opening the order to enter the payment date, I'm able to edit both the payment date cell, and the checkbox cell in all of the order lines. If I mark one order line as paid for and leave one unpaid, and save then re-open the order, I am then only able to edit the payment date cell, and not the checkbox cell. 

What is going wrong? Why does saving the data disable it from entering Edit Mode?

This is my code;

Try
  If e.Cell.Column.Key = "PaymentDate" Then
   e.Cell.Row.Cells("Customer_Paid").Activation = Activation.AllowEdit
  End If
Catch ex As Exception
 errorLog(ex)
End Try

Try
  If e.Cell.Column.ToString = "Customer_Paid" Then
   Dim customerPaid As Boolean = Boolean.Parse(e.Cell.Text)

    If customerPaid = True Then
     If IsDBNull(ugProducts.ActiveRow.Cells("PaymentDate").Value) Then
      MsgBox("Please enter a payment date", MsgBoxStyle.OkOnly, "Invalid Date")
       e.Cell.Row.Cells("Customer_Paid").Value = False
       ugProducts.ActiveRow.Appearance.BackColor = Color.White
       ugProducts.ActiveRow.Cells("PaymentDate").Value = DBNull.Value
     Else
       ugProducts.ActiveRow.Appearance.BackColor = Color.LightGreen
       ugProducts.ActiveRow.Cells("Product_Price_Per").Appearance.BackColor = Color.LightGreen
     End If

   e.Cell.Row.Update()

  Else
    ugProducts.ActiveRow.Appearance.BackColor = Color.White
   ugProducts.ActiveRow.Cells("Product_Price_Per").Appearance.BackColor = Color.LightGreen
   ugProducts.ActiveRow.Cells("PaymentDate").Value = DBNull.Value
   Exit Sub
  End If


Else
End If

Catch ex As Exception
errorLog(ex)

End Try

The similar post: http://www.infragistics.com/community/forums/p/107872/508296.aspx#508296