Adding a ButtonColumn to a DataGrid in a Custom Control

Discussion in 'ASP .Net Building Controls' started by alumb, Nov 2, 2004.

  1. alumb

    alumb Guest

    I am trying to add a buttoncolumn to a Datagrid I am dynamicaly adding
    to a custom control (code below). The Datagrid outputs fine but all of
    the entries in the button column are just text, no link. The source
    for the entries looks like <a>build</a>. Any help would be great.

    TreeTable = new DataGrid();

    TreeTable.AutoGenerateColumns=true;
    TreeTable.DataSource = dal.GetDataViewSql("SELECT * FROM tblAIs left
    join tblNodes on tblAIS.id=tblNodes.NodeID").Table; //this is our
    custom data accessor

    ButtonColumn buildColumn = new ButtonColumn();
    buildColumn.Text="Build";
    buildColumn.ButtonType = ButtonColumnType.PushButton;
    buildColumn.CommandName="Select";
    buildColumn.DataTextField = "ID";
    TreeTable.Columns.Add(buildColumn);

    TreeTable.ItemCommand += new
    DataGridCommandEventHandler(TreeTable_ItemCommand);
    alumb, Nov 2, 2004
    #1
    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. Northern
    Replies:
    0
    Views:
    394
    Northern
    Jul 22, 2003
  2. DotNetJunkies User
    Replies:
    3
    Views:
    565
    Eliyahu Goldin
    Jul 7, 2004
  3. Adam White
    Replies:
    1
    Views:
    367
    Scott Allen
    Nov 22, 2004
  4. aliciahogue
    Replies:
    0
    Views:
    594
    aliciahogue
    Oct 20, 2009
  5. PK9
    Replies:
    5
    Views:
    145
    Elton Wang
    Feb 17, 2005
Loading...

Share This Page