Data Grid ASP.net VB Group

jaytechnology
jaytechnology used Ask the Experts™
on
I have a datasource that will allways retutn 1 row from a SQL database.  It has 30 int's that I turn in to check boxes.  That is the easy part.  The hareder part is I want to combine these 30 columns in to 2 or 3 rows.  I got it down a bit but it looks like heck.  Some direction or a datagrid out of the box that can do this would be great.  Or another way to just assign each text box outside of using a list view/asp.net control.  Ultmaltely I want it to look like this.

male X   |   Female  |  Drive X  

Car X      |   Truck X  | Tickets X

The x's standing for the check boxes.  All this data is in one row from SQL/  Any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2008

Commented:
I can't quite see how you want to combine the 30 columns into 2 or 3 rows.  Would that example be 6 values in 2 rows?  

What kind of interaction with the grid is required?  This looks like a good job for a Repeater or a ListView control.

Author

Commented:
Yeah i had that backwards.  I have one row with 30 check boxes and I want to be able to show them on one page without having to scroll.  Only 1 record will ever be returned (row) but each row will have 30 check boxes.
Most Valuable Expert 2012
Top Expert 2008

Commented:
If you use a ListView, you can lay out the CheckBox controls in a group of m rows by n columns.

Using GroupTemplate in ASP.Net ListView Control(Tiled Display)
http://www.codedigest.com/Articles/ASPNET/330_Using_GroupTemplate_in_ASPNet_ListView_Control.aspx

Author

Commented:
Thats not going to do it.
1 row 30 check boxes X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X
And a description in front of each one.
Most Valuable Expert 2012
Top Expert 2008

Commented:
I don't understand, because you said, "I want to be able to show them on one page without having to scroll."  Can you show me the HTML for the GridView that you have now, please?

Author

Commented:
<asp:GridView ID="GridView1" AutoGenerateColumns="false" runat="server">
                <Columns>
                        <asp:TemplateField>
                                <HeaderTemplate>
                                        <table>
                                                <tr>
                                                        <td>
                                                                Approver
                                                        </td>
                                                        <td>
                                                                Status
                                                        </td>
                                                </tr>
                                                <tr>
                                                        <td>
                                                                Comments
                                                        </td>
                                                </tr>
                                        </table>
                                </HeaderTemplate>
                                <ItemTemplate>
                                        <table>
                                                <tr>
                                                        <td>
                                                                <%# Eval("Approver")%>
                                                        </td>
                                                        <td>
                                                                <%# Eval("Status")%>
                                                        </td>
                                                </tr>
                                                <tr>
                                                        <td>
                                                                <%# "Comments :" +Eval("Comments").ToString() %>
                                                        </td>
                                                </tr>
                                        </table>
                                </ItemTemplate>
                        </asp:TemplateField>
                </Columns>
        </asp:GridView>

Author

Commented:
My above code might work.  I have attached an example it is an Exaggeration  but they would be smaller and fit in a 6x4 area.
Most Valuable Expert 2012
Top Expert 2008

Commented:
I don't see any check boxes...

Author

Commented:
Here is an exaggeration
Capture.PNG
Most Valuable Expert 2012
Top Expert 2008
Commented:
We are clearly not on the same wavelength.  That is an image with 3 check boxes all on the same row.  You showed me HTML for a GridView, but I have no idea where you want the check boxes to go.  

It seems like, on the surface, that you need a Repeater in the GridView.ItemTemplate with a RepeatDirection, RepeatColumns, and RepeatLayout properties set.

Author

Commented:
Got it thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial