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

Extra space after the last column in radgrid when using frozen columns

4 Answers 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Deepthi
Top achievements
Rank 1
Deepthi asked on 27 Nov 2012, 01:46 PM
I am using telerik controls for the first time. I am getting an extra space after the last column. When I do not freeze the first two columns, the space disappears, but then there is a misalignment between the columns and the headers. Could you please advise? is it because, i am resizing the grid and headers when the radpane collapses/expands, and in the gridcreated event?

Please find below the code in my aspx page

%

 

@ Page Language="C#" AutoEventWireup="true" CodeBehind="FrmSalReview.aspx.cs" Inherits="PrincessUI.FramePages.FrmInitialSalReview" MasterPageFile="~/Site.Master"%>

 

<

 

 

asp:Content ContentPlaceHolderID="HeadContent" ID="head" runat="server">

 

<

 

 

telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

 

<script type="text/javascript">

 

 

 

function OnClientResized(sender, eventArgs) {

 

 

 

var grid = $find("<%= radgridSalReview.ClientID %>");

 

 

 

var pane = $find("<%= RadPane2.ClientID %>");

 

 

 

var size = pane.get_width() - 20;

 

grid.get_element().style.width = size;

 

 

var gridHeader = grid.GridHeaderDiv;

 

gridHeader.style.width = size;

}

 

 

function OpenPopupWindow() {

 

 

 

var userWidth = screen.availWidth;

 

 

 

var userHeight = screen.availHeight;

 

leftPos = (userWidth - 900) / 2,

topPos = (userHeight - 250) / 2;

settings =

 

'modal,scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,left='+ leftPos +',top=' + topPos +',width=900, height=260';

 

window.open(

 

"FrmConfigTableLayout.aspx", "popup", settings);

 

}

 

 

function ShowPopup() {

 

window.radopen(

 

"FrmConfigTableLayout.aspx", "ConfigTblLayout");

 

 

 

return false;

 

}

 

 

function refreshGrid(arg) {

 

 

 

if (!arg) {

 

$find(

 

"<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");

 

}

}

 

 

function GridCreated(sender, args) {

 

 

 

var pane = $find("<%= RadPane2.ClientID %>");

 

 

 

var grid = $find("<%= radgridSalReview.ClientID %>");

 

 

 

 

if (grid != null && pane != null) {

 

grid.get_element().style.width = pane.get_width() - 20;

 

 

var gridHeader = grid.GridHeaderDiv;

 

gridHeader.style.width = pane.get_width() - 20;

 

}

}

 

</

 

 

script>

 

</

 

 

telerik:RadCodeBlock>

 

</

 

 

asp:Content>

 

<

 

 

asp:Content ContentPlaceHolderID="MainContent" ID="body" runat="server">

 

<

 

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="RadTreeView1">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radgridSalReview"></telerik:AjaxUpdatedControl>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radnumtxtMonSal"></telerik:AjaxUpdatedControl>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radnumtxtIncBudget"></telerik:AjaxUpdatedControl>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radnumtxtIncPercent"></telerik:AjaxUpdatedControl>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radnumtxtIncrBudToDist"></telerik:AjaxUpdatedControl>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radnumtxtAnnualSalary"></telerik:AjaxUpdatedControl>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radnumtxtBonusBudget"></telerik:AjaxUpdatedControl>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radnumtxtBonusPercent"></telerik:AjaxUpdatedControl>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radnumtxtBonusBudToDist"></telerik:AjaxUpdatedControl>

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="radgridSalReview"></telerik:AjaxUpdatedControl>

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

 

</telerik:RadAjaxManager>

 

 

<

 

 

telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">

 

 

 

<Windows>

 

 

 

<telerik:RadWindow ID="ConfigTblLayout" runat="server" Title="Configure Table Layout" Height="320px"

 

 

 

Width="900px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"

 

 

 

Modal="true" Behaviors="Close,Move,Minimize">

 

 

 

</telerik:RadWindow>

 

 

 

</Windows>

 

 

 

</telerik:RadWindowManager>

 

 

<

 

 

div class="Main-Content">

 

<

 

 

table width="100%">

 

<

 

 

tr>

 

<

 

 

td colspan="8">

 

<

 

 

asp:Label ID="lblTitle" runat="server" Text="Salary increment and Bonus Review " CssClass="Label"></asp:Label>

 

