Group fields

I was wondering if its possible to group fields in a dataview. This is only a cosmetic issue so that the user can distinuish between sets of columns. I am not able to place a a fieldset in a <fields> tag .... just need create a square around the relevant fields.
<Fields>
                            <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" InsertVisible="False"
                                ReadOnly="True" />
                            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                            <asp:BoundField DataField="MarketingOwner" HeaderText="MarketingOwner" SortExpression="MarketingOwner" />
                            <asp:BoundField DataField="CallCentre" HeaderText="CallCentre" SortExpression="CallCentre" />
                            <asp:BoundField DataField="Recruiter" HeaderText="Recruiter" SortExpression="Recruiter" />
                            <asp:BoundField DataField="Amended" HeaderText="Amended" SortExpression="Amended"
                                ReadOnly="True" />
</fields>

Open in new window

simshpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Muhammad Ousama GhazaliSolution Analyst & ArchitectCommented:
I'll try to look deeper, however for the time being you can set ControlStyle-BackColor or ControlStyle-BorderWidth or other style properties on the fields to mark/distinguish them.
0
wht1986Commented:
Not by individual fields as shown, but you could make a template column, then place multiple controls/labels inside a panel or table within that single column.
<asp:GridView ID="GridView1" runat="server">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:Panel ID="Panel1" runat="server" BorderStyle="Solid" BackColor="Black" BorderWidth="1">
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("Fields1") %>' />
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("Fields2") %>' />
                </asp:Panel>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:Panel ID="Panel1" runat="server" BorderStyle="Solid" BackColor="Black" BorderWidth="1">
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Fields1") %>' />
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Fields2") %>' />
                </asp:Panel>
            </EditItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Muhammad Ousama GhazaliSolution Analyst & ArchitectCommented:
Please if the following might be an option with your requirements:

<asp:TemplateField HeaderText="">
	<HeaderTemplate>
		<table border="1" width="100%" cellpadding="0" cellspacing="0" style="border-width: 1px;">
			<tr>
				<th>Id</th>
				<th>Name</th>
				<th>Marketing Owner</th>
				<th>Call Centre</th>
				<th>Recruiter</th>
				<th>Amended</th>
			</tr>
		</table>
	</HeaderTemplate>
	<ItemTemplate>
		<fieldset style="border: solid 2px maroon; background-color: ivory;">							
		<table border="1" width="100%" cellpadding="0" cellspacing="0" style="border-width: 1px;">
			<tr>
				<td><asp:Label ID="Label7" runat="server" Text='<%# Eval("Id") %>'></asp:Label></td>
				<td><asp:Label ID="lblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label></td>
				<td><asp:Label ID="Label3" runat="server" Text='<%# Bind("MarketingOwner") %>'></asp:Label></td>
				<td><asp:Label ID="Label4" runat="server" Text='<%# Bind("CallCentre") %>'></asp:Label></td>
				<td><asp:Label ID="Label5" runat="server" Text='<%# Bind("Recruiter") %>'></asp:Label></td>
				<td><asp:Label ID="Label6" runat="server" Text='<%# Eval("Amended") %>'></asp:Label></td>
			</tr>
		</table>								
		</fieldset>
	</ItemTemplate>
</asp:TemplateField>

Open in new window

0
simshpAuthor Commented:
Thanks for this
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.