Creation and Positioning DataGrid Columns at runtime.

A

Alan Seunarayan

Hello,
I need to create a DataGrid that looks something like this...

<HyperLinkColumn><ButtonColumn><Data><Data><ButtonColumn>

but I can only seem to produce a DataGrid as below...

<HyperLinkColumn><ButtonColumn><ButtonColumn><Data><Data>

Can anyone help?
Many thanks in advance.

Alan
 
A

Alan Seunarayan

it needs to be done in the 'Code-Behind'.

Eliyahu Goldin said:
Alan,

What happens if you just change the order of the columns in the .aspx
file?

Eliyahu
 
E

Eliyahu Goldin

Alan,

What happens if you just change the order of the columns in the .aspx file?

Eliyahu
 
A

Alan Seunarayan

in the ItemDataBound event of a DataGrid add the following....

TableCell deleteCell = e.Item.Cells[1]; // rendered ButtonColumn

e.Item.Cells.Add(deleteCell);
 
E

Eliyahu Goldin

Are you creating column dynamically? What happens if you change the column
creating order?

Eliyahu
 
G

Guest

Post the code where you are creating the columns

Alan Seunarayan said:
in the ItemDataBound event of a DataGrid add the following....

TableCell deleteCell = e.Item.Cells[1]; // rendered ButtonColumn

e.Item.Cells.Add(deleteCell);



Alan Seunarayan said:
Hello,
I need to create a DataGrid that looks something like this...

<HyperLinkColumn><ButtonColumn><Data><Data><ButtonColumn>

but I can only seem to produce a DataGrid as below...

<HyperLinkColumn><ButtonColumn><ButtonColumn><Data><Data>

Can anyone help?
Many thanks in advance.

Alan
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top