</

 

 

td>

 

</

 

 

tr>

 

<

 

 

tr>

 

<

 

 

td colspan="8">

 

</

 

 

td>

 

</

 

 

tr>

 

<

 

 

tr>

 

<

 

 

td>

 

 

 

<asp:Label ID="lblMonthlySalary" runat="server" Text="Monthly Salary" CssClass="Legend"></asp:Label>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtMonSal" runat="server"

 

 

 

Enabled="False">

 

 

 

</telerik:RadNumericTextBox>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<asp:Label ID="lblIncBudget" runat="server" Text="Increment Budget" CssClass="Legend"></asp:Label>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtIncBudget" runat="server"

 

 

 

Enabled="False">

 

 

 

</telerik:RadNumericTextBox>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<asp:Label ID="lblIncPercent" runat="server" Text="Increment (%)" CssClass="Legend"></asp:Label>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtIncPercent" runat="server"

 

 

 

Enabled="False">

 

 

 

</telerik:RadNumericTextBox>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<asp:Label ID="lblIncrBudToBeDist" runat="server" Text="Increment Budget to be distributed" CssClass="Legend"></asp:Label>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtIncrBudToDist" runat="server"

 

 

 

Enabled="False">

 

 

 

</telerik:RadNumericTextBox>

 

</

 

 

td>

 

</

 

 

tr>

 

<

 

 

tr>

 

<

 

 

td><asp:Label ID="lblAnnualSalary" runat="server" Text="Annual Salary" CssClass="Legend"></asp:Label>

 

</

 

 

td>

 

<

 

 

td><telerik:RadNumericTextBox ID="radnumtxtAnnualSalary" runat="server"

 

 

 

Enabled="False">

 

 

 

</telerik:RadNumericTextBox></td>

 

<

 

 

td>

 

 

 

<asp:Label ID="lblBonusBudget" runat="server" Text="Bonus Budget" CssClass="Legend"></asp:Label>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtBonusBudget" runat="server"

 

 

 

Enabled="False">

 

 

 

</telerik:RadNumericTextBox>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<asp:Label ID="lblBonus" runat="server" Text="Bonus (%)" CssClass="Legend"></asp:Label>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtBonusPercent" runat="server"

 

 

 

Enabled="False">

 

 

 

</telerik:RadNumericTextBox>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<asp:Label ID="lblBonusBudToDist" runat="server" Text="Bonus Budget to be distributed" CssClass="Legend"></asp:Label>

 

</

 

 

td>

 

<

 

 

td>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtBonusBudToDist" runat="server"

 

 

 

Enabled="False">

 

 

 

</telerik:RadNumericTextBox>

 

</

 

 

td>

 

</

 

 

tr>

 

</

 

 

table>

 

 

 

<telerik:RadSplitter ID="RadSplitter1" runat="server" LiveResize="true"

 

 

 

Skin="Vista" Width="100%" Height="550px">

 

 

 

<telerik:RadPane ID="RadPane1" Runat="server" Width="25%">

 

 

 

<telerik:RadTreeView ID="RadTreeView1" Runat="server" Skin="Vista"

 

 

 

OnNodeClick="RadTreeView1_NodeClick"></telerik:RadTreeView></telerik:RadPane>

 

 

 

 

<telerik:RadSplitBar ID="RadSplitBar1" Runat="server" CollapseMode="Forward"></telerik:RadSplitBar>

 

 

 

<telerik:RadPane ID="RadPane2" Runat="server" Width="75%" Height="100%" Scrolling="None" OnClientResized="OnClientResized" >

 

 

 

<table width="100%">

 

 

 

<tr>

 

 

 

<td></td>

 

 

 

<td>

 

 

 

<telerik:RadGrid ID="radgridSalReview"

 

 

 

Width="920px" AllowSorting="True" runat="server" AutoGenerateColumns="False"

 

 

 

CellSpacing="0" Skin="Vista"

 

 

 

OnNeedDataSource="radgridSalReview_NeedDataSource"

 

 

 

OnItemDataBound="radgridSalReview_ItemDataBound"

 

 

 

AllowPaging="True" OnUpdateCommand="radgridSalReview_UpdateCommand"

 

 

 

PageSize="8" Height="370px" OnPreRender="radgridSalReview_OnPreRender"

 

 

 

GridLines="None" >

 

 

 

 

