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 9231001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:57:40+00:00 2026-06-18T05:57:40+00:00

I am trying to use an sqldatasource object to populate a grid view but

  • 0

I am trying to use an sqldatasource object to populate a grid view but I wish to combined two of the rows in the database into one row with a line break in the grid view (for aesthetic appeal only). What I have done so far is concatenated the results of the database to look something like this:

SELECT Incidents.Title + '<br />' + Products.Name AS "Title/Product",
Technicians.Name + '<br />' +  Incidents.Description AS "Tech name /<br />Description",
Incidents.DateOpened,
Incidents.DateClosed
FROM Incidents
INNER JOIN Technicians ON Incidents.TechID = Technicians.TechID
INNER JOIN Products ON Incidents.ProductCode = Products.ProductCode
WHERE Incidents.CustomerID = @CustomerID

So as you can see I am inserting HTML linebreaks into the contatination and the column names but sadly this is shown as "Title<br />Product" in the gridview. In short it does not actually perform the linebreak it just inserts the text.

So my question is, is there anyway to enforce a linebreak, preferably one that is less complex then the method I am working with, if there isn’t that’s fine I’m just really stuck on exactly what I could do.

  • 1 1 Answer
  • 0 Views
  • 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-06-18T05:57:42+00:00Added an answer on June 18, 2026 at 5:57 am

    Yep you don’t get a line break when you insert it in your SQL query. You may also look into using a ListView control. The asp:ListView Control

    You can do everything regarding aesthetics inside your presentation
    layer (aspx page).

    For your requirement, what you can do is to create a gridview template field column. Inside that template field column you can drop some labels & place your line breaks there. You can bind your labels with your underlying data source like

    <asp:TemplateField HeaderText="My line break row">
    <ItemTemplate>
    <p>
      <asp:Label Id="lblTitle" Text='<%# Bind("Title")></asp:Label>
    </p>
    <p>
      <asp:Label Id="lblProduct" Text='<%# Bind("Product")></asp:Label>
    </p>
    
    </ItemTemplate>
    </TemplateField>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am at the moment trying to learn how to use basic grid view
I was trying use svn to find a checkin using svn log, but it
I am going by this example and trying to have it use a SqlDataSource
I'm trying to use the @JDBC annotation in my class definition as below, but
I am trying to insert Arabic letter in to mysql database, but it only
I'm trying to use a asp:SqlDataSource driven by a SQL Select with Arguments. It
I am trying use an if statement and TWO .addClass background-color variables based on
I'm trying use an object which wasn't available until SDK level 5. It seems
I'm trying to use the OpenSqlFilestream Instruction but my code did not recognise it

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.