imstac73
asked on
Changing value of system data column in datagrid
Hi,
I have a datagridview in my windows form where on load I'm creating an additional column in my datagridview with a checkbox in it. This is for users to be able to select a record and then complete an action on it.
I have added a textbox and a button to my form. I want the user to key in a value in the textbox and when they click the button the system will compare a specific column value for each row in the datagridview to the value in the textbox. If the column value is less than or equal to the textbox value then make the checkbox value equal selected.
I've found something similar to what I need but this will only allow me to check if the values are equal.
Private Sub btnSelectLowAmt_Click(send er As System.Object, e As System.EventArgs) Handles btnSelectLowAmt.Click
searchvalue2 = CInt(mtxtLowAmt.Text)
Dim rowIndex As Integer = -1
For Each row As DataGridViewRow In DataGridView2.Rows
If row.Cells(7).Value.Equals( searchvalu e2) Then
row.Cells(0).Value = True
Exit For
End If
Next
End Sub
I have a datagridview in my windows form where on load I'm creating an additional column in my datagridview with a checkbox in it. This is for users to be able to select a record and then complete an action on it.
I have added a textbox and a button to my form. I want the user to key in a value in the textbox and when they click the button the system will compare a specific column value for each row in the datagridview to the value in the textbox. If the column value is less than or equal to the textbox value then make the checkbox value equal selected.
I've found something similar to what I need but this will only allow me to check if the values are equal.
Private Sub btnSelectLowAmt_Click(send
searchvalue2 = CInt(mtxtLowAmt.Text)
Dim rowIndex As Integer = -1
For Each row As DataGridViewRow In DataGridView2.Rows
If row.Cells(7).Value.Equals(
row.Cells(0).Value = True
Exit For
End If
Next
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Carl,
That worked perfect. Thank you.
That worked perfect. Thank you.
ASKER