Remove white space at end of Column while resize

13 posts, 0 answers
  1. ramkumar
    ramkumar avatar
    18 posts
    Member since:
    Apr 2011

    Posted 29 Aug 2011 Link to this post

    Hi All,

    Below is my code.Please see the screen shot for my issue

    <

     

    radG:RadGrid AllowMultiRowSelection="true" ID="RadGrid1" runat="server" GridLines="None"

     

     

    AutoGenerateColumns="False" Skin="Outlook" Width="100%" AllowPaging="True" PageSize="50"

     

     

    AllowFilteringByColumn="true" AllowSorting="true"

     

     

    OnItemDataBound="RadGrid1_ItemDataBound1"

     

     

    OnItemCommand="RadGrid1_ItemDataBound1" OnDeleteCommand="RadGrid1_DeleteCommand"

     

     

    OnPageIndexChanged="RadGrid1_PageIndexChanged" EnableHeaderContextMenu="true"

     

     

    AllowCustomPaging="false"

     

     

    OnPreRender="RadGrid1_PreRender" ItemStyle-Wrap="false" AlternatingItemStyle-Wrap="false" >

     

     

    <ExportSettings HideStructureColumns="true" />

     

     

    <MasterTableView CommandItemDisplay="Bottom" DataKeyNames="emp_code" TableLayout="Auto" Width="100%" >

     

     

    <PagerStyle Mode="Advanced" AlwaysVisible="true" />

     

     

    <FilterItemStyle HorizontalAlign="left" />

     

     

    <HeaderStyle ForeColor="Navy" />

     

     

     

     

    <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" ShowExportToCsvButton="true" />

     

     

     

    <AlternatingItemStyle BackColor="#E5E5E5" Height="20px" />

     

     

    <CommandItemTemplate>

     

     

    <div>

     

     

    <asp:Image ID="Image1" ImageUrl="../frames/images/toolbar/AddRecord.gif" runat="Server" />

     

     

    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/employee/AddEditEmployee.aspx"

     

     

    Font-Underline="true">Add New Employee</asp:HyperLink>

     

     

    </div>

     

     

    </CommandItemTemplate>

     

     

    <Columns>

     

     

    <radG:GridBoundColumn ShowFilterIcon="False" UniqueName="EmpCode" HeaderImageUrl="../frames/images/EMPLOYEE/Grid- employee.png"

     

     

    HeaderText="Emp Code" CurrentFilterFunction="StartsWith" DataField="emp_code"

     

     

    Display="false">

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn">

     

     

    <ItemTemplate>

     

     

    <asp:Image ID="Image2" ImageUrl="../frames/images/EMPLOYEE/Grid- employee.png" runat="Server" />

     

     

    </ItemTemplate>

     

    <%

    -- <HeaderStyle Width="30px" />--%>

     

     

    <HeaderStyle Width="3%" />

     

     

    </radG:GridTemplateColumn>

     

     

    <radG:GridTemplateColumn ShowFilterIcon="False" AllowFiltering="False" UniqueName="TemplateColumnEC"

     

     

    Display="false" HeaderText="Code" SortExpression="emp_code">

     

     

    <ItemTemplate>

     

     

    <asp:HyperLink runat="server" Text='<%# "DPT"+ DataBinder.Eval(Container.DataItem,"emp_code").ToString()%>'

     

     

    NavigateUrl='<%# "AddEditEmployee.aspx?empcode=" + DataBinder.Eval (Container.DataItem,"emp_code").ToString()%>'

     

     

    ID="empcode" />

     

     

    </ItemTemplate>

     

     

     

    <HeaderStyle HorizontalAlign="left" />

     

     

    </radG:GridTemplateColumn>

     

    <%

    -- <radG:GridTemplateColumn UniqueName="TCEmpName" HeaderText="Employee Name" SortExpression="emp_name" CurrentFilterFunction="contains" AutoPostBackOnFilter="true">

     

    <ItemTemplate>

    <asp:HyperLink runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"emp_name").ToString()%>'

    NavigateUrl='<%# "AddEditEmployee.aspx?empcode=" + DataBinder.Eval (Container.DataItem,"emp_code").ToString()%>'

    ID="empname" />

    </ItemTemplate>

    <HeaderStyle HorizontalAlign="left" />

    </radG:GridTemplateColumn>--

     

    %>

     

     

    <radG:GridBoundColumn ShowFilterIcon="False" UniqueName="emp_name" HeaderText="Employee Name"

     

     

    DataField="emp_name" CurrentFilterFunction="contains" AutoPostBackOnFilter="true">

     

     

    <HeaderStyle HorizontalAlign="left" />

     

    <%

    -- <HeaderStyle Width="300px" />--%>

     

     

    <HeaderStyle Width="25%" />

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridBoundColumn ShowFilterIcon="False" UniqueName="emp_type" HeaderText="Pass Type"

     

     

    DataField="emp_type" CurrentFilterFunction="contains" AutoPostBackOnFilter="true">

     

     

    <HeaderStyle HorizontalAlign="left" />

     

    <%

    -- <HeaderStyle Width="90px" />--%>

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridBoundColumn ShowFilterIcon="False" UniqueName="ic_pp_number" HeaderText="IC/FIN Number"

     

     

    DataField="ic_pp_number" CurrentFilterFunction="contains" AutoPostBackOnFilter="true">

     

     

    <HeaderStyle HorizontalAlign="left" />

     

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridBoundColumn ShowFilterIcon="False" UniqueName="empgroupname" HeaderText="Type"

     

     

    DataField="empgroupname" CurrentFilterFunction="contains" AutoPostBackOnFilter="true">

     

     

    <HeaderStyle HorizontalAlign="left" />

     

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridBoundColumn ShowFilterIcon="False" UniqueName="ID" HeaderText="Time Card ID"

     

     

    CurrentFilterFunction="contains" AutoPostBackOnFilter="true" DataField="time_card_no">

     

     

     

    <HeaderStyle HorizontalAlign="left" />

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridBoundColumn Display="true" ShowFilterIcon="False" UniqueName="Designation"

     

     

    HeaderText="Designation" DataField="Designation" CurrentFilterFunction="contains"

     

     

    AutoPostBackOnFilter="true">

     

     

    <HeaderStyle HorizontalAlign="left" />

     

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridBoundColumn Display="true" ShowFilterIcon="False" UniqueName="Department"

     

     

    HeaderText="Department" DataField="Department" CurrentFilterFunction="contains"

     

     

    AutoPostBackOnFilter="true">

     

     

    <HeaderStyle HorizontalAlign="left" />

     

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridBoundColumn Display="false" ShowFilterIcon="False" UniqueName="hand_phone"

     

     

    HeaderText="Mobile" DataField="hand_phone" CurrentFilterFunction="contains" AutoPostBackOnFilter="true">

     

     

    <HeaderStyle HorizontalAlign="left" />

     

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridBoundColumn Display="false" ShowFilterIcon="False" UniqueName="email" HeaderText="Email"

     

     

    DataField="email" CurrentFilterFunction="contains" AutoPostBackOnFilter="true">

     

     

    <HeaderStyle HorizontalAlign="left" />

     

     

    </radG:GridBoundColumn>

     

     

    <radG:GridTemplateColumn AllowFiltering="False" UniqueName="editHyperlink">

     

     

    <ItemTemplate>

     

     

    <tt class="bodytxt">

     

     

    <asp:ImageButton ID="btnedit" AlternateText="Edit" ImageUrl="../frames/images/toolbar/edit.gif"

     

     

    runat="server" />

     

     

    </ItemTemplate>

     

    <%

    -- <HeaderStyle Width="30px" />--%>

     

     

    <HeaderStyle Width="3%" />

     

     

    </radG:GridTemplateColumn>

     

     

    <radG:GridClientSelectColumn Visible="false" UniqueName="GridClientSelectColumn">

     

     

     

    </radG:GridClientSelectColumn>

     

     

    </Columns>

     

     

    </MasterTableView>

     

     

    <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" ReorderColumnsOnClient="true" >

     

     

    <Selecting AllowRowSelect="true" />

     

     

    <Resizing AllowRowResize="False" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"

     

     

    AllowColumnResize="True" ClipCellContentOnResize="False" ></Resizing>

     

    <%

    --<Scrolling UseStaticHeaders="true" AllowScroll="true" ScrollHeight="500px" SaveScrollPosition="True" />--%>

     

     

    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" />

     

     

    <Animation AllowColumnReorderAnimation="true" AllowColumnRevertAnimation="true" />

     

     

    </ClientSettings>

     

     

     

    </radG:RadGrid>

     

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 31 Aug 2011 Link to this post

    Hello Ramkumar,

    Note that when using resizing with scrolling and static headers only the GridTableView is resized - RadGrid's width remains fixed. Therefore the behavior you have observed (blank space after the last column) is expected. The grid does not support automatic column width recalculations when the sum of the widths of all its columns is less than the sum of the grid width. Please turn off static headers or leave the control as is, with the ability to add a horizontal scrollbar or empty space on the right. Sorry about the inconvenience caused.

    Greetings,
    Pavlina
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nilar
    Nilar avatar
    3 posts
    Member since:
    Apr 2012

    Posted 16 May 2012 Link to this post

    Could you please fix the white space issue with StaticHeader on? The grid does not look good with the white space. Or is there any workaround?
  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 17 May 2012 Link to this post

    Hello,

    It is an already known problem and is reported to our developers. They will investigate this issue and research on its possible resolution.

    Additionally, the only workaround is to turn off the static headers of the control as noticed in my previous post.

    Greetings,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 15 Jun 2012 Link to this post

    Any new solution on extra white space while using UseStaticHeaders="True" ?

    I tried http://www.telerik.com/community/forums/aspnet-ajax/grid/554498-extra-line-on-radgrid-header.aspx
    But for IE (I am on IE 7)it doesn't work, there are extra white space there after the colmn hide.
  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 20 Jun 2012 Link to this post

    Hi JJ,

    To avoid duplicate posts I will ask you to continue our communication in the other forum post which you have opened for the same problem. 

    Kind regards,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Vishu
    Vishu avatar
    18 posts
    Member since:
    May 2014

    Posted 26 Aug 2014 Link to this post

    Hi,
    Facing one issue of white spaces at the end of the grid while using column groups with context menu. Whenever I click on context menu to hide any column, grid columns jump to left and leave big white space at the end.

    Displaying total values on top of the grid column headers as column groups in code behind. Its a click of button to display values. Please see the screen shot and code. Using Telerik 2014.1.403.40 version. Please suggest how to fix this issue.



    ASPX:
    <telerik:RadGrid ID="gridItemsSearch" runat="server" PageSize="20" AllowPaging="true" HeaderStyle-Font-Underline="true" AllowCustomPaging="true" OnPageIndexChanged="gridItemsSearch_PageIndexChanged" 
                              AutoGenerateColumns="False" Skin="Office2007" OnItemCommand="gridItemsSearch_OnItemCommand" Visible="true" OnSortCommand="gridItemsSearch_SortCommand" EnableHeaderContextMenu="true" 
                             OnNeedDataSource="gridItemsSearch_NeedDataSource" ExportSettings-FileName="ItemParts" OnItemDataBound="gridItemsSearch_ItemDataBound"  width="100%"
                             OnPreRender="gridItemsSearch_PreRender"  AllowSorting="true" CellPadding="2" ShowFooter="false" ExportSettings-ExportOnlyData="false">                            
                             <PagerStyle Mode="NextPrevAndNumeric" Position="Top" ></PagerStyle>
                             <MasterTableView ShowHeadersWhenNoRecords="true" AllowSorting="true" AllowMultiColumnSorting="false" AllowNaturalSort="true" UseAllDataFields="false" ItemStyle-Height="5px" EnableColumnsViewState="true" TableLayout="Fixed" 
                                 DataKeyNames="ItemNumber" width="99%">       
                                 <ColumnGroups>
                                     <telerik:GridColumnGroup HeaderText=" " Name="ItemDesc" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="Available" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="Allocated" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="Onhand" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="OnOrder" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="AvgCost" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="6MON" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="12MON" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="AROR" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="Branch" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="BrDesc" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="ItemId" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="SUOM" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="PrefVend" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="OemNo" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="OEM" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="ReorderPt" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="Critical" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="VMRS" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="CoreVal" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                     <telerik:GridColumnGroup HeaderText=" " Name="PrintBC" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                 </ColumnGroups>                                                 
                                 <Columns>                                   
                                     <telerik:GridTemplateColumn SortExpression="ItemNumber" DataField="ItemNumber" HeaderText=""
                                         UniqueName="ChkItemNumber" HeaderStyle-Width="30px">
                                         <ItemTemplate>
                                             <asp:ImageButton ID="imgpickItem" runat="server" ToolTip="Click to add to Kit Contents" ImageUrl="~/images/basket_add.png" 
                                                 CommandName="Select" />
                                         </ItemTemplate>
                                     </telerik:GridTemplateColumn>
                                      <telerik:GridTemplateColumn HeaderText="#" UniqueName="RowNumber" Visible="false" HeaderStyle-Width="10px">
                                         <ItemTemplate>
                                             <asp:Label runat="server" ID="lblRowNumber" Width="50px" Text='<%# Container.DataSetIndex+1 %>'></asp:Label>
                                         </ItemTemplate>
                                     </telerik:GridTemplateColumn>
                                     <%-- Newly Added columns are following --%>
                                      <telerik:GridBoundColumn DataField="Branch" HeaderText="Branch" SortExpression="Branch" HeaderStyle-Width="70px"   ColumnGroupName="Branch"
                                         UniqueName="BranchId" ItemStyle-HorizontalAlign="Left" />
                                      <telerik:GridBoundColumn DataField="BranchDesc" HeaderText="Branch Description" SortExpression="BranchDesc" HeaderStyle-Width="70px"  ColumnGroupName="BrDesc"
                                         UniqueName="BranchName" ItemStyle-HorizontalAlign="Left"/>
                                     <%-- Newly added columns adding ends --%>
                                     <telerik:GridBoundColumn DataField="ItemNumber" HeaderText="Item ID" HeaderStyle-Width="45px" ColumnGroupName="ItemId"
                                         UniqueName="ItemNumber" ItemStyle-HorizontalAlign="Left" SortExpression="ItemNumber"/>                                   
                                     <telerik:GridBoundColumn DataField="ItemDescription" HeaderText="Item Description" UniqueName="ItemDescription" HeaderStyle-Width="70px"  ColumnGroupName="ItemDesc"
                                         ItemStyle-HorizontalAlign="Left" SortExpression="ItemDescription" />
                                     <telerik:GridBoundColumn DataField="Group" UniqueName="Group" Visible="false" />
                                     <telerik:GridBoundColumn DataField="Available" HeaderText="Available"  SortExpression="Available" DataType="System.Double" HeaderStyle-Width="90px"  ColumnGroupName="Available"
                                         ItemStyle-HorizontalAlign="Center" UniqueName="Available" />
                                     
                                     <telerik:GridBoundColumn DataField="READYFORRENT_QTY" HeaderText="Assets Ready for Rent"  DataType="System.Double" HeaderStyle-Width="70px"  ColumnGroupName="AROR"
                                         ItemStyle-HorizontalAlign="Center" UniqueName="READYFORRENT_QTY" SortExpression="READYFORRENT_QTY" />
                                     
                                     <telerik:GridBoundColumn DataField="Allocated" HeaderText="Allocated" SortExpression="Allocated" 
                                         ItemStyle-HorizontalAlign="Center" UniqueName="Allocated" Visible="false"/>
                                     
                                     <telerik:GridTemplateColumn DataField="Allocated" HeaderText="Allocated" UniqueName="AllocatedPopup" SortExpression="Allocated"  ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70px"  ColumnGroupName="Allocated">
                                         <ItemTemplate>                                                        
                                             <asp:LinkButton ToolTip="Allocated Quantity" runat="server" ID="lnkSelectAllocated" OnClick="BtnSelectItemAllocationData_Click" Visible="true" Text='<%# Eval("Allocated") %>' OnClientClick="GridProcessingText()"/>
                                             <asp:Label ID="lblAllocated" runat="server" Visible="false" Text='<%# Eval("Allocated") %>' />
                                         </ItemTemplate>
                                     </telerik:GridTemplateColumn>                                   

                                      <telerik:GridTemplateColumn DataField="QtyOnHand" HeaderText="On Hand" UniqueName="OnHand"  ItemStyle-HorizontalAlign="Center" SortExpression="QtyOnHand" HeaderStyle-Width="70px"  ColumnGroupName="Onhand">
                                         <ItemTemplate>
                                                 <asp:LinkButton Text='<%# Eval("QtyOnHand") %>' runat="server"  ID="BtnSelectItemLocation" OnClick="BtnSelectItemLocation_Click" Visible="true" ToolTip="Click to see item storage location" OnClientClick="GridProcessingText()" />
                                         </ItemTemplate>
                                     </telerik:GridTemplateColumn>

                                     <telerik:GridBoundColumn DataField="OnOrder" HeaderText="On Order"  SortExpression="OnOrder" HeaderStyle-Width="70px"  ColumnGroupName="OnOrder"
                                         ItemStyle-HorizontalAlign="Center" UniqueName="OnOrder" />
                                      <telerik:GridBoundColumn DataField="AverageCost" HeaderText="Average Cost" DataType="System.Double" DefaultInsertValue="0.0" HeaderStyle-Width="70px" ColumnGroupName="AvgCost"
                                         ItemStyle-HorizontalAlign="Center" UniqueName="AverageCost" SortExpression="AverageCostActualValue"/>
                                      <telerik:GridBoundColumn DataField="SixMonthUsage" HeaderText="6 Month Usage" SortExpression="SixMonthUsage" HeaderStyle-Width="90px"  ColumnGroupName="6MON"
                                         ItemStyle-HorizontalAlign="Center" UniqueName="SixMonthUsage"/>

                                       <telerik:GridTemplateColumn DataField="TwelveMonthUsage" HeaderText="12 Month Usage" UniqueName="TwelveMonthUsage" SortExpression="TwelveMonthUsage" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70px"  ColumnGroupName="12MON">
                                         <ItemTemplate>                                                        
                                             <asp:LinkButton ToolTip="12 Month Usage" runat="server" ID="lnkSelect12MonUsage" OnClick="BtnSelectItem12MonUsage_Click" Visible="true" Text='<%# Eval("TwelveMonthUsage") %>' OnClientClick="GridProcessingText()"/>
                                             <asp:Label ID="lbl12MonUsage" runat="server" Visible="false" Text='<%# Eval("TwelveMonthUsage") %>' />
                                         </ItemTemplate>
                                     </telerik:GridTemplateColumn>                                      

                                     <telerik:GridBoundColumn DataField="UnitOfMeasure" HeaderText="Standard UOM" HeaderStyle-Width="90px"  ColumnGroupName="SUOM"
                                         ItemStyle-HorizontalAlign="Left" UniqueName="UnitOfMeasure" SortExpression="UnitOfMeasure" />
                                                                  
                                      <telerik:GridTemplateColumn DataField="VendorName" HeaderText="Preferred Vendor" UniqueName="VendorName" ItemStyle-HorizontalAlign="Left" SortExpression="VendorName" HeaderStyle-Width="90px" ColumnGroupName="PrefVend">
                                         <ItemTemplate>
                                              <asp:LinkButton ToolTip="Click to see additional vendors" runat="server" ID="BtnSelectVendor" OnClick="BtnSelectVendor_Click" Visible="true" Text='<%# Eval("VendorName") != "" ? Eval("VendorName") : "" %>' OnClientClick="GridProcessingText()"/>                                             
                                         </ItemTemplate>
                                       </telerik:GridTemplateColumn>

                                      <telerik:GridBoundColumn DataField="OEMPartNo" HeaderText="OEM Part #" UniqueName="OEMPart" SortExpression="OEMPartNo" HeaderStyle-Width="70px"  ColumnGroupName="OemNo"
                                         ItemStyle-HorizontalAlign="Left" />
                                                                   
                                       <telerik:GridTemplateColumn DataField="OEM" HeaderText="OEM" UniqueName="OEM" ItemStyle-HorizontalAlign="Center" SortExpression="OEM" HeaderStyle-Width="90px" ColumnGroupName="OEM">
                                         <ItemTemplate>
                                                 <asp:LinkButton ToolTip="Click to see additional manufacturers" runat="server" ID="BtnSelectItemOEMData" OnClick="BtnSelectItemOEMData_Click" Visible="true" Text='<%# Eval("OEM") != "" ? Eval("OEM") : "" %>'  OnClientClick="GridProcessingText()"/>                                                 
                                         </ItemTemplate>
                                     </telerik:GridTemplateColumn>                                     
                                                                    
                                     <telerik:GridBoundColumn DataField="ReorderPoint" HeaderText="Reorder Point" HeaderStyle-Width="70px"   ColumnGroupName="ReorderPt" 
                                         ItemStyle-HorizontalAlign="Center" UniqueName="ReorderPoint" SortExpression="ReorderPoint" />                                                                   
                                    
                                      <telerik:GridTemplateColumn HeaderText="Critical Item" ItemStyle-HorizontalAlign="Center" UniqueName="CriticalItem" SortExpression="CriticalItem" HeaderStyle-Width="70px"   ColumnGroupName="Critical">
                                         <ItemTemplate>
                                                 <asp:CheckBox ID="BtnSelectCriticalItem" runat="server" Enabled="false"  Checked='<%# Eval("CriticalItem").ToString()  == "Y" ? true : false %>' />
                                         </ItemTemplate>
                                     </telerik:GridTemplateColumn>

                                      <telerik:GridBoundColumn DataField="VRMSFullCode" HeaderText="VMRS Code"  SortExpression="VRMSFullCode" HeaderStyle-Width="70px"  ColumnGroupName="VMRS"
                                         ItemStyle-HorizontalAlign="Left" UniqueName="VRMSFullCode"/>
                                     <telerik:GridBoundColumn DataField="IsPMKitItem" HeaderText="PM Kit"  SortExpression="IsPMKitItem" Visible="false" HeaderStyle-Width="70px" 
                                         ItemStyle-HorizontalAlign="Left" UniqueName="IsPMKitItem"/>
                                      <telerik:GridBoundColumn DataField="CoreValue" HeaderText="Core Value"  HeaderStyle-Width="70px"   ColumnGroupName="CoreVal"
                                         ItemStyle-HorizontalAlign="Left" UniqueName="CoreValue" SortExpression="CoreValue" />
                                      <telerik:GridTemplateColumn DataField="PrintBarCode" HeaderText="Print Barcode" UniqueName="PrintbarcodeLinkLevel1" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="40px" ColumnGroupName="PrintBC">                                     
                                         <ItemTemplate>                                                                
                                             <asp:ImageButton ID="PrintbarcodeLinkInventory" runat="server"  ImageUrl="~/Images/Print.png" ToolTip="Print Barcode"/>
                                         </ItemTemplate>
                                      </telerik:GridTemplateColumn>  
                                                                         
                                     <telerik:GridBoundColumn DataField="Family" HeaderText="Family" SortExpression="Family" Visible="false"
                                         ItemStyle-HorizontalAlign="Left" UniqueName="Family"/>
                                     <telerik:GridBoundColumn DataField="Category" HeaderText="Category" SortExpression="Category" Visible="false"
                                         ItemStyle-HorizontalAlign="Left" UniqueName="Category"/>
                                     <telerik:GridBoundColumn DataField="Group" HeaderText="Group" SortExpression="Group" Visible="false"
                                         ItemStyle-HorizontalAlign="Left" UniqueName="Group"/> 
                                                                                                                
                                       <telerik:GridBoundColumn DataField="StorageArea" HeaderText="Storage Area" Visible="false"
                                         UniqueName="StorageArea" ItemStyle-HorizontalAlign="Left" SortExpression="StorageArea" />
                                       <telerik:GridBoundColumn DataField="IsInventoryItem" HeaderText="Inventory Item" Visible="false"
                                         UniqueName="IsInventoryItem" ItemStyle-HorizontalAlign="Left" SortExpression="IsInventoryItem" />   
                                     <telerik:GridBoundColumn DataField="AverageCostActualValue" HeaderText="Avg Cose" Visible="false" 
                                         UniqueName="AverageCostActualValue" ItemStyle-HorizontalAlign="Left" SortExpression="AverageCostActualValue" DataType="System.Decimal"/>    
                                     <telerik:GridBoundColumn DataField="Parent" HeaderText="Parent" Visible="false" 
                                         UniqueName="Parent" ItemStyle-HorizontalAlign="Left" SortExpression="Parent"/>    
                                     <telerik:GridBoundColumn DataField="Child1" HeaderText="Child1" Visible="false" 
                                         UniqueName="Child1" ItemStyle-HorizontalAlign="Left" SortExpression="Child1"/>    
                                     <telerik:GridBoundColumn DataField="Child2" HeaderText="Child2" Visible="false" 
                                         UniqueName="Child2" ItemStyle-HorizontalAlign="Left" SortExpression="Child2"/>    
                                     <telerik:GridBoundColumn DataField="Child3" HeaderText="Child3" Visible="false" 
                                         UniqueName="Child3" ItemStyle-HorizontalAlign="Left" SortExpression="Child3"/>
                                      <telerik:GridBoundColumn DataField="UltimateParent" HeaderText="UltimateParent" Visible="false" 
                                         UniqueName="UltimateParent" ItemStyle-HorizontalAlign="Left" SortExpression="UltimateParent"/>                                                                      
                                 </Columns>
                             </MasterTableView>
                             <SortingSettings EnableSkinSortStyles="false" />
                              <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder">                                 
                                 <Resizing AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="false"
                                     ClipCellContentOnResize="true" EnableRealTimeResize="false" AllowResizeToFit="true" />
                                  <Scrolling AllowScroll="false" UseStaticHeaders="true" ScrollHeight="500px" SaveScrollPosition="true" />
                                  <ClientEvents OnColumnClick="GridSortProcessingText" OnCommand="GridCommand" /> 
                                  <ClientMessages DragToGroupOrReorder="Drag to reorder" />    
                                  <Selecting AllowRowSelect="True" />      
                                  <ClientEvents  />                                                                                         
                             </ClientSettings>
                         </telerik:RadGrid>

    ASPX.cs:
    if (parts.Count > 0 && hdnKitId.Value == "0") 
                  { 
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("ItemDesc").HeaderText = "Total";
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("AROR").HeaderText = string.Format("Ready For Rent: {0}", parts[1].READYFORRENT_QTY_SUM.ToString());
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("Available").HeaderText = string.Format("Available: {0}", parts[1].BU_QTY_AVAIL_SUM.ToString());
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("Allocated").HeaderText = string.Format("Allocated: {0}", parts[1].ALLOCATED_QTY_SUM.ToString());
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("Onhand").HeaderText = string.Format("On-Hand: {0}", parts[1].QTY_ONHAND_SUM.ToString());
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("OnOrder").HeaderText = string.Format("On-Order: {0}", parts[1].ON_ORDER_SUM.ToString());
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("AvgCost").HeaderText = string.Format("Cost:  {0:C}", parts[1].TOTAL_COST_SUM);
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("6MON").HeaderText = string.Format("6 Month: {0}", parts[1].LAST_2QTR_DEMAND_SUM.ToString());
                      gridItemsSearch.MasterTableView.ColumnGroups.FindGroupByName("12MON").HeaderText = string.Format("12 Month: {0}", parts[1].LAST_ANNUAL_DEMAND_SUM.ToString());
                  }




  9. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Aug 2014 in reply to Vishu Link to this post

    Hi Vishu,

    Try to attach the OnColumnHidden client side event of RadGrid as follows.

    JavaScript:
    function onColumnHidden(sender, args) {
        sender.get_masterTableView().get_element().style.tableLayout = "auto";
        sender.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
        window.setTimeout(function () {
            sender.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
            sender.get_masterTableView().get_element().style.tableLayout = "fixed";
        }, 1)
    }

    Thanks,
    Shinu.
  10. Vishu
    Vishu avatar
    18 posts
    Member since:
    May 2014

    Posted 27 Aug 2014 Link to this post

    Thanks Shinu,
    I had already tried it and getting JS error while selecting a column from context menu to hide. Error displays 'get_masterTableViewHeader()' is null or not an object. 

    Please see attached screen shot.
  11. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Aug 2014 in reply to Vishu Link to this post

    Hi Vishu,

    Unfortunately I couldn't replicate the issue at my end. Please have a look into the sample project which works fine at my end.

    Thanks,
    Shinu.

  12. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Aug 2014 in reply to Vishu Link to this post

    Hi Vishu,

    Checking your code I see that you have set the RadGrid width to 100% and MasterTableView width to 99%. Please remove the MasterTableView width and check if the issue is resolved.

    Thanks,
    Shinu
  13. Vishu
    Vishu avatar
    18 posts
    Member since:
    May 2014

    Posted 28 Aug 2014 in reply to Shinu Link to this post

    Thanks Shinu,
                              I tried your project and your suggestion to remove MasterTableView width but still its not working and giving white spaces with JS error. Please see attached screen shots.

    Have attached the project shared by you (slightly modified in grid datasource) so that could replicate the issue. Here is the project to download.
  14. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 02 Sep 2014 Link to this post

    Hi,

    In order to resolve the problem with the white space in IE7 you should set Width="100%" to the grid MasterTableView
    <MasterTableView ShowHeadersWhenNoRecords="true" AllowSorting="true" AllowMultiColumnSorting="false"
                      AllowNaturalSort="true" UseAllDataFields="false" ItemStyle-Height="5px" EnableColumnsViewState="true"
                      TableLayout="Fixed" DataKeyNames="ItemNumber" Width="100%">

    Give this suggestion a try and let me know about the result.

    Regarding the JS error I was not able to replicate it running the project provided by you. Do I need to follow some steps in order to observe it on my side?

    Regards,
    Pavlina
    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