DataGrid: Add Checkbox

F

Frank Esser

Hallo,

within a DataGrid with just one column I want to display a checkbox
additionally to each item text.
I can do it in the event "DataGrid_ItemDataBound" for each cell:

CheckBox myCB = new CheckBox();
e.Item.Cells[0].Controls.Add(myCB);

On the Web-Page the checkbox is displayed at the end of each text.

Is there an easy way to put the checkbox in front of the text (at the
beginning of the string)?

I do not want to create a new column, just use the existing one...

Thanks for your reply!
Best regards
Frank
 
G

Guest

Add the checkbox in the item template of the DataGrid in the .aspx file
instead in the codebehind.

Regards,
Kostadin Kostov
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top