It is working fine with bound column. If it autogenerate columns then not able to get columnindex. pls. help........
Thanks,
Viji.S
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread : )
It is working fine with bound column. If it autogenerate columns then not able to get columnindex. pls. help........
Thanks,
Viji.S
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread : )
I'm a very new user of ASP.NET and have some VB experience but no C.
I want to produce a simple list grouped by a datetime field but formated as shown below and not include the date field in the individual lines. As below:
What you guys have done is obviously very close to this but can you help me on how to get a VB version and perform the formatting?
PriyanViji
Member
68 Points
85 Posts
Re: Group rows in gridview?
Mar 19, 2009 04:55 AM|LINK
Thanks for great source....
It is working fine with bound column. If it autogenerate columns then not able to get columnindex. pls. help........
Thanks,
Viji.S
PriyanViji
Member
68 Points
85 Posts
Re: Group rows in gridview?
Mar 19, 2009 05:10 AM|LINK
Thanks for great source....
It is working fine with bound column. If it autogenerate columns then not able to get columnindex. pls. help........
Thanks,
Viji.S
RugbyJohn
Member
67 Points
114 Posts
Re: Group rows in gridview?
Feb 15, 2010 03:46 PM|LINK
Hi Ian/Agrinei
I'm a very new user of ASP.NET and have some VB experience but no C.
I want to produce a simple list grouped by a datetime field but formated as shown below and not include the date field in the individual lines. As below:
What you guys have done is obviously very close to this but can you help me on how to get a VB version and perform the formatting?
Ta.
John
My current gridview code is as below
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333" GridLines="None" Caption="Fixtures this week" CaptionAlign="Left" Font-Bold="True">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="Team" HeaderText="Team" SortExpression="Team" />
<asp:TemplateField HeaderText="Date" SortExpression="MatchDate">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MatchDate") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("MatchDate", "{0:MMM d, yyy }") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="K.O." SortExpression="KickOff">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("KickOff") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("KickOff", "{0:H:mm}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Venue" HeaderText="H/A" SortExpression="Venue" />
<asp:BoundField DataField="Opposition" HeaderText="Opposition" SortExpression="Opposition" />
<asp:BoundField DataField="Result" HeaderText="Result" SortExpression="Result" />
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<br />
<asp:GridView ID="GridView2" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" CellPadding="4" ForeColor="#333333" GridLines="None" Caption="Recent matches/results" CaptionAlign="Left" Font-Bold="True">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="Team" HeaderText="Team" SortExpression="Team" />
<asp:TemplateField HeaderText="Date" SortExpression="MatchDate">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MatchDate") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("MatchDate", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Venue" HeaderText="H/A" SortExpression="Venue" />
<asp:BoundField DataField="Opposition" HeaderText="Opposition" SortExpression="Opposition" />
<asp:BoundField DataField="Result" HeaderText="Result" SortExpression="Result" />
<asp:BoundField DataField="Score" HeaderText="Score" SortExpression="Score" />
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>