[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

Is it possible to make gridviews display 2 rows instead of 1 per entry?

I'm using visual studio 2005 and I want to have a grid view that is multiple rows because otherwise the gridview is just too long and goes off the page. Is it possible to do so?

Thanks,
Joe
0
renet123
Asked:
renet123
1 Solution
 
cciservicesCommented:
One possible solution is to have a single column gridview, and convert the column to a template field.
Then you could create a two-row table in the template field.
The main downside is that it limits your sorting ability for each column.

Psuedo code:
 
 
 
<asp:Gridview id="gvExample" runat="server" ...>
      <columns>
            <templatefield>
                   <table cellpadding="4" width="100%">
                       <tr>
                           <td> row one stuff </td>
                       </tr>
                       <tr>
                           <td> row two stuff </td>
                       </tr>
                   </table>
            </templatefield>   
      </columns>
</asp:Gridview>

Open in new window

0
 
renet123Author Commented:
I actually had considered doing that, but I really don't want to lose sorting. I was hoping there was a way to display both titles of the columns in the header and each is clickable and sortable. Know what I mean? Any help or if it's just not possible, please let me know.

-Joe
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now