Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 212975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:14:09+00:00 2026-05-11T18:14:09+00:00

I have two results from a data set. I want to add both results

  • 0

I have two results from a data set. I want to add both results in one gridview column. I do not want to merge in the code behind. Is there another way to do that?

<asp:TemplateField HeaderText="Entered Date" SortExpression="Date">
                    <ItemTemplate>
                    <div style="text-align: center;">
                        <asp:Label ID="Label3" runat="server" Text='<%# formatDisplayDate(Eval("Date").ToString()) %>'></asp:Label>
                    </div>
                    </ItemTemplate>                    
                </asp:TemplateField>

Now i would return “04/04/2009”. I would like to return “04/04/2009-PASSED”

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:14:10+00:00Added an answer on May 11, 2026 at 6:14 pm

    Have you tried:

    formatDisplayDate(Eval("Date").ToString()) & "-" & Eval("OtherField").ToString()
    

    If that doesn’t work you should be able to set up a TemplateField for the combined rows like this:

    <asp:TemplateField HeaderText="CombinedFieldName" SortExpression="CombinedFieldName">
        <ItemTemplate>
           <asp:Label ID="Label1" runat="server" 
           Text='<%# DataBinder.Eval(Container,"DataItem.FirstField") %>' >
           </asp:Label>
           -
           <asp:Label ID="Label2" runat="server" 
           Text='<%# DataBinder.Eval(Container,"DataItem.SecondField") %>' >
           </asp:Label>
            </ItemTemplate>
    </asp:TemplateField>
    

    That said – it is usually much more efficient to do the field concatenation in the database operation if possible. I haven’t tested, but I would assume that concatenating in the SELECT would be fastest, followed by concatenating in the data set in the codebehind, and combining them on the ASP.Net page would be slowest.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two mysql tables and i want to merge the results of these
I have this code and i want do filter the autofill results by two
I have two PostgreSQL functions. One returns a set of data, including an email
I have two tables. One user table and one table in which results are
I have two iterators which i have to merge into one result. Here are
I have two tables, message_threads and messages . When returning a results set of
I have 3 tables, one which represents a supertype, with an ID column. Two
I have two lists of two different kinds of objects representing data rows from
I have a data set on N numbers that I want to test for
Setup I have two List<T> 's. The data is un-normalized and from different sources

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.