<ClientSettings >

 

 

 

<Selecting AllowRowSelect="True" />

 

 

 

<Scrolling AllowScroll="true" UseStaticHeaders="false" FrozenColumnsCount="2"/>

 

 

 

<Resizing AllowColumnResize="True" ResizeGridOnColumnResize="True" />

 

 

 

<ClientEvents OnGridCreated="GridCreated" />

 

 

 

</ClientSettings>

 

 

 

<ExportSettings>

 

 

 

<Excel Format="Html"/>

 

 

 

</ExportSettings>

 

 

 

<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top"

 

 

 

DataKeyNames="empNoDigit" EditMode="InPlace" PageSize="10"

 

 

 

TableLayout="Fixed">

 

 

 

<CommandItemSettings/>

 

 

 

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" UpdateText="Update" EditText="Edit" CancelText="Cancel">

 

 

 

<HeaderStyle Width="60px" />

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

 

<telerik:GridBoundColumn DataField="name" HeaderStyle-Width="150px"

 

 

 

HeaderText="Name" UniqueName="colName" ReadOnly="true">

 

 

 

<HeaderStyle Width="200px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

<telerik:GridBoundColumn DataField="empNoDigit" HeaderText="Employee No."

 

 

 

UniqueName="colEmpNoDigit" Visible="false" ReadOnly="true">

 

 

 

<HeaderStyle Width="180px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="empno" HeaderText="Employee ID"

 

 

 

UniqueName="colEmpNo" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="110px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="fn" HeaderText="Function" UniqueName="colFunction" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="150px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="position" HeaderText="Position"

 

 

 

UniqueName="colPosition" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="150px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridDateTimeColumn DataField="joindate" DataFormatString="{0:MM/dd/yyyy}"

 

 

 

HeaderText="Date of Joining" UniqueName="colJoinDate" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="80px" />

 

 

 

</telerik:GridDateTimeColumn>

 

 

 

<telerik:GridBoundColumn DataField="OvExp" HeaderText="Overall Experience"

 

 

 

UniqueName="colOverallExp" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="80px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="TpExp" HeaderText="Technip Experience"

 

 

 

UniqueName="colTechnipExp" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="80px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Score" HeaderText="PA Score"

 

 

 

UniqueName="colScore" ReadOnly="true">

 

 

 

<HeaderStyle Width="50px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="yearless4" HeaderText=""

 

 

 

UniqueName="colYearLess4Sal" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="yearless3" HeaderText=""

 

 

 

UniqueName="colYearLess3Sal" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="yearless2" HeaderText=""

 

 

 

UniqueName="colYearLess2Sal" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="yearless1" HeaderText=""

 

 

 

UniqueName="colYearLess1Sal" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="basic" HeaderText="Current Basic"

 

 

 

UniqueName="colPresentBasic" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn DataField="hra" HeaderText="Current HRA"

 

 

 

UniqueName="colPresentHousing" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblPresentHousing" runat="Server" Text='<%# Eval("hra") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="living" HeaderText="Current Living"

 

 

 

UniqueName="colPresentLiving" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="transport" HeaderText="Current Transport"

 

 

 

UniqueName="colPresentTransport" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="colCurSal" HeaderText="Current Monthly Salary" ReadOnly="true">

 

 

 

<HeaderStyle Width="60px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblCurSal" runat="Server" Text='<%# Eval("CurrentSalary") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="PropIncrPercent" HeaderText="HR Prop Incr %"

 

 

 

UniqueName="colPropIncrPercent" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="80px"/>

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="basicincr" HeaderText="HR Prop Basic Incr"

 

 

 

UniqueName="colPropBasicIncrease" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="hraincr" HeaderText="HR Prop HRA Incr"

 

 

 

UniqueName="colPropHousingIncrease" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="livingincr" HeaderText="HR Prop Living Incr"

 

 

 

UniqueName="colPropLivingIncrease" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="transincr" HeaderText="HR Prop Trans Incr"

 

 

 

UniqueName="colPropTransIncrease" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="HR Prop Total Incr"

 

 

 

UniqueName="colPropTotalIncrease" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px"/>

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblIncrProp" runat="Server" Text='<%# Eval("IncrProp") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="propBasic" HeaderText="HR Prop Basic"

 

 

 

UniqueName="colProposedBasic" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="propHRA" HeaderText="HR Prop HRA"

 

 

 

