简体   繁体   中英

Dynamically bind controls to the grid view in asp.NET

I just want to bind controls to the grid view but i want to do it dynamically.As an example i just want to enter students marks to text box to adjacent subjects??

thinks students are in row's and subjects are in columns and it similar to matrix in mathematics . but some times no of students and no of subjects are vary.

Therefore i have to bind it dynamically CAN ANY ONE HELP ME WITH THIS

Use the RowDataBound event. You can add any control there.

CheckBox cb = new CheckBox();
cells[0].Controls.Add(cb);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM