I am using Frozen Column Property of the Grid..
Its working fine but there is a Issue that is when i use scroll it shows one Extra Blank Column at the End of the Columns.
I have used the Folling Setting.
I have attached the Image in that the last Column after the Sent Email.. That is the Problem For me. In this Image the Red Circled column is the Issue..
Please suggest some solution for this problem.
Thanks in Advance..
7 Answers, 1 is accepted
The problem can be caused by the fact that the sum of all widths of the last visible columns (when scrolling to the far right) does not match the available space for non-frozen columns. You can fix that by changing the widths of the last columns. Note that the RadGrid width matters in this case, so if the RadGrid width depends on its container,you will not be able to achieve a fixed-width frozen columns in all cases.
Additionally, it seems that the attachment did not make it through. Can you please re-attach the image if the problem still persists.
All the best,
Pavlina
the Telerik team
I have checked my code. i haven't used any width in the column.
Here is my Grid Code and also i have attached the full Grid Image.
Please give me the any good solution.
Thanks in Advance...
*********************** Code *****************************
To avoid the appearance of empty column you should set HeaderStyle-Width property for the columns. Note that when scrolling is enabled and UseStaticHeaders is True, the grid columns should declare HeaderStyle.Width. See this help article for more information.
However, I take the provided code and prepared a simple working project. I used HeaderStyle-Width property of the MasterTableView to declare width of the columns. Please check it out and let me know if it helps.
Regards,
Pavlina
the Telerik team
I was having the same problem and did everything advised by Telerik support, but still kept getting the extra space at end in a frozen columns grid.
I solved it by going to Tools > Compatibility View in my IE 8 browser. Then the page automatically re-loaded and the empty space just vanished by itself. You could also set all websites to show in Compatibility View by going to Tools > Compatibility View Settings in IE 8 browser, and checking 'Display all websites in Compatibility View'.
NOTE: However, in Firefox or Chrome, I never saw this problem after following Telerik's advice, but in IE 8 it kept on showing till I did what I have described in above paragraph.
Thanks
Sunil
Hi
I'm troubled a lot with this strange problem in one of my ASPX page.
Background, in all pages including this one, the columns are resizable and reorderable and I have got this GridSettingsPersister.SaveSettings() for all pages to retain the user preferences.In all these pages I'm using inbuilt GridEditCommandColumn.
In problem page, I'm using GridTemplateColumn as first column that has a link to open custom edit pop up.
Now the problem is that when I reorder the column and save setting by gsPersister and redirect and then come back to the page; that GridTemplateColumn with edit link is gone, like it did not existed at all.
Please help.
The aspx code:
<div id="divlistInUsers">
<telerik:RadGrid ID="RGSiteConfig" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False"
OnNeedDataSource="RGSiteConfig_NeedDataSource" OnInsertCommand="RGSiteConfig_InsertCommand"
OnItemDataBound="RGSiteConfig_ItemDataBound" OnItemCommand="RGSiteConfig_ItemCommand"
OnPreRender="RGSiteConfig_PreRender"
AllowFilteringByColumn="true" EnableLinqExpressions="false"
Skin="Silk"
PageSize="10" Width=""
HeaderStyle-Font-Bold="true"
AlternatingItemStyle-BackColor="#f0f0f0">
<GroupingSettings CaseSensitive="false" />
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView CommandItemDisplay="Top" DataKeyNames="SiteID"
InsertItemPageIndexAction="ShowItemOnFirstPage" CommandItemSettings-ShowRefreshButton="false">
<Columns>
<%--<telerik:GridTemplateColumn HeaderStyle-Width="10px" AllowFiltering="false" AllowSorting="false"
Resizable="true" Reorderable="false">
<ItemTemplate>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderStyle-Width="40px" Resizable="false" Reorderable="false" />--%>
<telerik:GridTemplateColumn HeaderStyle-Width="40px" AllowFiltering="false" AllowSorting="false"
Resizable="true" Reorderable="false">
<ItemTemplate>
<asp:LinkButton ID="lnkEdit" runat="server" Text="Edit"
CommandArgument='<%# Eval("SiteID").ToString() + "," + Eval("ContractorID").ToString()
+ "," + Eval("CountryOfOrigin").ToString() + "," + Eval("SiteIsActive").ToString()
+ "," + Eval("ContractorIsActive").ToString() + "," + Eval("CSIEnabled").ToString()
+ "," + Eval("MCSInstalled").ToString() + "," + Eval("IsCM").ToString()%>'
CommandName="EditSiteConfig" CausesValidation="false" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn SortExpression="SiteName" DataField="SiteName" HeaderText="MCS Site Name"
HeaderStyle-Width="150" />
<telerik:GridTemplateColumn HeaderText="Mapped PSA Companies" AllowFiltering="false" AllowSorting="false" HeaderStyle-Width="150">
<ItemTemplate>
<asp:Label ID="lblAssignTCACompanies" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoOfTCAs")%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn SortExpression="Total" HeaderText="Users(UPM/CP)" Visible="true"
AllowFiltering="false" HeaderStyle-Width="100">
<ItemTemplate>
<asp:Label ID="lblAssignOperatorsToSite" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoOfOperators") + "/" + DataBinder.Eval(Container.DataItem, "NoOfCPUsers")%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn SortExpression="NoOfPermissions" HeaderText="Permissions" DataField="NoOfPermissions"
AllowFiltering="false" HeaderStyle-Width="100">
<ItemTemplate>
<asp:Label ID="lblAssignPermissionsToSite" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoOfPermissions")%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="CM Contacts" AllowFiltering="false" AllowSorting="false" HeaderStyle-Width="150">
<ItemTemplate>
<p id="pCMContacts" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Ciena Program Managers" AllowFiltering="false" AllowSorting="false" HeaderStyle-Width="150">
<ItemTemplate>
<p id="pCienaContacts" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="CM Security Forms" AllowFiltering="false" AllowSorting="false"
HeaderStyle-Width="105">
<ItemTemplate>
<asp:DataGrid ID="gvattachments" runat="server" AutoGenerateColumns="false" ShowHeader="false"
GridLines="None" BorderWidth="0">
<HeaderStyle Font-Bold="True" />
<Columns>
<asp:HyperLinkColumn DataTextField="AttachmentName" HeaderText="Files"
DataNavigateUrlField="AttachmentID" DataNavigateUrlFormatString="DownloadFile.aspx?Attachmentid={0}" />
</Columns>
</asp:DataGrid>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="CM IP Address" AllowFiltering="false" AllowSorting="false" HeaderStyle-Width="120">
<ItemTemplate>
<asp:DataGrid ID="gvip" runat="server" AutoGenerateColumns="false" ShowHeader="false"
GridLines="None" BorderWidth="0">
<HeaderStyle Font-Bold="True" />
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="IPAddress" DataTextField="IPAddress"
DataNavigateUrlFormatString="http://whatismyipaddress.com/ip/{0}"
HeaderText="IP Address" Target="_blank" />
</Columns>
</asp:DataGrid>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn SortExpression="CountryOfOrigin" DataField="CountryOfOrigin" HeaderText="Country"
HeaderStyle-Width="150" />
<telerik:GridBoundColumn DataField="SiteIsActive" HeaderText="Active [Uses MCS UDC]" HeaderStyle-Width="110" />
<telerik:GridBoundColumn DataField="ContractorIsActive" HeaderText="Uses LS Web" HeaderStyle-Width="70" />
<telerik:GridBoundColumn DataField="CSIEnabled" HeaderText="Uses CSI App" HeaderStyle-Width="80" />
<telerik:GridBoundColumn DataField="MCSInstalled" HeaderText="Uses MCS Client" HeaderStyle-Width="85" />
<telerik:GridTemplateColumn SortExpression="NoOfGroups" HeaderText="Groups" Visible="false">
<ItemTemplate>
<asp:Label ID="lblAssignGroupsToSite" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoOfGroups")%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn SortExpression="ModifiedBy" DataField="ModifiedBy" HeaderText="Updated By" HeaderStyle-Width="150" />
<telerik:GridBoundColumn SortExpression="ModifiedTime" DataField="ModifiedTime" HeaderText="Updated Date"
DataFormatString="{0:d-MMM-yyyy hh:mm tt}" AllowFiltering="false" />
<telerik:GridTemplateColumn HeaderStyle-Width="145px" AllowFiltering="false" AllowSorting="false"
Resizable="false" Reorderable="false" HeaderText="Export CM Details">
<ItemTemplate>
<asp:HyperLink ID="lnkExportInGrid" runat="server" Text="Export CM Details"
NavigateUrl='<%# Eval("SiteID", "~/DownloadFile.aspx?SiteID={0}")%>' Target="_blank" />
<input runat="server" type="hidden" id="hdTotal" value='<%# DataBinder.Eval(Container.DataItem, "Total")%>' />
<input runat="server" type="hidden" id="hdNoOfIPs" value='<%# DataBinder.Eval(Container.DataItem, "NoOfIPs")%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn SortExpression="SiteID" HeaderText="Site ID"
DataField="SiteID" AllowFiltering="false" />
</Columns>
<EditFormSettings EditFormType="Template" CaptionFormatString="Add/Edit Site"
FormCaptionStyle-Font-Bold="true">
<PopUpSettings Width="555px" Modal="true" />
<FormTemplate>
<table cellpadding="2" cellspacing="5" border="0" width="100%" rules="none"
style="border-collapse: collapse;">
<tr>
<td>Site ID</td>
<td>
<asp:Label ID="lblSiteID" runat="server" Text='<%# Bind("SiteID")%>' />
</td>
</tr>
<tr>
<td>Contractor ID</td>
<td>
<asp:Label ID="lblContractorID" runat="server" Text='<%# Bind("ContractorID")%>' />
</td>
</tr>
<tr>
<td>MCS Site Name</td>
<td>
<asp:TextBox ID="txtSiteName" runat="server" Text='<%# Bind("SiteName")%>'
MaxLength="50" />
</td>
</tr>
<tr>
<td>Country</td>
<td>
<asp:DropDownList ID="lbCountryCode" runat="server" />
</td>
</tr>
<tr>
<td>Active [Uses MCS UDC]</td>
<td>
<asp:CheckBox ID="chkSiteActive" runat="server" Enabled="false"
Checked='<%# (DataBinder.Eval(Container.DataItem, "SiteIsActive") == DBNull.Value ? true : Eval("SiteIsActive"))%>' />
</td>
</tr>
<tr>
<td>Uses LS Web</td>
<td>
<asp:CheckBox ID="chkContractorActive" runat="server" Enabled="false"
Checked='<%# (DataBinder.Eval(Container.DataItem, "ContractorIsActive") == DBNull.Value ? true : Eval("ContractorIsActive"))%>' />
</td>
</tr>
<tr>
<td>Uses CSI App</td>
<td>
<asp:CheckBox ID="chkCSIEnabled" runat="server"
Checked='<%# (DataBinder.Eval(Container.DataItem, "CSIEnabled").ToString() == "True" ? true : false)%>' />
</td>
</tr>
<tr>
<td>Uses MCS Client</td>
<td>
<asp:CheckBox ID="chkMCSInstalled" runat="server"
Checked='<%# (DataBinder.Eval(Container.DataItem, "MCSInstalled").ToString() == "True" ? true : false)%>' />
</td>
</tr>
<tr>
<td>
<input runat="server" type="hidden" id="hdSiteName" value='<%# Bind("SiteName")%>' />
<input runat="server" type="hidden" id="hdCountry" value='<%# Bind("CountryOfOrigin")%>' />
</td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
<asp:Label ID="lblError1" ForeColor="Red" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td></td>
<td>
<asp:Button ID="btnUpdate" Text="Insert" runat="server" CommandName="PerformInsert"
CausesValidation="false" CssClass="button"></asp:Button>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="false"
CommandName="Cancel" CssClass="button"></asp:Button>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowColumnsReorder="true" ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="true">
<ClientEvents OnRowDblClick="" OnPopUpShowing="onPopUpShowing" />
<Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
AllowColumnResize="True" />
</ClientSettings>
</telerik:RadGrid>
</div>
Hello Team
Please help me with this. I cannot figure out why my Custom(TemplateColumn) Edit Column is lost when I save the Grid Settings and revisit the page. I have other custom Template Columns as well with hyperlinks, which stay intact.
Thanks
Kamal
Could you confirm that the same problem persists when you are using Persistence Framework? A live example where this framework is used to persists the grid settings is available here:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/persisting-grid-settings/defaultcs.aspx?product=grid
Additionally, if this not helps send us the code behind of the problematic page.
Regards,
Pavlina
Telerik