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

Grid Header Display incorrectly with Frozen Header

0 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Warot
Top achievements
Rank 1
Warot asked on 06 Jun 2017, 08:39 AM

I try to use FrozenColumn for Grid after Read Demo. But when I apply FrozenColumn & UseStaticHeader, Column will always display only with match width of grid (Other column will lost) and When Scroll, only data will scroll while header still the same (that doesn't match with data column). Freeze column doesn't work too.

 

I have attached picture of My Grid (I using Simple Databinding) , "Initial" is when data loaded and "Scrolled" is when I scrolled Horizontal.

 

Below is my code 

<telerik:RadGrid ID="RadGridBudgetDataEntry" runat="server" AutoGenerateColumns="False"
                                     CellSpacing="-1" GridLines="Both" AllowSorting="True"
                                    AllowPaging="True" PageSize="20" Width="800px" Height="500px"
                                    OnItemDataBound="RadGridBudgetDataEntry_ItemDataBound">
                        <ClientSettings>
                            <Scrolling  AllowScroll="True" SaveScrollPosition="true" UseStaticHeaders="true"
                                        FrozenColumnsCount="1" >
                            </Scrolling>
                        </ClientSettings>
                        <MasterTableView TableLayout="Fixed">
                            <Columns>
                                <telerik:GridTemplateColumn DataField="AccountCode" FilterControlAltText="Filter TemplateColumn column" HeaderText="Code" ReadOnly="True" UniqueName="AccountCode" HeaderStyle-Width="200px">
                                    <ItemTemplate>
                                        <telerik:RadLabel ID="RadLabelAccountCode2" runat="server" Text='<%# Eval("AccountCode") %>'>
                                        </telerik:RadLabel>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridTemplateColumn>
 
                                <telerik:GridTemplateColumn DataField="AccountName" FilterControlAltText="Filter TemplateColumn1 column" HeaderText="Full Description" UniqueName="AccountName" HeaderStyle-Width="200px">
                                    <ItemTemplate>
                                        <telerik:RadLabel ID="RadLabelAccountName" runat="server" Text='<%# Eval("AccountName") %>'>
                                        </telerik:RadLabel>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center"/>
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridTemplateColumn>
 
                                <telerik:GridTemplateColumn DataField="Jan_Amt" FilterControlAltText="Filter TemplateColumn1 column" HeaderText="Jan" UniqueName="Jan_Amt" HeaderStyle-Width="200px">
                                    <ItemTemplate>
                                        <telerik:RadLabel ID="RadLabelJan_Amt" runat="server" Text='<%# Eval("Jan_Amt") %>'>
                                        </telerik:RadLabel>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridTemplateColumn>
 
                                <telerik:GridTemplateColumn DataField="Feb_Amt" FilterControlAltText="Filter TemplateColumn1 column" HeaderText="Feb" UniqueName="Feb_Amt" HeaderStyle-Width="200px">
                                    <ItemTemplate>
                                        <telerik:RadLabel ID="RadLabelFeb_Amt" runat="server" Text='<%# Eval("Feb_Amt") %>'>
                                        </telerik:RadLabel>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridTemplateColumn>
 
                                <telerik:GridTemplateColumn DataField="Mar_Amt" FilterControlAltText="Filter TemplateColumn1 column" HeaderText="Mar" UniqueName="Mar_Amt" HeaderStyle-Width="200px">
                                    <ItemTemplate>
                                        <telerik:RadLabel ID="RadLabelMar_Amt" runat="server" Text='<%# Eval("Mar_Amt") %>'>
                                        </telerik:RadLabel>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center"/>
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridTemplateColumn>
 
                                <telerik:GridTemplateColumn DataField="Apr_Amt" FilterControlAltText="Filter TemplateColumn1 column" HeaderText="Apr" UniqueName="Apr_Amt" HeaderStyle-Width="200px">
                                    <ItemTemplate>
                                        <telerik:RadLabel ID="RadLabelApr_Amt" runat="server" Text='<%# Eval("Apr_Amt") %>'>
                                        </telerik:RadLabel>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center"/>
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridTemplateColumn>
 
                                 
 
                            </Columns>
                        </MasterTableView>
                        <PagerStyle PageSizeControlType="RadDropDownList" Mode="NextPrevAndNumeric"></PagerStyle>
                    </telerik:RadGrid>

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Warot
Top achievements
Rank 1
Share this question
or