Hi
I have a grouped grid and I am trying to prevent the groups from being collapsed by hiding the expand collapse button. I have followed the info in the help file and i have tried both approaches (column created event and grid pre render event) but the column is refusing to disappear!
The code is detecting the GridGroupSplitterColumn in both cases but it is not affecting the column appearance. In fact i can't make the column any bigger in those code snippets either.
I have set the client side resizable property to true
Here is the grid in case there are any pertinent properties you need to see there
I am using q3 2008.
many thanks
I have a grouped grid and I am trying to prevent the groups from being collapsed by hiding the expand collapse button. I have followed the info in the help file and i have tried both approaches (column created event and grid pre render event) but the column is refusing to disappear!
Protected Sub gridJourneys_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles gridJourneys.ColumnCreated |
If TypeOf e.Column Is GridGroupSplitterColumn Then |
e.Column.HeaderStyle.Width = Unit.Pixel(0) |
e.Column.HeaderStyle.Font.Size = FontUnit.Point(0) |
e.Column.ItemStyle.Width = Unit.Pixel(0) |
e.Column.ItemStyle.Font.Size = FontUnit.Point(0) |
e.Column.Resizable = False |
End If |
End Sub |
Private Sub gridJourneys_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles gridJourneys.PreRender |
For Each column As GridColumn In gridJourneys.MasterTableView.RenderColumns |
If (TypeOf column Is GridGroupSplitterColumn) Then |
column.HeaderStyle.Width = Unit.Pixel(0) |
column.HeaderStyle.Font.Size = FontUnit.Point(0) |
column.ItemStyle.Width = Unit.Pixel(0) |
column.ItemStyle.Font.Size = FontUnit.Point(0) |
column.Resizable = False |
End If |
Next |
End Sub |
The code is detecting the GridGroupSplitterColumn in both cases but it is not affecting the column appearance. In fact i can't make the column any bigger in those code snippets either.
I have set the client side resizable property to true
Here is the grid in case there are any pertinent properties you need to see there
<telerik:RadGrid ID="gridJourneys" runat="server" Width="960px" AutoGenerateColumns="False" GridLines="None" skin="SkyBlue"> |
<MasterTableView DataKeyNames="JourneyID" CommandItemDisplay="Top" Name="Journeys" ShowFooter="True" ShowGroupFooter="True" > |
<CommandItemTemplate> |
<table cellpadding="5" cellspacing="0"> |
<tr> |
<td colspan="2"> <span class="title"><asp:Label ID="lblTitle" runat="server" Text="Title"></asp:Label></span> </td> |
</tr> |
<tr> |
<td>No Journeys</td> |
<td><asp:Label ID="lblNoJourneys" runat="server"></asp:Label></td> |
</tr> |
<tr> |
<td>Total Distance</td> |
<td><asp:Label ID="lblTotalDistance" runat="server"></asp:Label></td> |
</tr> |
<tr> |
<td>Total Time</td> |
<td><asp:Label ID="lblTotalDuration" runat="server"></asp:Label></td> |
</tr> |
</table> |
<br /> |
</CommandItemTemplate> |
<NoRecordsTemplate> |
There are no journeys on this date. |
</NoRecordsTemplate> |
<GroupByExpressions> |
<telerik:GridGroupByExpression> |
<SelectFields> |
<telerik:GridGroupByField FieldName="StartDate" FieldAlias="StartDate" FormatString="" HeaderText=""/> |
<telerik:GridGroupByField FieldAlias="TotalDistance" Aggregate="Sum" FieldName="DistanceTravelled" FormatString="" HeaderText="" /> |
<telerik:GridGroupByField FieldAlias="TotalTime" Aggregate="Sum" FieldName="TimeTakenInSeconds" FormatString="" HeaderText="" /> |
<telerik:GridGroupByField FieldAlias="Count" Aggregate="Count" FieldName="JourneyID" FormatString="" HeaderText="" /> |
</SelectFields> |
<GroupByFields> |
<telerik:GridGroupByField FieldName="StartDate" FieldAlias="StartDate" FormatString="" HeaderText=""/> |
</GroupByFields> |
</telerik:GridGroupByExpression> |
</GroupByExpressions> |
<Columns> |
<telerik:GridBoundColumn DataField="JourneyID" Aggregate="Count" Visible="False" FooterAggregateFormatString="{0}" UniqueName="JourneyID"></telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="StartDateTime" DataFormatString="{0:dd/MM/yy HH:mm}" HeaderText="Start Time" UniqueName="StartDateTime"> |
<ItemStyle Width="100px" /> |
</telerik:GridBoundColumn> |
<telerik:GridTemplateColumn HeaderText="Start Location" UniqueName="StartLocation"> |
<ItemTemplate> |
<asp:label runat="server" id="lblStartLocation"/> |
</ItemTemplate> |
<ItemStyle Width="280px" /> |
</telerik:GridTemplateColumn> |
<telerik:GridBoundColumn DataField="EndDateTime" DataFormatString="{0:dd/MM/yy HH:mm}" HeaderText="End Time" UniqueName="EndDateTime"> |
<ItemStyle Width="100px" /> |
</telerik:GridBoundColumn> |
<telerik:GridTemplateColumn HeaderText="End Location" UniqueName="EndLocation" > |
<ItemTemplate> |
<asp:label runat="server" id="lblEndLocation"/> |
</ItemTemplate> |
<ItemStyle Width="280px" /> |
</telerik:GridTemplateColumn> |
<telerik:GridBoundColumn DataField="TimeTakenInSeconds" DataFormatString="{0}" UniqueName="TimeTakenInSeconds" Aggregate="Sum" FooterAggregateFormatString="{0}" Visible="False" > |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn HeaderText="Duration" DataField="TimeTaken" UniqueName="TimeTaken"> |
<ItemStyle Width="100px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="DistanceTravelled" DataFormatString="{0:F2}" HeaderText="Distance" UniqueName="DistanceTravelled" Aggregate="Sum" FooterAggregateFormatString="{0:F2}"> |
<ItemStyle Width="100px" /> |
</telerik:GridBoundColumn> |
</Columns> |
</MasterTableView> |
<HeaderContextMenu EnableEmbeddedSkins="False" Skin="SureTrack"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</HeaderContextMenu> |
<ClientSettings> |
<Resizing AllowColumnResize="True" /> |
</ClientSettings> |
<FilterMenu EnableEmbeddedSkins="False" Skin="SureTrack"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</FilterMenu> |
</telerik:RadGrid> |
I am using q3 2008.
many thanks