I am using sql command to retrieve data from database and display it on datagrid. However, I am not able to edit data grid unlike datagridview where i can set it to readonly = false.

I am using sql server compact edition for mobile application.

Below is a sample code

Code Snippet

DgvSecurityIdts.DataSource = Nothing

'Selects the relevant rows

Dim mySelectCommand As SqlCeCommand

mySelectCommand = New SqlCeCommand("SELECT *FROM table1 WHERE SIStatus = @status ORDER BY SIDateTime", Main.new_connection)

mySelectCommand.Parameters.AddWithValue("@status", CmbStatus.Text)

Dim dr As SqlCeDataReader = mySelectCommand.ExecuteReader

dr = mySelectCommand.ExecuteResultSet(ResultSetOptions.Scrollable)

If dr.HasRows Then

Dim dt As New DataTable


DgvSecurityIdts.DataSource = dt


RtbMessages.Text = "Error" + CmbStatus.Text

RtbMessages.ForeColor = Color.Red

End If


How do i go about being able to edit the datagrid Am not able to find a solution.

Re: Windows Forms Data Controls and Databinding Unable to edit datagrid...


Found a solution to the above problem. The link below will help solve the problem TOPIC_ID=245