Some columns are not displaying(missing) in rad grid.

7 posts, 0 answers
  1. Venkatesh
    Venkatesh avatar
    21 posts
    Member since:
    Jul 2014

    Posted 18 Aug 2014 Link to this post

    Hi,

    I am using radgrid which is having multiple groups (5), each group is having 10 columns. My rad grid having following properties :

    . Frozen Columns.
    . Grouping.
    . Scrolling.
    . TableLayout="Fixed" for MasterTableView.

    If i set width for radgrid 100% its crossing the screen. If i reduces the with % my radgrid columns are collapsing and some of the groups not displaying. If i set width in pixels for radgrid, individual column groups, HeaderStyle-Width and  ItemStyle-Width some of the columns are displaying in the last group.

    Can any one help on this. Thanks in advance.

    Regards,
    Venkatesh.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Aug 2014 in reply to Venkatesh Link to this post

    Hi Venkatesh,

    Its hard to identify the issue with this much information, can you please provide your full code snippet. Make sure you don't have an outer container whose width is causing the Grid to occupy its 100%. Also please note all column widths should be set by using HeaderStyle-Width only. No ItemStyle-Width.

    Thanks,
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Venkatesh
    Venkatesh avatar
    21 posts
    Member since:
    Jul 2014

    Posted 19 Aug 2014 Link to this post

    Hi Princy,

    Below is my sample code. Scrolling not working across the last Group Name of radgrid, its displaying only few columns from last group.


     <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
                <telerik:RadGrid ID="uxGlobalBridgeRadGrid" runat="server" AutoGenerateColumns="false" Width="1600px" GridLines="None"
                    EnableTheming="false" OnBatchEditCommand="uxGlobalBridgeRadGrid_BatchEditCommand" OnItemDataBound="uxGlobalBridgeRadGrid_ItemDataBound" OnItemCommand="uxGlobalBridgeRadGrid_ItemCommand">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Right" />
                    <AlternatingItemStyle HorizontalAlign="Right" />
                    <MasterTableView EnableHeaderContextMenu="true" EditMode="Batch" CommandItemDisplay="Bottom" TableLayout="Fixed" DataKeyNames="Q1DtID,Q2DtID,Q3DtID,Q4DtID,ViewType">
                        <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="false" />
                        <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click" />
                        <ColumnGroups>
                            <telerik:GridColumnGroup Name="JobBridge">
                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                            </telerik:GridColumnGroup>                        
                            <telerik:GridColumnGroup HeaderText="Q1 Ending 2015" Name="Q1">
                                <HeaderStyle HorizontalAlign="Center" Width="1000px" />
                            </telerik:GridColumnGroup>
                            <telerik:GridColumnGroup HeaderText="Q2 Ending 2015" Name="Q2">
                                <HeaderStyle HorizontalAlign="Center" Width="1000px" />
                            </telerik:GridColumnGroup>
                            <telerik:GridColumnGroup HeaderText="Q3 Ending 2015" Name="Q3">
                                <HeaderStyle HorizontalAlign="Center" Width="1000px" />
                            </telerik:GridColumnGroup>
                            <telerik:GridColumnGroup HeaderText="Q4 Ending 2015" Name="Q4">
                                <HeaderStyle HorizontalAlign="Center" Width="1000px" />
                            </telerik:GridColumnGroup>
                            <telerik:GridColumnGroup HeaderText="FY15 Total" Name="FYT">
                                <HeaderStyle HorizontalAlign="Center" Width="1000px" />
                            </telerik:GridColumnGroup>
                        </ColumnGroups>
                        <Columns>
                            <telerik:GridBoundColumn DataField="ViewType" ColumnGroupName="JobBridge" HeaderStyle-Width="150px" ItemStyle-HorizontalAlign="Left" ReadOnly="true"></telerik:GridBoundColumn>
                                                  
                            <telerik:GridTemplateColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" UniqueName="Q1_Start_Head_Count" HeaderText="Starting Head Count" DataField="Q1StartHeadCount">
                                <EditItemTemplate>                              
                                    <telerik:RadNumericTextBox Width="60%" runat="server" ID="uxQ1StartHCNumTextBox"></telerik:RadNumericTextBox>                              
                                </EditItemTemplate>
                                <ItemTemplate>                              
                                    <asp:Label runat="server" Width="100%" ID="uxQ1StartHCLabel" Text='<%# Eval("ViewType") == "LCV" ? Eval("Q1StartHeadCount","{0:C}") : Eval("Q1StartHeadCount") %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" UniqueName="Q1_Hires" HeaderText="Hires" DataField="Q1Hires">
                                <ItemTemplate>
                                    <asp:Label ID="uxQ1HiresLabel" Width="100%" runat="server" Text='<%# Eval("ViewType") == "LCV" ? Eval("Q1Hires", "{0:C}") : Eval("Q1Hires") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox Width="60%" runat="server" ID="uxQ1HiresNumTextBox"></telerik:RadNumericTextBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" UniqueName="Q1_Voluntary_Exits" HeaderText="Voluntary Exits" DataField="Q1VoluntaryExists">
                                <ItemTemplate>
                                    <asp:Label ID="uxQ1VolExistsLabel" Width="100%" runat="server" Text='<%# Eval("ViewType") == "LCV" ? Eval("Q1VoluntaryExists", "{0:C}") : Eval("Q1VoluntaryExists") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox Width="60%" runat="server" ID="uxQ1VolExistsNumTextBox"></telerik:RadNumericTextBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" UniqueName="Q1_Involuntary_Exists" HeaderText="Involuntary Exists" DataField="Q1InvoluntaryExists">
                                <ItemTemplate>
                                    <asp:Label ID="uxQ1InvolExistsLabel" Width="100%" runat="server" Text='<%# Eval("ViewType") == "LCV" ? Eval("Q1InvoluntaryExists", "{0:C}") : Eval("Q1InvoluntaryExists") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox Width="60%" runat="server" ID="uxQ1InvolExistsNumTextBox"></telerik:RadNumericTextBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" UniqueName="Q1_Salary_Increase" HeaderText="Salary Increase" DataField="Q1SalaryIncrease">
                                <ItemTemplate>
                                    <asp:Label ID="uxQ1SalaryIncreaseLabel" Width="100%" runat="server" Text='<%# Eval("ViewType") == "LCV" ? Eval("Q1SalaryIncrease", "{0:C}") : Eval("Q1SalaryIncrease") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox Width="60%" runat="server" ID="uxQ1SalaryIncreaseNumTextBox" ></telerik:RadNumericTextBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" UniqueName="Q1_Other" HeaderText="Other" DataField="Q1Other">
                                <ItemTemplate>
                                    <asp:Label ID="uxQ1OtherLabel" Width="100%" runat="server" Text='<%# Eval("ViewType") == "LCV" ? Eval("Q1Other", "{0:C}") : Eval("Q1Other") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox Width="60%" runat="server" ID="uxQ1OtherNumTextBox"></telerik:RadNumericTextBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" UniqueName="Q1_End_Head_Count" HeaderText="Ending Head Count" DataField="Q1EndHeadCount">
                                <ItemTemplate>
                                    <asp:Label ID="uxQ1EndHCLabel" Width="100%" runat="server" Text='<%# Eval("ViewType") == "LCV" ? Eval("Q1EndHeadCount", "{0:C}") : Eval("Q1EndHeadCount") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox Width="60%" runat="server" ID="uxQ1EndHCNumTextBox"></telerik:RadNumericTextBox>                                 
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" UniqueName="Q1_Avg_Sal_PTB" HeaderText="Avg Salary" DataField="Q1AvgSalPTB">
                                <ItemTemplate>
                                    <asp:Label ID="uxQ1AvgSalPTBCLabel" Width="100%" runat="server" Text='<%# Eval("ViewType") == "LCV" ? Eval("Q1AvgSalPTB", "{0:C}") : Eval("Q1AvgSalPTB") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox Width="60%" runat="server" ID="uxQ1AvgSalPTBNumTextBox"></telerik:RadNumericTextBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridCalculatedColumn HeaderStyle-Width="100px" ColumnGroupName="Q1" HeaderText="Total Salary +PTB" UniqueName="Q1_Tot_Salary_PTB" DataType="System.Double" Aggregate="Sum"
                                DataFields="Q1Other, Q1AvgSalPTB" Expression="iif({0}=null or {0}=0 or {1}=null or {1}=0,0,({0}*{1}))" DataFormatString="{0:C}">
                            </telerik:GridCalculatedColumn>
                            
                        ....... // like that 4 more groups(with 9 columns) are there.
                        
                        
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowKeyboardNavigation="true">
                        <ClientEvents OnBatchEditOpening="batchEditOpening" />                 
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="1"></Scrolling>
                    </ClientSettings>
                </telerik:RadGrid>

    Regards,
    Venkatesh.
  5. Venkatesh
    Venkatesh avatar
    21 posts
    Member since:
    Jul 2014

    Posted 19 Aug 2014 Link to this post

    Its displaying all the table data (td), but table headers(th) are not displaying completely.

    eg:
    th1  th2  th3  th4  th5 th6  th7  th8  th9
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

    table data is moving left irrespective of th. so till when the td completes till that place th is displaying.
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Aug 2014 in reply to Venkatesh Link to this post

    Hi Venkatesh,

    Can you try removing the FrozenColumnsCount property from your RadGrid. MultiColumn headers donot support frozen columns.

    Thanks,
    Princy
  7. Venkatesh
    Venkatesh avatar
    21 posts
    Member since:
    Jul 2014

    Posted 20 Aug 2014 Link to this post

    Hi,

    I tried that, but still same problem.

    Regards,
    Venkatesh.
  8. Venelin
    Admin
    Venelin avatar
    352 posts

    Posted 22 Aug 2014 Link to this post

    Hi Venkatesh,

    I tried to replicate the issue on my side but with no avail. Therefore I created a sample test page based on the provided code. Could you please examine it and tell if you replicate the same problem with it. If not, please try to identify the relevant differences between the sample and your real project and share them. In this manner we might be able to find the source of the problem at your end.

    In the mean time you can check for JavaScript errors (if there are any listed in browser's console) and disable custom styles if any on the page.

    Regards,
    Venelin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017