Datagrid versus Gridview

Discussion in 'ASP .Net Datagrid Control' started by Arne Garvander, May 8, 2006.

  1. The code below works fine in a DataGrid.
    <asp:TemplateColumn HeaderText="Select">
    <ItemTemplate>
    <%# GetLink(Container.DataItem) %>
    </ItemTemplate>
    </asp:TemplateColumn>
    What is the corresponding syntax for Gridview?

    --
    Arne Garvander
    (I program VB.Net for fun and C# to get paid.)
     
    Arne Garvander, May 8, 2006
    #1
    1. Advertising

  2. It isn't clear to me what your sample is doing.

    Here's a sample that might help:

    <asp:gridview id="GridView1" runat="server"
    onprerender="GridView1_PreRender">
    <columns>
    <asp:templatefield headertext="Artist" sortexpression="Artist">
    <itemtemplate>
    <asp:label id="Label1" runat="server" text='<%#
    GetLink(Container.DataItem("Artist")) %>'></asp:label>
    </itemtemplate>
    </asp:templatefield>
    </columns>
    </asp:gridview>

    "Arne Garvander" <> wrote in message
    news:D...
    > The code below works fine in a DataGrid.
    > <asp:TemplateColumn HeaderText="Select">
    > <ItemTemplate>
    > <%# GetLink(Container.DataItem) %>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > What is the corresponding syntax for Gridview?
    >
    > --
    > Arne Garvander
    > (I program VB.Net for fun and C# to get paid.)
     
    Ken Cox - Microsoft MVP, May 9, 2006
    #2
    1. Advertising

  3. Ken,
    Thanks for the tip. I had to make a change to get it to work.
    <asp:label id="Label1" runat="server" text='<%#
    MyEdits((DataRowView)Container.DataItem) %>'></asp:label>

    --
    Arne Garvander
    (I program VB.Net for fun and C# to get paid.)


    "Ken Cox - Microsoft MVP" wrote:

    > It isn't clear to me what your sample is doing.
    >
    > Here's a sample that might help:
    >
    > <asp:gridview id="GridView1" runat="server"
    > onprerender="GridView1_PreRender">
    > <columns>
    > <asp:templatefield headertext="Artist" sortexpression="Artist">
    > <itemtemplate>
    > <asp:label id="Label1" runat="server" text='<%#
    > GetLink(Container.DataItem("Artist")) %>'></asp:label>
    > </itemtemplate>
    > </asp:templatefield>
    > </columns>
    > </asp:gridview>
    >
    > "Arne Garvander" <> wrote in message
    > news:D...
    > > The code below works fine in a DataGrid.
    > > <asp:TemplateColumn HeaderText="Select">
    > > <ItemTemplate>
    > > <%# GetLink(Container.DataItem) %>
    > > </ItemTemplate>
    > > </asp:TemplateColumn>
    > > What is the corresponding syntax for Gridview?
    > >
    > > --
    > > Arne Garvander
    > > (I program VB.Net for fun and C# to get paid.)

    >
    >
    >
     
    Arne Garvander, May 9, 2006
    #3
    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. Matthew Louden
    Replies:
    1
    Views:
    6,939
    Scott M.
    Oct 11, 2003
  2. Russ

    script versus code versus ?

    Russ, Jun 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,502
  3. =?Utf-8?B?QXJuZSBHYXJ2YW5kZXI=?=

    Datagrid versus Gridview

    =?Utf-8?B?QXJuZSBHYXJ2YW5kZXI=?=, May 8, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,650
    Christopher Reed
    May 17, 2006
  4. Christoffer Sawicki
    Replies:
    5
    Views:
    261
    Christoffer Sawicki
    Sep 2, 2006
  5. Paul Butcher
    Replies:
    12
    Views:
    723
    Gary Wright
    Nov 28, 2007
Loading...

Share This Page