UniqueName="colProposedHousing" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="propLiving" HeaderText="HR Prop Living"

 

 

 

UniqueName="colProposedLiving" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="propTrans" HeaderText="HR Prop Trans"

 

 

 

UniqueName="colProposedTransport" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn DataField="propTotalSal" HeaderText="HR Prop Total"

 

 

 

UniqueName="colProposedTotal" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px"/>

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblPropTotalSal" runat="Server" Text='<%# Eval("propTotalSal") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="bonusLstyre" HeaderText="Bonus Last Year"

 

 

 

UniqueName="colBonusLastYear" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="PropBonusPercent" HeaderText="HR Prop Bonus %"

 

 

 

UniqueName="colPropBonusPercent" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="80px"/>

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn DataField="bonusprop" HeaderText="HR Prop Bonus"

 

 

 

UniqueName="colProposedBonus" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px"/>

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblBonusProp" runat="Server" Text='<%# Eval("bonusProp") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="colIncrPercent" HeaderText="Suggested Incr. (%)">

 

 

 

<HeaderStyle Width="80px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblIncrPercent" runat="Server" Text='<%# Eval("SugIncrPercent") %>' />

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtIncrPercent" runat="Server" Text='<%# Bind("SugIncrPercent") %>' NumberFormat-DecimalDigits="2" NumberFormat-DecimalSeparator="." NumberFormat-KeepNotRoundedValue="True" MaxLength="5" OnTextChanged="radnumtxtIncrPercent_TextChanged" AutoPostBack="true"/>

 

 

 

</EditItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridBoundColumn DataField="suggestedBasic" HeaderText="Suggested Basic"

 

 

 

UniqueName="colSugBasic" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="suggestedHra" HeaderText="Suggested HRA"

 

 

 

UniqueName="colSugHousing" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="suggestedLiving" HeaderText="Suggested Living"

 

 

 

UniqueName="colSugLiving" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="suggestedTrans" HeaderText="Suggested Transport"

 

 

 

UniqueName="colSugTransport" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="colNewSalary" HeaderText="Suggested Salary">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblNewSal" runat="Server" Text='<%# Eval("NewSalary") %>' />

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtNewSal" runat="Server" Text='<%# Bind("NewSalary") %>' MaxLength="6" OnTextChanged="radnumtxtNewSal_TextChanged" AutoPostBack="true"/>

 

 

 

</EditItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="colBonusPercent" HeaderText="Suggested Bonus (%)">

 

 

 

<HeaderStyle Width="80px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblBonusPercent" runat="Server" Text='<%# Eval("SugBonusPercent") %>'/>

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtBonusPercent" runat="Server" Text='<%# Bind("SugBonusPercent") %>' MaxLength="5" OnTextChanged="radnumtxtBonusPercent_TextChanged" AutoPostBack="true"/>

 

 

 

</EditItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="colBonus" HeaderText="Suggested Bonus">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblBonus" runat="Server" Text='<%# Eval("BonusSug") %>' />

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadNumericTextBox ID="radnumtxtBonus" runat="Server" Text='<%# Bind("BonusSug") %>' MaxLength="6" OnTextChanged="radnumtxtBonus_TextChanged" AutoPostBack="true"/>

 

 

 

</EditItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="Incr. Variation %"

 

 

 

UniqueName="colIncrVarPercent" Visible="false" ReadOnly="true">

 

 

 

<HeaderStyle Width="60px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblIncrVarPercent" runat="Server" Text="" />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="Bonus Variation %"

 

 

 

UniqueName="colBonusVarPercent" ReadOnly="true" Visible="false">

 

 

 

<HeaderStyle Width="60px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblBonusVarPercent" runat="Server" Text="" />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridTemplateColumn UniqueName="colPromotion" HeaderText="Promotion">

 

 

 

<HeaderStyle Width="150px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblPromotion" runat="Server" Text='<%# Eval("Promotion") %>' />

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadTextBox ID="radtxtPromotion" runat="Server" Text='<%# Bind("Promotion") %>' MaxLength="250"/>

 

 

 

</EditItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="colRemarks" HeaderText="Remarks">

 

 

 

<HeaderStyle Width="150px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblRemarks" runat="Server" Text='<%# Eval("Remarks") %>' />

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadTextBox ID="radtxtRemarks" runat="Server" Text='<%# Bind("Remarks") %>' MaxLength="250"/>

 

 

 

</EditItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="colReviewFlag" HeaderText="Review" Visible="false" ReadOnly="true">

 

 

 

<HeaderStyle Width="60px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblReviewFlag" runat="Server" Text='<%# Eval("reviewflag") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="colConfirm" HeaderText="Confirm">

 

 

 

<HeaderStyle Width="60px" />

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox runat="server" ID="chkConfirm" ToolTip="Confirm" OnCheckedChanged="chkConfirm_CheckedChanged" AutoPostBack="true"/>

 

 

 

</ItemTemplate>

 

 

 

<HeaderTemplate>

 

 

 

<asp:CheckBox ID="chkAll" ToolTip="Check to Select all" runat="server" AutoPostBack="true" OnCheckedChanged="chkAll_CheckedChanged" />

 

 

 

</HeaderTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridHyperLinkColumn Text="History" Target="_new" UniqueName="colHistory">

 

 

 

<HeaderStyle Width="100px" />

 

 

 

</telerik:GridHyperLinkColumn>

 

 

 

</Columns>

 

 

 

<EditFormSettings>

 

 

 

<EditColumn FilterControlAltText="Filter EditCommandColumn column">

 

 

 

</EditColumn>

 

 

 

</EditFormSettings>

 

 

 

<PagerStyle AlwaysVisible="True" />

 

 

 

</MasterTableView>

 

 

 

<ClientSettings>

 

 

 

<Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />

 

 

 

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

 

 

 

</ClientSettings>

 

 

 

<FilterMenu EnableImageSprites="False">

 

 

 

</FilterMenu>

 

 

 

<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Vista">

 

 

 

</HeaderContextMenu>

 

 

 

</telerik:RadGrid>

 

 

 

</td>

 

 

 

<td></td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td>

 

 

 

</td>

 

 

 

<td>

 

 

 

<table width="100%">

 

 

 

<tr>

 

 

 

<td align="left">

 

 

 

<a href="#" onclick="return ShowPopup();">Configure Table Layout</a>

 

 

 

</td>

 

 

 

<td>

 

 

 

 

</td>

 

 

 

<td align="right">

 

 

 

<telerik:RadButton ID="radbtnExportToExcel" runat="server"

 

 

 

Text="Export To Excel" Skin="Vista" onclick="radbtnExportToExcel_Click">

 

 

 

</telerik:RadButton>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

 

 

</td>

 

 

 

<td></td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

 

</telerik:RadPane>

 

 

 

</telerik:RadSplitter>

 

</

 

 

div>

 

</

 

 

asp:Content>

 

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 30 Nov 2012, 03:34 PM
Hi,

To remove the empty space after the last column you can try leaving the last column without width. Also set the UseStaticHeaders property to True and let me know about the result.

All the best,
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.
0
srivaths
Top achievements
Rank 1
answered on 10 Oct 2014, 06:09 AM
Hi, even i have the same issue as Deepthi mentioned above,

 i used static headers and and left the last column without width,

but it is not working for me,

please help me out,

Thanks in advance.
0
srivaths
Top achievements
Rank 1
answered on 10 Oct 2014, 06:11 AM
<ClientSettings AllowColumnsReorder="true" EnableRowHoverStyle="true" AllowDragToGroup="true" >
               <Scrolling AllowScroll="True" UseStaticHeaders="true" ScrollHeight="350px" FrozenColumnsCount="4"></Scrolling>
               <ClientEvents OnGridCreated="GridCreated" />
               <Resizing AllowColumnResize="false" EnableRealTimeResize="true" />
          </ClientSettings>

function GridCreated(sender, args) {
        var scrollArea = sender.GridDataDiv;
        var dataHeight = sender.get_masterTableView().get_element().clientHeight;

        if (dataHeight < 350) {
            scrollArea.style.height = dataHeight + 47 + "px";
        }
    }
0
Pavlina
Telerik team
answered on 14 Oct 2014, 10:13 PM
Hi,

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 scroll bar or empty space on the right.
If disabling static headers did not help to fix the problem with the space after the last column, send us the complete grid declaration, so we can test your scenario locally and advice you further.

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.

 
Tags
Grid
Asked by
Deepthi
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
srivaths
Top achievements
Rank 1
Share this question
or