This problem is somewhat complex and has plagued me for quite some time now. I need a solution if possible.
I have a grid in a rad window where the user can click a Create New Row button, and clicking that button causes a post back to a method that retrieves all current rows from the grid and adds them to a dataset, then creates a new row and adds that to the dataset as well. Then the code binds the dataset to the grid and the grid now has the original rows as well as the new row.
The user can add as many new rows as they want, populate the rows, then save the grid. This all works fine, however there is one crucial piece that is not working properly and I cannot for the life of me figure out why.
I am trying to set certain rows into edit mode (based on the value of one of the fields) after the grid is bound to the dataset containing the original and new rows. If I try to do this the rows only turn yellow and do not open into edit mode. The code is identifying the rows propwerly based on the value, but it doesn't open them in edit mode for some reason. Here is the code I am using:
I have a grid in a rad window where the user can click a Create New Row button, and clicking that button causes a post back to a method that retrieves all current rows from the grid and adds them to a dataset, then creates a new row and adds that to the dataset as well. Then the code binds the dataset to the grid and the grid now has the original rows as well as the new row.
The user can add as many new rows as they want, populate the rows, then save the grid. This all works fine, however there is one crucial piece that is not working properly and I cannot for the life of me figure out why.
I am trying to set certain rows into edit mode (based on the value of one of the fields) after the grid is bound to the dataset containing the original and new rows. If I try to do this the rows only turn yellow and do not open into edit mode. The code is identifying the rows propwerly based on the value, but it doesn't open them in edit mode for some reason. Here is the code I am using:
'loop through datagrid and set rows with an empty job number to edit mode
For Each gridDataItem As GridDataItem In rgS.MasterTableView.Items
Dim lblJobNum As Label = CType(gridDataItem.FindControl("lblJobNum"), Label)
If (lblJobNum.Text = "") Then
gridDataItem.Edit =
True
End If
Next
If I omit this loop the data grid will look fine except the rows will not be in |
edit mode. However, I can click the image button and set them to edit mode |
manually but I don't want the user to have to do this. Is there something |
wrong with how I am setting these rows to edit mode? |