Display checkbox inside Table like structure in Vb
I have a field called Departments in my database. and I have 3 monitors. So when Page_Load, I need to check number of departments I have in database. And depends upon that number of departments I have, I need to calculate number of checkbox I need to display.
NumCheckBox = NumDepartments * 3
And then I need to create a table like structure with 4 fields. First column -Department Name and remaining 3 columns will be Monitor 1, Monitor 2 and Monitor 3. and display the department name and corresponding checkbox under each Monitor columns.
Each Checkbox need to be Checked and UnChecked. And I have 3 buttons on top of the screen called “Function1”, “Function2” and “Function3”. If I hit “Function1” and select the corresponding checkbox’s for each department and hit “Save” button, then it need to save inside a config file. And if I hit “Function2” and select the corresponding checkbox’s for that function and save and so on.
Once its saved, if I hit any of those Function button, then the corresponding selected checkbox for that function need to be checked.
For Example :
if I hit “Function1” button, then the corresponding selected checkbox for Function1 need to be checked.
if I hit “Function2” button, then the corresponding selected checkbox for Function2 need to be checked.
if I hit “Function3” button, then the corresponding selected checkbox for Function3 need to be checked.
Checkbox selected will be different for each Function. And the Number of Departments various. For Example : sometimes number of Departments will be 10 or 20 or 35 or 40 etc… so depends upon number of departments I have, I need to create checkbox under each Monitor field. And depends upon on number of department I have, the table structure’s size also should increase.
I can find the number of Departments from database and calculate the number of checkbox I need to display. And I have 3 Function button and Save button.
Can you please help me to find a way to create this table like structure to display the department name and the Checkbox’s under each Monitor field?
If you have any idea how to do this, please help me.
Thanks in advance.