I'm still pretty new to VB.NET so please forgive if this is obvious.
All I want to do is build some kind of table-like or grid-like control in my form that has two columns. An element in the first column should be a checkbox that is changable by the user, and an element in the second column is some un-editable text. Of course, when the user checks or unchecks a checkbox, I have to be able to handle that event and figure out which row it came from.
I've been trying this all day with no luck. Do I use a ListView or a DataGridView? If the answer is DataGridView, do I add columns and rows to it directly or do I try to make a DataTable which I then assign to the DataGridView's "DataSource" property?
Is is possible to make editable checkboxes in a DataTable? I succeeded in making checkboxes by making a DataColumn of type boolean, but then I couldn't check or uncheck them during runtime.
I tried this:
Dim checkBoxCol As New DataGridViewColumn(New DataGridViewCheckBoxCell())
Form1.DataGridView1.Columns.Insert(0, checkBoxCol)
but then I couldn't figure out how to add rows. The examples online all assume that there is only string data in each row.
Also there is apparently a type called DataGridBoolColumn? What is that all about?
My point is there are a lot of different objects out there with similar sounding names, and it's confusing.
Please help.
All I want to do is build some kind of table-like or grid-like control in my form that has two columns. An element in the first column should be a checkbox that is changable by the user, and an element in the second column is some un-editable text. Of course, when the user checks or unchecks a checkbox, I have to be able to handle that event and figure out which row it came from.
I've been trying this all day with no luck. Do I use a ListView or a DataGridView? If the answer is DataGridView, do I add columns and rows to it directly or do I try to make a DataTable which I then assign to the DataGridView's "DataSource" property?
Is is possible to make editable checkboxes in a DataTable? I succeeded in making checkboxes by making a DataColumn of type boolean, but then I couldn't check or uncheck them during runtime.
I tried this:
Dim checkBoxCol As New DataGridViewColumn(New DataGridViewCheckBoxCell())
Form1.DataGridView1.Columns.Insert(0, checkBoxCol)
but then I couldn't figure out how to add rows. The examples online all assume that there is only string data in each row.
Also there is apparently a type called DataGridBoolColumn? What is that all about?
My point is there are a lot of different objects out there with similar sounding names, and it's confusing.
Please help.