Binding multi column values in one column

Discussion in 'ASP .Net' started by Larry R, Jun 7, 2007.

  1. Larry R

    Larry R Guest

    Asp.net 2.0. Binding a Gridview. UNtil now, it had been simple
    BoundColumns, but now I need to have one column show the values of 3
    columns ( they are in the same datasource).

    I thought that I should just be able to use a template sucha as :

    <asp:TemplateField d>
    <HeaderTemplate><asp:Label runat=server>Test</
    asp:Label></HeaderTemplate>
    <ItemTemplate>
    <asp:Label runat=server><%Eval("F");%>//<%Eval("M");
    %> <%Eval("L"); %></asp:Label>
    </ItemTemplate>
    </asp:TemplateField>

    but that didn't work out.

    Any suggestions?
    Larry R, Jun 7, 2007
    #1
    1. Advertising

  2. Larry R

    marss Guest

    Larry R wrote:
    > Asp.net 2.0. Binding a Gridview. UNtil now, it had been simple
    > BoundColumns, but now I need to have one column show the values of 3
    > columns ( they are in the same datasource).
    >
    > I thought that I should just be able to use a template sucha as :
    >
    > <asp:TemplateField d>
    > <HeaderTemplate><asp:Label runat=server>Test</
    > asp:Label></HeaderTemplate>
    > <ItemTemplate>
    > <asp:Label runat=server><%Eval("F");%>//<%Eval("M");
    > %> <%Eval("L"); %></asp:Label>
    > </ItemTemplate>
    > </asp:TemplateField>
    >
    > but that didn't work out.
    >
    > Any suggestions?


    Hi,
    You miss # in data binding expression.
    Correct <%# Eval("F") %> and so forth.
    Regards, Mykola
    http://marss.co.ua
    marss, Jun 8, 2007
    #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. John Grandy
    Replies:
    0
    Views:
    608
    John Grandy
    Sep 13, 2005
  2. Dave
    Replies:
    3
    Views:
    388
    Kevin Goodsell
    Apr 19, 2004
  3. Angus
    Replies:
    14
    Views:
    487
    James Kanze
    Mar 10, 2011
  4. quiggle

    Binding Two DataTable Columns to One DataGrid Column

    quiggle, Apr 2, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    172
    quiggle
    Apr 2, 2004
  5. work4u
    Replies:
    1
    Views:
    129
    Mark Schupp
    Jan 7, 2004
Loading...

Share This Page