Hello
I create controls in a form dynamicly in an edit form
foreach(var item in list){
TextBox textBoxName = new TextBox();
CheckBox checkBoxYesOrNo = new CheckBox();
textBoxName.Name = "Name" + item.id.ToString();
textBoxName.Text = item.name;
checkBoxPing.Text = "Yes";
checkBoxPing.Name = "Yes" + item.id.ToString();
checkBoxPing.Checked = item.checked;
//It would be nice to add item.id each row somehow
}and on buttonclick I loop the controls to update the values in List
foreach (Control c in this.Controls)
{
//Is it possible to do somekind of (pseudo)
if(row.id == itemInList.id){
//Then I know which object we're talking about
//and adjust Name,YesOrNo values etc for that object
}
}But it would be nice to be able to know what object in list is treated when looping each row.
In php when doing web programming I could add a css id to each row, or even a hidden value to each control with id of the object, item.id
Regards