Adding a ButtonColumn to a DataGrid in a Custom Control

A

alumb

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);
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top