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

RadGrid Frozen Columns problem

1 Answer 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Oleksandr
Top achievements
Rank 1
Oleksandr asked on 29 Oct 2010, 05:17 AM
Hi,
In my aspx page I defined radgrid which has 3 static template columns:

<telerik:RadGrid ID="radgrdDocumentsNew" AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="false"
                                                AutoGenerateColumns="false" PageSize="50" runat="server" OnDataBound="radgrdDocuments_DataBound"
                                                OnItemDataBound="radgrdDocuments_ItemDataBound" OnDetailTableDataBind="radgrdDocuments_DetailTableDataBind"
                                                GridLines="Vertical" Width="100%" OnSortCommand="radgrdDocuments_SortCommand"
                                                OnPageIndexChanged="radgrdDocuments_PageIndexChanged" OnPageSizeChanged="radgrdDocuments_PageSizeChanged"
                                                OnColumnCreated="radgrdDocuments_ColumnCreated" OnItemCommand="radgrdDocuments_ItemCommand"
                                                EnableViewState="false">
                                                <MasterTableView BorderStyle="None" DataKeyNames="Paperclip" BorderWidth="0" TableLayout="Auto"
                                                    Width="100%">
                                                    <Columns>
                                                        <telerik:GridTemplateColumn UniqueName="TemplateColumnSelect" Groupable="False" ItemStyle-HorizontalAlign="Center"
                                                            HeaderStyle-HorizontalAlign="Center">
                                                            <HeaderTemplate>
                                                                <asp:CheckBox ID="chkSelectAll" ToolTip="Select All" runat="server" OnCheckedChanged="docSelectedAll_CheckedChanged"
                                                                    AutoPostBack="True" />
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:CheckBox ID="chkSelect" runat="server" OnCheckedChanged="docSelected_CheckedChanged"
                                                                    AutoPostBack="True" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn UniqueName="TemplateColumnPaperclipIcon" Groupable="False"
                                                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="ibtnPaperclip" runat="server" ImageUrl="~/Images/clip.gif" ToolTip="Paperclip"
                                                                    AlternateText="Paperclip" CommandName="ExpandCollapse" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn UniqueName="TemplateColumnAction" HeaderText="Action"
                                                            Groupable="False" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left"
                                                            ItemStyle-Wrap="False">
                                                            <ItemTemplate>
                                                                <div style="width: 100%; float: left;">
                                                                    <asp:HyperLink ID="lnkViewEditMetadata" runat="server" ImageUrl="~/Images/editicon.gif"
                                                                        ToolTip="Metadata" AlternateText="Metadata" />
                                                                    <asp:ImageButton ID="ibtnViewDocument" runat="server" ImageUrl="~/Images/document.gif"
                                                                        ToolTip="View Document" AlternateText="View Document" />
                                                                </div>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                                </MasterTableView>
                                                <HeaderContextMenu>
                                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                                </HeaderContextMenu>
                                                <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="True" />
                                                <ClientSettings>
                                                    <Scrolling AllowScroll="True" FrozenColumnsCount="3" ScrollHeight="200px" UseStaticHeaders="true" SaveScrollPosition="True">
                                                    </Scrolling>
                                                </ClientSettings>
                                                <FilterMenu>
                                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                                </FilterMenu>
                                            </telerik:RadGrid>

The rest of the columns is added at run-time from C# code behind.
Now the problem is that those 3 first columns are not frozen and move to the left when I scroll to the right.
Please, help.

Thanks,
Alex

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 29 Oct 2010, 08:58 AM
Hello Oleksandr,

RadGrid does not support mixing declarative grid columns with grid columns added dynamically at runtime. You should either create all the columns in the grid programmatically, or else define them all in the ASPX file. Refer to this help article for more information.

Sincerely yours,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Oleksandr
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or