D
David C
I am trying to dynamically create a datagrid with code that looks exactly
like what the asp tags show below. It has only one column and that column
is a template column with a link button control.
This is how far I was able to take this.
DataGrid dgRecords = new DataGrid();
dgRecords.DataKeyField = "RecordID";
dgRecords.AutoGenerateColumns = false;
TemplateColumn temcol = new TemplateColumn();
I know it's not very much. I just can't figure out how to have the embedded
link button control in the column. Thanks.
<aspataGrid id="dgRecords" runat="server" DataKeyField="RecordID"
AutoGenerateColumns="False"
Visible="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton ID="lnkLink" Runat="server">
<%#DataBinder.Eval(Container.DataItem, "Entry")%>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</aspataGrid>
like what the asp tags show below. It has only one column and that column
is a template column with a link button control.
This is how far I was able to take this.
DataGrid dgRecords = new DataGrid();
dgRecords.DataKeyField = "RecordID";
dgRecords.AutoGenerateColumns = false;
TemplateColumn temcol = new TemplateColumn();
I know it's not very much. I just can't figure out how to have the embedded
link button control in the column. Thanks.
<aspataGrid id="dgRecords" runat="server" DataKeyField="RecordID"
AutoGenerateColumns="False"
Visible="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton ID="lnkLink" Runat="server">
<%#DataBinder.Eval(Container.DataItem, "Entry")%>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</aspataGrid>