DataGrid Question

Discussion in 'ASP .Net Building Controls' started by Josema, May 4, 2005.

  1. Josema

    Josema Guest

    Hi,

    I have a DataGrid that its filled from a DataTable.

    this datagrid has autogeneratecolumns=true cause this datatable could have
    different number of columns.

    My problem its that:

    I need that the first column be a link button column.

    What its the best way to implement it?, i only imagine that i can derive
    from DataGrid Class. Passing to a method of this grid class derived, the
    datatable.
    this way, depending of the columns of the datatable, i can add to the grid,
    the columns in execution time.

    Its this a good solution?
    There is any easier?


    --
    Thanks
    Regards.
    Josema
    --
    Thanks
    Regards.
    Josema
     
    Josema, May 4, 2005
    #1
    1. Advertising

  2. Josema

    Sundararajan Guest

    Hi,
    Why cant u go by the way of adding template columns
    <asp:TemplateColumn HeaderText="Employee Number">
    <ItemTemplate>
    <asp:LinkButton ID="txtempno" Text='<%# DataBinder.Eval(Container,
    "DataItem.empno") %>' Runat="server"> </asp:LinkButton >
    </ItemTemplate>
    </asp:TemplateColumn>

    something like this.. by this way ur linkbutton column will be the first one
    to be rendered in the data grid. check this out.
    regards,
    sundararajan.s
    "Josema" wrote:

    > Hi,
    >
    > I have a DataGrid that its filled from a DataTable.
    >
    > this datagrid has autogeneratecolumns=true cause this datatable could have
    > different number of columns.
    >
    > My problem its that:
    >
    > I need that the first column be a link button column.
    >
    > What its the best way to implement it?, i only imagine that i can derive
    > from DataGrid Class. Passing to a method of this grid class derived, the
    > datatable.
    > this way, depending of the columns of the datatable, i can add to the grid,
    > the columns in execution time.
    >
    > Its this a good solution?
    > There is any easier?
    >
    >
    > --
    > Thanks
    > Regards.
    > Josema
    > --
    > Thanks
    > Regards.
    > Josema
     
    Sundararajan, May 11, 2005
    #2
    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. Dave
    Replies:
    0
    Views:
    449
  2. BK Kim

    datagrid in datagrid

    BK Kim, Feb 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    545
    Alvin Bruney [MVP]
    Mar 2, 2004
  3. =?Utf-8?B?U3VyZXNo?=
    Replies:
    0
    Views:
    526
    =?Utf-8?B?U3VyZXNo?=
    Mar 2, 2004
  4. Brian K. Williams
    Replies:
    0
    Views:
    545
    Brian K. Williams
    Mar 2, 2004
  5. Andreas Klemt
    Replies:
    0
    Views:
    310
    Andreas Klemt
    Oct 8, 2003
Loading...

Share This Page