Creation and Positioning DataGrid Columns at runtime.

  • Thread starter Thread starter Alan Seunarayan
  • Start date Start date
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
 
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
 
Alan,

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

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

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

e.Item.Cells.Add(deleteCell);
 
Are you creating column dynamically? What happens if you change the column
creating order?

Eliyahu
 
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

Back
Top