Dynamic datagrid template Columns Need Help.

T

tk

I am having problems trying to create these template columns dynamically.

'<Columns>
' <asp:TemplateColumn>
' <ItemTemplate>
' <asp:LinkButton runat="server" Text="Edit" CommandName="Edit"
CausesValidation="false"></asp:LinkButton>
' </ItemTemplate>
' <EditItemTemplate>
' <asp:LinkButton runat="server" Text="Update"
CommandName="Update"></asp:LinkButton>&nbsp;
' <asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel"
CausesValidation="false"></asp:LinkButton>
' </EditItemTemplate>
' </asp:TemplateColumn>
'</Columns>

I want to take the above HTML code and create the template Columns
Dynamically in the code behind which would be VB.
I have tried Microsofts
example(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbc
on/html/vbtskcreatingtemplatesprogrammaticallyindatagridcontrol.asp),
It keeps giving me this error:
Compiler Error Message: BC30002: Type 'ITemplate' is not defined.

Source Error:


Line 654:
Line 655:public Class DataGridTemplate
Line 656: Implements ITemplate
Line 657: Dim templateType As ListItemType
Line 658: Dim columnName As String


Can anyone help me. I Program in VB.NET
 
P

Pramod Anchuparayil

I use c# and I had to add
using System.Web.UI;
using System.Web.UI.WebControls;

have u done this?

Pramod
 

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,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top