Click here to Skip to main content
Sign Up to vote bad
good
See more: C#4.0
How can we create check box at runtime based on row count?
Posted 6 hrs ago

Comments
richcb - 6 hrs ago
Use a for loop. See example below.

1 solution

Here is an example of a for loop creating check boxes dynamically based on a row count:
for(int i = 0; i < DataTable.Rows.Count, i++)
{
    CheckBox cb = new CheckBox();
    cb.ID = i;
    Form1.Controls.Add(cb);    
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 585
1 Maciej Los 395
2 OriginalGriff 345
3 Dave Kreskowiak 325
4 Mohammed Hameed 303
0 Sergey Alexandrovich Kryukov 5,619
1 OriginalGriff 4,532
2 CPallini 2,667
3 Róhãn Lëuvä 2,337
4 Tadit Dash 1,443


Advertise | Privacy | Mobile
Web04 | 2.6.130513.1 | Last Updated 13 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid