Hello,
I need some help with datagrid control.
On a form I have a datagrid control and I am selecting a row from the datagrid and I have a button below which helps me perform that action on the datagrid row selected.
Now there are basically two issues I am facing.
1. Once I select the datagrid row and click the button, it does update the row with the necessary information but if I reload the grid, the information is still not updated in the database.
For example, I have a column named "Status" and I have coded the datagrid to display only the records which indicate the status as "Pending". Now when I select one of the displayed rows and click the button below, it will change the status from "Pending" to "Approved". The update is also successfully displayed in the datagrid column, but the datagrid does not update the database until the form is unloaded. After I unload the form, and I go to the database and check, the status is actually updated to "Approved".
Is there a way I can propagate the updates to the database without having to close the form???
2. I was also in search of a solution which can help me select multiple rows from the datagrid and then click the button below which will help me approve all the selected requests at a time.
I am currently able to select multiple rows from the datagrid but, when I click the button, it only approves the first request.
Below is a snippet of my code for reference.
=======================
Code
=======================
Dim selected_row As String
selected_row = grdReq.Row
grdReq.Columns(10).Value = "Approved"
grdReq.Columns(11).Value = "Approved by " + empname
adodcreq.refresh
grdreq.refresh
=======================
End Of code
=======================
Any help on this is greatly appreciated.
I need some help with datagrid control.
On a form I have a datagrid control and I am selecting a row from the datagrid and I have a button below which helps me perform that action on the datagrid row selected.
Now there are basically two issues I am facing.
1. Once I select the datagrid row and click the button, it does update the row with the necessary information but if I reload the grid, the information is still not updated in the database.
For example, I have a column named "Status" and I have coded the datagrid to display only the records which indicate the status as "Pending". Now when I select one of the displayed rows and click the button below, it will change the status from "Pending" to "Approved". The update is also successfully displayed in the datagrid column, but the datagrid does not update the database until the form is unloaded. After I unload the form, and I go to the database and check, the status is actually updated to "Approved".
Is there a way I can propagate the updates to the database without having to close the form???
2. I was also in search of a solution which can help me select multiple rows from the datagrid and then click the button below which will help me approve all the selected requests at a time.
I am currently able to select multiple rows from the datagrid but, when I click the button, it only approves the first request.
Below is a snippet of my code for reference.
=======================
Code
=======================
Dim selected_row As String
selected_row = grdReq.Row
grdReq.Columns(10).Value = "Approved"
grdReq.Columns(11).Value = "Approved by " + empname
adodcreq.refresh
grdreq.refresh
=======================
End Of code
=======================
Any help on this is greatly appreciated.