Creation and Positioning DataGrid Columns at runtime.

Discussion in 'ASP .Net Datagrid Control' started by Alan Seunarayan, Jul 27, 2005.

  1. 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
     
    Alan Seunarayan, Jul 27, 2005
    #1
    1. Advertising

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

    "Eliyahu Goldin" <> wrote in message
    news:%...
    > Alan,
    >
    > What happens if you just change the order of the columns in the .aspx
    > file?
    >
    > Eliyahu
    >
    > "Alan Seunarayan" <0m> wrote in message
    > news:u5IFe.3481$...
    >> 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
    >>
    >>

    >
    >
     
    Alan Seunarayan, Jul 27, 2005
    #2
    1. Advertising

  3. Alan,

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

    Eliyahu

    "Alan Seunarayan" <0m> wrote in message
    news:u5IFe.3481$...
    > 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
    >
    >
     
    Eliyahu Goldin, Jul 27, 2005
    #3
  4. Figured it out....Re: Creation and Positioning DataGrid Columns at runtime.

    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" <0m> wrote in message
    news:u5IFe.3481$...
    > 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
    >
     
    Alan Seunarayan, Jul 27, 2005
    #4
  5. Are you creating column dynamically? What happens if you change the column
    creating order?

    Eliyahu

    "Alan Seunarayan" <0m> wrote in message
    news:yPIFe.8907$...
    > it needs to be done in the 'Code-Behind'.
    >
    > "Eliyahu Goldin" <> wrote in message
    > news:%...
    > > Alan,
    > >
    > > What happens if you just change the order of the columns in the .aspx
    > > file?
    > >
    > > Eliyahu
    > >
    > > "Alan Seunarayan" <0m> wrote in message
    > > news:u5IFe.3481$...
    > >> 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
    > >>
    > >>

    > >
    > >

    >
    >
     
    Eliyahu Goldin, Jul 27, 2005
    #5
  6. Alan Seunarayan

    John Teague Guest

    RE: Figured it out....Re: Creation and Positioning DataGrid Columns at

    Post the code where you are creating the columns

    "Alan Seunarayan" wrote:

    > 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" <0m> wrote in message
    > news:u5IFe.3481$...
    > > 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
    > >

    >
    >
    >
     
    John Teague, Jul 27, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Seunarayan
    Replies:
    5
    Views:
    584
    =?Utf-8?B?Sm9obiBUZWFndWU=?=
    Jul 27, 2005
  2. rob thomson
    Replies:
    0
    Views:
    283
    rob thomson
    Sep 4, 2003
  3. Arulraja

    ASP.NET DataGrid and TextBox creation at runtime?

    Arulraja, Nov 7, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    217
    Arulraja
    Nov 7, 2003
  4. ton
    Replies:
    2
    Views:
    219
    Alvin Bruney [MVP]
    Feb 11, 2004
  5. Alan Seunarayan

    Creation and Positioning DataGrid Columns at runtime.

    Alan Seunarayan, Jul 27, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    162
    John Teague
    Jul 27, 2005
Loading...

Share This Page