I have one DataGridView named dgv.
dgv is pretty much a plain gridview. No bounded data. No columns added. It’s basically empty.
I also have one DataTable named dt.
I add rows and columns manually into dt.
dt.Columns.Add(New DataColumn("TexBox", GetType(String)))
dr = dt.NewRow()
dr("TextBox") = String.Empty
dt.Rows.Add(dr)
I then simply set dgv datasource into dt.
dgv.DataSource = dt
dgv.Refresh()
I then set the value for this particular cell.
dgv.Item(0,0).Value = "xxx"
Now when I run and execute all those commands. I happen to retrieve the gridview with that value indeed. The “xxx” cell appeared and currently it’s uneditable.
What I want to achieve is:
Allow this “xxx” cell to be editable. Preferrably if it can be inserted into a TextBox control inside the cell.
I googled and researched by myself on doing this. Yet I couldn’t find a correct resource.
Any help is appreciated.
I simulate your code and the following works perfectly :
By Default when you edit a cell in a datagridview a textbox will popup on cell,
so no need to make your own textbox
(If you please, Don’t forget to marke my answer as Right one)