DataGrid, 7 columns on 2 rows?

C

Chris Podmore

Is this possible? I currently have a datagrid showing 7 columns, I would like to show the 6th and 7th columns on the next row. How can I do this?
 
J

Jeffrey Tan[MSFT]

Hi Chris,

Based on my understanding, you want to do databinding to your datagrid
control, and wrap some columns to another row.

Actually, datagrid control did not expose such flexibility, but you still
can get what you want through Repeater control, do like this:

<asp:repeater id="Repeater1" runat="server">
<HeaderTemplate>
<table border="1" cellpadding="0" cellspacing="0">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container.DataItem, "job_id")%></td>
<td><%#DataBinder.Eval(Container.DataItem, "min_lvl")%></td>
<td><%#DataBinder.Eval(Container.DataItem, "max_lvl")%></td>
</tr>
<tr>
<td><%#DataBinder.Eval(Container.DataItem, "job_description")%></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:repeater>

Please apply my suggestion to see if it works for you.

Thanks,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
C

Chris Podmore

Jeffrey,

Thanks for the reply. I will give it a try as soon as I can. I have had to move on to another part of the project for now but when I get a chance I will give your suggestion a try.

Chris.

----- Jeffrey Tan[MSFT] wrote: -----

Hi Chris,

Based on my understanding, you want to do databinding to your datagrid
control, and wrap some columns to another row.

Actually, datagrid control did not expose such flexibility, but you still
can get what you want through Repeater control, do like this:

<asp:repeater id="Repeater1" runat="server"><HeaderTemplate><table border="1" cellpadding="0" cellspacing="0"></HeaderTemplate><ItemTemplate><tr><td><%#DataBinder.Eval(Container.DataItem, "job_id")%></td><td><%#DataBinder.Eval(Container.DataItem, "min_lvl")%></td><td><%#DataBinder.Eval(Container.DataItem, "max_lvl")%></td></tr><tr><td><%#DataBinder.Eval(Container.DataItem, "job_description")%></td></tr></ItemTemplate><FooterTemplate></table></FooterTemplate></asp:repeater>

Please apply my suggestion to see if it works for you.

Thanks,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Chris,

Thanks for your feedback.

Ok, once you have finished trying, please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
C

Chris Podmore

Jeffery

I haven't actually tried your suggestion, sorry. Since my original post I have purchased Infragistics NetAdvantage controls, not originally for their grid for some of their other controls. It's quite easy to implement what I was after using their webGrid control so I have gone for that.

Thanks again
Chris

----- "Jeffrey Tan[MSFT]" wrote: ----

Hi Chris

Thanks for your feedback.

Ok, once you have finished trying, please feel free to feedback. Thank

Best regards
Jeffrey Ta
Microsoft Online Partner Suppor
Get Secure! - www.microsoft.com/securit
This posting is provided "as is" with no warranties and confers no rights
 
J

Jeffrey Tan[MSFT]

Hi Chris,

I am glad you got what you want. If you need further help, please feel free
to feedback, I will help you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top