Hi
First of all. Any way that does what is required without errors is 'a good way '. Although some ways to do itmay be more appropriate depending on circumstance.
Since you asked about a condition where a value is >1, then when value is >2, I think you want to have a variable value used in the calculated result. If so, then here is some code that shows one of the ways (other ways are available at extra cost) that this can be done. It uses an extra column (which can be hidden) to hold the value to be used in condition. The results are dynamic, so when the TextBox is changed, the results are auto generated.
All of this may be of no use to you, if so, just crumple it up and throw in the trash.
' Form1 with
' DataGridView1
' TextBox1
Option Strict On
Option Explicit On
Public Class Form1
Dim dt As New DataTable("freddy")
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
With dt
.Columns.Add("One", GetType(Integer))
.Columns.Add("Limit", GetType(Integer))
.Columns.Add("Result", GetType(Integer), "One > Limit")
Dim r As New Random
For i As Integer = 0 To 99
.Rows.Add(r.Next(-5, 5))
Next
End With
DataGridView1.DataSource = dt
TextBox1.Text = "2"
' this line will hide the Limit
' column (uncomment to see)
' DataGridView1.Columns("Limit").Visible = False
End Sub
Function GetLimit() As String
Dim v As Integer = 0
If Integer.TryParse(TextBox1.Text, v) Then Return TextBox1.Text
Return "9999999"
End Function
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
Dim v As String = GetLimit()
For i As Integer = 0 To dt.Rows.Count - 1
dt(i)("Limit") = v
Next
End Sub
End Class