Combining bound columns into template columns...

Posted on 2005-04-06
Last Modified: 2010-04-07
Inide a datagrid I would like to combine multiple columns into a single template column.  My reasoning is that I need to save screen space since I have about 16 columns of data.  I need to get within 800 pixels and I'm currently at about 2000 or so.

These are just simple data bound columns displaying text.

<asp:BoundColumn DataField="CHG_DT" HeaderText="Charge Dt">                              
<asp:BoundColumn DataField="PROC_DT" HeaderText="Process Dt">                              
<asp:BoundColumn DataField="PAY_PD_DT" HeaderText="Pay Pd Dt">

I know this is sort of an open ended question in a way but any ideas and links will be greatly appreciated.

Thanks in advance...
Question by:Weller0123
    LVL 1

    Accepted Solution

    <asp:datagrid ID="testGrid" Width="100%" CellPadding="3" CellSpacing="0" AutoGenerateColumns="False" Runat="server">
                      <headertemplate>Charge Dt - Process Dt - Pay Pd Dt</headertemplate>
                            <%# DataBinder.Eval(Container.DataItem, "CHG_DT")+" - "+DataBinder.Eval(Container.DataItem, "PROC_DT")+" - "+DataBinder.Eval(Container.DataItem, "PAY_PD_DT") %>

    Hope it helps.
    LVL 1

    Expert Comment

    you could alweays replace the " - " concatenator with "<br/>". That would enable you to have all three item in the width of one. Just keep in mind this stretches the height of you rows.

    Author Comment

    ...kewl.  That should at least help.

    LVL 1

    Expert Comment

    Post back if you need any more clarification on this.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now