D
David C
The goal here is given an instance of CheckedListBox, I want to have a
button, when pressed will check all the checkboxes inside the
CheckedListBox. Simple enough?
As a side note, I am massively confused with the general programming model
of list controls. Let me try to list them out.
1. Items - The "Items" property is documented as "ObjectCollection" which
makes it very vague as to what exactly is stored. I did some research and
found out that incidents of DataRowView are stored.
2. So what about DataRowView. How is information stored? I looped
through to see what is there. Looked at .Row[0], ..Row[1], .Row[2],
..Row[3], .Row[4], .Row[5], without running into out of bounds error.
It appears that .Row[0] stores the Value (such as the ID)
, have no idea what .Row[1] is. It has some number which I don't
recognize, or sometimes its blank
, .Row[2] has the displayed value
, .Row[3] and others seem to have other columns from the table that I used
to populate.
Why, then are other columns stored there? The way I bounded the control
was.
string sql = "SELECT * FROM Organizations WHERE treeLevel = " + treeLevel;
DataTable organizations = db.QueryIntoDataTable(sql);
lctr.DisplayMember = "name";
lctr.ValueMember = "orgnizationID";
lctr.DataSource = organizations;
db.Close();
I am only intersted in the two columns (name for display and OrganizationID
for Value).
But still, I cannot programmatically get to the check boxes inside
CheckedListBox.
Sorry about rambling on. If anyone can help me understand how List Controls
in Windows works (I've completely mastered their web counterparts), I'd
appreciate it. I just don't understand how to work with them. I just don't
get it. It seems very complicated, but does very little. Access 95
dropdowns are better!!!! For example, the dropdown control. I can't get it
to whittle down the list as the user types in into the box. Thanks in
advance.
button, when pressed will check all the checkboxes inside the
CheckedListBox. Simple enough?
As a side note, I am massively confused with the general programming model
of list controls. Let me try to list them out.
1. Items - The "Items" property is documented as "ObjectCollection" which
makes it very vague as to what exactly is stored. I did some research and
found out that incidents of DataRowView are stored.
2. So what about DataRowView. How is information stored? I looped
through to see what is there. Looked at .Row[0], ..Row[1], .Row[2],
..Row[3], .Row[4], .Row[5], without running into out of bounds error.
It appears that .Row[0] stores the Value (such as the ID)
, have no idea what .Row[1] is. It has some number which I don't
recognize, or sometimes its blank
, .Row[2] has the displayed value
, .Row[3] and others seem to have other columns from the table that I used
to populate.
Why, then are other columns stored there? The way I bounded the control
was.
string sql = "SELECT * FROM Organizations WHERE treeLevel = " + treeLevel;
DataTable organizations = db.QueryIntoDataTable(sql);
lctr.DisplayMember = "name";
lctr.ValueMember = "orgnizationID";
lctr.DataSource = organizations;
db.Close();
I am only intersted in the two columns (name for display and OrganizationID
for Value).
But still, I cannot programmatically get to the check boxes inside
CheckedListBox.
Sorry about rambling on. If anyone can help me understand how List Controls
in Windows works (I've completely mastered their web counterparts), I'd
appreciate it. I just don't understand how to work with them. I just don't
get it. It seems very complicated, but does very little. Access 95
dropdowns are better!!!! For example, the dropdown control. I can't get it
to whittle down the list as the user types in into the box. Thanks in
advance.