Dynamic datagrid template Columns Need Help.

Discussion in 'ASP .Net Datagrid Control' started by tk, Dec 5, 2003.

  1. tk

    tk Guest

    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
     
    tk, Dec 5, 2003
    #1
    1. Advertising

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

    have u done this?

    Pramod



    "tk" <> wrote in message
    news:u2UVG%...
    > 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
    >
    >
     
    Pramod Anchuparayil, Dec 17, 2003
    #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. CW
    Replies:
    2
    Views:
    417
  2. rob thomson
    Replies:
    0
    Views:
    264
    rob thomson
    Sep 4, 2003
  3. Daniel Roth
    Replies:
    0
    Views:
    254
    Daniel Roth
    Apr 5, 2005
  4. ton
    Replies:
    2
    Views:
    207
    Alvin Bruney [MVP]
    Feb 11, 2004
  5. Vinki

    template columns and bound columns in gridview

    Vinki, Apr 25, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    872
    Vinki
    Apr 25, 2007
Loading...

Share This Page