This is a migrated thread and some comments may be shown as answers.

[Solved] Grouping problem when Headers are frozen.

2 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Milan Gurung
Top achievements
Rank 1
Milan Gurung asked on 28 Apr 2009, 01:30 PM
Hi,

I have a situation where I have to keep grid header frozen. The trouble is horizontal scoll bar gets lost when when grouping is done by a column. Grid tries to squeeze all columns present in the template column.When I try to resize the columns in the templated column error is thrown.

I have got a radGrid and for some reason I have to have table inside a column. This particular column is giving me a headache.

Any help is deeply appreciated.


Please see the codesnippet below -

<telerik:RadGrid ID="gridRebate" runat="server" Skin="Office2007" BorderWidth="0px"
    AutoGenerateColumns="false" AllowPaging="True" PageSize="500" AllowSorting="True">
        <AlternatingItemStyle BackColor="AliceBlue" Font-Names="Verdana" Font-Size="8pt" />
        <ItemStyle Font-Names="Verdana" Font-Size="8pt" />
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                <Resizing AllowRowResize="false" AllowColumnResize="True"></Resizing>
                <Scrolling FrozenColumnsCount="8" SaveScrollPosition="true" UseStaticHeaders="true"  AllowScroll="true"/>
       </ClientSettings>
        <MasterTableView TableLayout="auto">
        <Columns>
        <telerik:GridBoundColumn DataField="SupVendor" HeaderText="Supplier/Vendor"></telerik:GridBoundColumn>
        <telerik:GridTemplateColumn UniqueName="RebateDeal" Groupable="false">
              <HeaderTemplate>
               <table id="Table1" cellspacing="1" cellpadding="1" width="300" border="0">
                <tr>
                 <td colspan="2" align="center">Rebate Deal</td>
                </tr>
                <tr>
                 <td style="width:35%"></td>
                 <td style="width:35%"></td>
                 <td style="width:25%"></td>
                 <td style="width:10%"></td>
                </tr>
               </table>
              </HeaderTemplate>
              <ItemTemplate>
               <table id="Table2" cellspacing="1" cellpadding="1" width="300" border="0" style="background-color:#ccff99">
                <tr>
                 <td style="width:35%"><%#DataBinder.Eval(Container.DataItem, "RangeSpendFrom")%></td>
                 <td style="width:35%"><%# DataBinder.Eval(Container.DataItem, "RangeSpendTo") %></td>
                 <td style="width:25%"><%#DataBinder.Eval(Container.DataItem, "RebatePercent")%></td>
                 <td style="width:10%" id="RebateType"><%#DataBinder.Eval(Container.DataItem, "RebateType")%></td>
                </td>
               </tr>
               </table>
      </ItemTemplate>
     </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="GRInvoice" HeaderText="GR/Inv." Display="false"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Spend" HeaderText="Spend" UniqueName="Spend"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="EstimatedRebate" HeaderText="Estimated Rebate" UniqueName="EstimatedRebate"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="GainedRebatePercent" HeaderText="%" UniqueName="GainedRebatePercent"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="SpendToNextLevel" HeaderText="Spend To Next Level" UniqueName="SpendToNextLevel"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="AdditionalRebate" HeaderText="Additional Rebate" UniqueName="AdditionalRebate"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="AdditionalRebatePercent" HeaderText="%" UniqueName="AdditionalRebatePercent"></telerik:GridBoundColumn>
        </Columns>
            <RowIndicatorColumn Visible="True">
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
        </MasterTableView>
        <FilterMenu EnableTheming="True" Skin="Web20">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </FilterMenu>
        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
    </telerik:RadGrid>

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 04 May 2009, 02:34 PM
Hello Milan,

Generally you should set TableLayout="Fixed" of RadGrid and set proper Width of every column in RadGrid.
For your convenience I am attaching sample project. Please find the attached project.

Greetings,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Milan Gurung
Top achievements
Rank 1
answered on 05 May 2009, 09:03 AM
Many thanks Nicolay.

Cheers,
Milan G
Tags
Grid
Asked by
Milan Gurung
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Milan Gurung
Top achievements
Rank 1
Share this question
or