Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
180 views
Hi,

I am using the radgrid control, and using an image button to export all data to PDF file displayed in the grid, and one of the columns in the grid contains hyperlinks, though that column is not a hyperlink column, the issue i am facing is while exporting the data, i need all the hyperlinks displayed as a common text like "Download" but in addition this text should be a clickable link when seen in the pdf document.

Any kind of help will be appreciated.

Thanks.

   
Kostadin
Telerik team
 answered on 16 Sep 2014
4 answers
170 views
Hi All,

Using the silk skin on a grid I notice that the page buttons use the grey style of hover.  On radbuttons you can tell them to use the primary style (which ironically seems to be the secondary style as it is not default), which shows a nice blue highlight.  Is there a way to get this blue highlight on the page buttons - it provides a nice uplift to an otherwise grey page.

Regards

Jon
Jon
Top achievements
Rank 1
 answered on 16 Sep 2014
5 answers
208 views
Hi,

In our project we have problems with slow horizontal scrolling in Mozilla Firefox. It can easily be reproduced on your demo site (with Firefox):

http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/scrolling/scrolling/defaultcs.aspx

Steps to reproduce:

1. Turn off "Enable\Disable Frozen Columns"
2. Make sure that Use static headers and footers are turned on
3. Click on horizontal scroll-bar just to the left of the right scroll arrow (just above the 2 in '91 items in 2 pages, when page size is 50)
4. Scroll thumb is heading toward mouse position but it is very slow

This issue doesn't occur on Chrome. Also everything works properly on Firefox when Frozen Columns are enabled or static headers and footers are disabled.

Our customers require to have static headers so it is not possible to turn them off.

Do you have a solution or workaround for this issue?
Kostadin
Telerik team
 answered on 16 Sep 2014
1 answer
52 views
Hi

thus loading CSS file in master page:

<inf:StyleSheetManager runat="server" ID="ssm1" CdnSettings-TelerikCdn="Disabled">
        <StyleSheets >
 
            <inf:StyleSheetReference Assembly="Data.Web" Name="Data.Web.Content.Styles.Style.css" />
 
        </StyleSheets>
    </inf:StyleSheetManager>

web.config:
<appSettings>
 
    <add key="Telerik.Skin" value="newSkin"/>
 
    <add key="Telerik.EnableEmbeddedSkins" value="false" />
     
  </appSettings>

Firefox and Chrome are my everything behaves well. Functional styling.
bug occurs in IE, the page behaves as if no style retrieved.
bug is all version IE.
I need to work in IE 8 or higher, please advice. 
Ivan Zhekov
Telerik team
 answered on 16 Sep 2014
3 answers
151 views
01.<telerik:RadMenu runat="server" Skin="Menu_New" ID="RadMainMenu" Style="z-index: 5" ExpandDelay="1000"
02.    DataSourceID="SqlDataSourceMainMenu" DataFieldID="Id" DataFieldParentID="ParentId" DataTextField="Text"
03.    EnableRoundedCorners="true" EnableEmbeddedSkins="false" EnableShadows="true"
04.    OnItemDataBound="RadMainMenu_ItemDataBound" OnItemClick="RadMainMenu_ItemClick">
05. 
06.    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
07. 
08.    <DefaultGroupSettings RepeatColumns="3" RepeatDirection="Horizontal" />
09. 
10.</telerik:RadMenu>

I added the "DefaultGroupSettings" line and yes, every menu option was now a 3 bar menu. However, I need to be able to apply this to the menu options that actually have more than  "x" items in them.


Any help with this would be greatly appreciated.


Thanks,
Ivan Zhekov
Telerik team
 answered on 16 Sep 2014
2 answers
183 views
Trying to get my Radgrid to perform updates of records but have not been able to. I have been following this article(http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/manual-crud-operations/defaultcs.aspx?#qsf-demo-source) but because I am using content placeholders etc. can't follow it exactly. Below is my code, any suggestions on how to get the update to work would be appreciated. When I run the page, it just displays the data in the grid, the pencil icon does not show up to update. Any ideas?

Attached is the design and code behind.

Code Behind
01.using System;
02.using System.Collections.Generic;
03.using System.Linq;
04.using System.Web;
05.using System.Web.UI;
06.using System.Web.UI.WebControls;
07.using Business.Admin;
08.using Telerik.Web.UI;
09. 
10.namespace XX.Admin
11.{
12.    public partial class AdminLookUp : System.Web.UI.Page
13.    {
14.        protected void Page_Load(object sender, EventArgs e)
15.        {
16.            //if (!IsPostBack)
17.            //{
18.            //    LoadData();
19.            //}
20.        }
21. 
22.        public void LoadData(object source, GridNeedDataSourceEventArgs e)
23.        {
24.            //load data for lookup grid
25.            AdminLookUpBO lookUp = new AdminLookUpBO();
26.            List<AdminLookUpVO> getLookUpData;
27. 
28.            getLookUpData = lookUp.GetLookUpData();
29. 
30.            AdminLookUpGrid.DataSource = getLookUpData;
31.        }
32. 
33.        protected void goBackButton_Click(object sender, EventArgs e)
34.        {
35.            Response.Redirect("~/Admin/AdminMain.aspx");
36.        }
37. 
38. 
39.        protected void UpdateData(object source, GridCommandEventArgs e)
40.        {
41.               //update data for lookup grid
42.            AdminLookUpBO lookup = new AdminLookUpBO();
43. 
44.            var editableItem = ((GridEditableItem)e.Item);
45.            int lookUpId = (int)editableItem.GetDataKeyValue("ID");
46.            bool result = false;
47. 
48.            result = lookup.UpdateData(lookUpId, editableItem);
49.           
50.        }
51. 
52. 
53.    }
54.}


001.<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AdminLookUp.aspx.cs" Inherits="XX.Admin.AdminLookUp" %>
002.<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
003.<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
004.        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
005.        <script type="text/javascript">
006.            function rowDblClick(sender, eventArgs) {
007.                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
008.            }
009.        </script>
010.    </telerik:RadCodeBlock>
011.</asp:Content>
012.<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
013.       <div class="centeredContent">
014.        <div class="centeredTable">
015.            <table align="center" width="900">
016.                <tr>
017.                    <td>
018.                        <p align="center" class="mediumHeader">
019.                            <asp:Label ID="adminLookupLabel"
020.                                runat="server"
021.                                Text='<%$ Resources:Resource, AdminLookUpTitle %>'
022.                                CssClass="mediumHeader" />
023.                        </p>
024.                    </td>
025.                </tr>
026.                <tr>
027.                    <td>
028.                        <asp:Label ID="errorMessageLabel" runat="server" CssClass="ErrorLabelTable" Text="" Visible="false" />
029.                    </td>
030.                </tr>
031.            </table>
032. 
033.            <table align="center" width="900">
034.                <tr>
035.                    <td>
036.                        <div style="width: 900px; height: auto">
037. 
038.                            <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
039.                                <AjaxSettings>
040.                                    <telerik:AjaxSetting AjaxControlID="AdminLookUpGrid">
041.                                        <UpdatedControls>
042.                                            <telerik:AjaxUpdatedControl ControlID="AdminLookUpGrid" />
043.                                        </UpdatedControls>
044.                                    </telerik:AjaxSetting>
045.                                </AjaxSettings>
046.                            </telerik:RadAjaxManager>
047.                            <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
048. 
049.                            <telerik:RadGrid ID="AdminLookUpGrid" runat="server"
050.                                AllowPaging="True" Skin="Windows7"
051.                                AllowAutomaticUpdates="True"
052.                                AutoGenerateColumns="False"
053.                                CellSpacing="0"
054.                                Height="300px"
055.                                GridLines="None"
056.                                OnNeedDataSource="LoadData" OnUpdateCommand="UpdateData"
057.                                AllowMultiRowSelection="True" Width="900px">
058.                                <ClientSettings>
059.                                    <Selecting AllowRowSelect="True" />
060.                                </ClientSettings>
061.                                <MasterTableView DataKeyNames="ID, User_ID, First_Name, Last_Name, Employee_Number, Role_Function, Is_Active"
062.                                                 ShowHeadersWhenNoRecords="True">
063.                                    <Columns>
064.                                        <telerik:GridBoundColumn DataField="ID" Visible="false">    
065.                                        </telerik:GridBoundColumn>
066.                                        <telerik:GridBoundColumn DataField="User_ID"
067.                                            HeaderText='<%$ Resources:Resource, AdminLookUp_UserID %>'
068.                                            UniqueName="User_ID">
069.                                            <HeaderStyle Width="250px" />
070.                                        </telerik:GridBoundColumn>
071.                                        <telerik:GridBoundColumn DataField="First_Name"
072.                                            HeaderText='<%$ Resources:Resource, AdminLookUp_FirstName %>'
073.                                            UniqueName="First_Name">
074.                                            <HeaderStyle Width="100px" />
075.                                        </telerik:GridBoundColumn>
076.                                        <telerik:GridBoundColumn DataField="Last_Name"
077.                                            HeaderText='<%$ Resources:Resource, AdminLookUp_LastName %>'
078.                                            UniqueName="Last_Name">
079.                                            <HeaderStyle Width="100px" />
080.                                        </telerik:GridBoundColumn>
081.                                        <telerik:GridBoundColumn DataField="Employee_Number"
082.                                            HeaderText='<%$ Resources:Resource, AdminLookUp_EmployeeNumber %>'
083.                                            UniqueName="Employee_Number">
084.                                            <HeaderStyle Width="100px" />
085.                                        </telerik:GridBoundColumn>
086.                                        <telerik:GridBoundColumn DataField="Role_Function"
087.                                            HeaderText='<%$ Resources:Resource, AdminLookUp_RoleFunction %>'
088.                                            UniqueName="Role_Function">
089.                                            <HeaderStyle Width="100px" />
090.                                        </telerik:GridBoundColumn>
091.                                        <telerik:GridBoundColumn DataField="Is_Active"
092.                                            HeaderText='<%$ Resources:Resource, AdminLookUp_IsActive %>'
093.                                            UniqueName="Is_Active">
094.                                            <HeaderStyle Width="100px" />
095.                                        </telerik:GridBoundColumn>
096.                                    </Columns>
097.                                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
098.                                </MasterTableView>
099.                                <PagerStyle PageSizeControlType="None"></PagerStyle>
100.                                <FilterMenu EnableImageSprites="False"></FilterMenu>
101.                            </telerik:RadGrid>
102. 
103. 
104.                        </div>
105.                    </td>
106.                </tr>
107.                <tr>
108.                     
109.                    <td align="right">
110.                        <asp:Button ID="saveButton" runat="server" Text="Save" />
111.                        <asp:Button ID="cancelButton" runat="server" Text="Cancel" />
112.                        <asp:Button ID="goBackButton" runat="server" Text="GoBack" OnClick="goBackButton_Click" />
113.                    </td>
114.                </tr>
115.            </table>
116.        </div>
117.   </div>
118.</asp:Content>

Sasha
Top achievements
Rank 1
 answered on 15 Sep 2014
1 answer
260 views
I am attempting to use the Rad Editor for my website and I do NOT want JavaScript to be working, or any type of XSS capabilities.

This is what my declaration looks lik
<telerik:RadEditor ID="txtContent" Height="500" Width="600" runat="server" ToolsFile="~/DesktopModules/Admin/RadEditorProvider/Toolsfile/ToolsFileWithUpload.xml"
                SpellCheckSettings-AllowAddCustom="false" SpellCheckSettings-AjaxUrl="/Telerik.Web.UI.SpellCheckHandler.axd" OnClientLoad="OnClientLoad"
                NewLineMode="P" DialogsCssFile="~/css/TelerikSkin/TelerikSkin.css" AllowScripts="false" ContentFilters="RemoveScripts">
                <Content>
                </Content>
                <CssFiles>
                    <telerik:EditorCssFile Value="~/css/YellowToken.css" />
                </CssFiles>
                <SpellCheckSettings AllowAddCustom="False" AjaxUrl="/Telerik.Web.UI.SpellCheckHandler.axd"></SpellCheckSettings>
</telerik:RadEditor>

As you can see: AllowScripts="false" and ContentFilters="RemoveScripts" are both set.
Unfortunately I can still enter in something like:
<script>alert('This Is Bad');</script>
And it will still do the alert. Every time.

I was then searching around on the telerik site looking for help and ran across the OnClientLoad method of removing items.
function OnClientLoad(editor, args) {
                    editor.get_filtersManager().add(new MyFilter());
                }
                MyFilter = function () {
                    MyFilter.initializeBase(this);
                    this.set_isDom(false);
                    this.set_enabled(true);
                    this.set_name("RadEditor filter");
                    this.set_description("RadEditor filter description");
                }
                MyFilter.prototype =
                {
                    getHtmlContent: function (content) {
                        var dom = document.createElement("DIV");
                        dom.innerHTML = content;
                        var elems = dom.getElementsByTagName("*");
 
                        for (var i = 0; i < elems.length; i++) {
 
                            //Remove all onmouseover, onmouseout, onclick eventhandlers from element
                            var elem = elems[i];
                            if (elem.hasAttribute("onmouseover")) {
                                elem.setAttribute("onmouseover", "");
                            }
                            if (elem.hasAttribute("onerror")) {
                                elem.setAttribute("onerror", "");
                            }
                            if (elem.hasAttribute("onclick")) {
                                elem.setAttribute("onclick", "");
                            }
                            if (elem.hasAttribute("alert")) {
                                elem.setAttribute("alert", "");
                            }
                        }
                        return dom.innerHTML;
                    },
                    getDesignContent: function (content) {
                        var dom = document.createElement("DIV");
                        dom.innerHTML = content;
                        var elems = dom.getElementsByTagName("*");
 
                        for (var i = 0; i < elems.length; i++) {
 
                            //Remove all onmouseover, onmouseout, onclick eventhandlers from element
                            var elem = elems[i];
                            if (elem.hasAttribute("onmouseover")) {
                                elem.setAttribute("onmouseover", "");
                            }
                            if (elem.hasAttribute("onerror")) {
                                elem.setAttribute("onerror", "");
                            }
                            if (elem.hasAttribute("onclick")) {
                                elem.setAttribute("onclick", "");
                            }
                            if (elem.hasAttribute("alert")) {
                                elem.setAttribute("alert", "");
                            }
                        }
                        return dom.innerHTML;
 
                    }
                }
 
                MyFilter.registerClass('MyFilter', Telerik.Web.UI.Editor.Filter);

I attempted this from a forum post a while back. Unfortunately it doesn't actually fix the issue either. It doesn't remove any of the things that it says it does.

And this is where I am stuck at. Nothing is really working for what it says its doing and I am leaving this for next week. I am just hoping someone points out something that I am perhaps doing wrong and can fix, or I don't know what.
Alexander
Top achievements
Rank 1
 answered on 15 Sep 2014
1 answer
104 views
Hi

I have FileExplorer in FormView and when changing from ReadOnly To Edit Mode it seems to loose the configuration that i do in
Page_Load().

Thank you for your help.

Vessy
Telerik team
 answered on 15 Sep 2014
1 answer
79 views
I am working on a page that uses the lightbox, and I noticed that the left/right buttons only show up when the mouse if hovered on them. Our web page will be used by mobile devices and other systems with touch-screens which do not have the ability to hover. Is there a way to make the left/right buttons always visible?
Galin
Telerik team
 answered on 15 Sep 2014
1 answer
115 views
I've written an application that uses RadMap to display GeoJson shape data for the individual counties in a selected State in the USA. 
In ANY other browser (Chrome, Safari, FireFox) the RadMap is displayed perfectly.  In IE (Any version) the radmap navigation is displayed but the map is completely empty.   I'm at my wits end trying to troubleshoot this and would appreciate any help anyone can give me. 
I've included the aspx relating to the radmap as well as the associated js file text. 
 
<telerik:RadMap runat="server" ID="RadMap1" Zoom="6" Width="100%" Height="500" Skin="MetroTouch" >
<CenterSettings Latitude="40" Longitude="-100" />
<LayerDefaultsSettings>
<ShapeSettings>
    <StyleSettings>
 <FillSettings Color="DarkBlue " Opacity="1" />
<StrokeSettings Color="White" />
</StyleSettings>
</ShapeSettings>
</LayerDefaultsSettings>
<ClientEvents OnShapeCreated="shapeCreated" OnShapeMouseEnter="shapeMouseEnter"
OnShapeClick="shapeClick" OnShapeMouseLeave="shapeMouseLeave" OnClick="clientClick" />
<LayersCollection>
<telerik:MapLayer ClientDataSourceID="RadClientDataSource1" Type="Shape" Opacity="1">
</telerik:MapLayer>
                </LayersCollection>

</telerik:RadMap>

---- Script.js ----
var HIGHLIGHT_STROKE_COLOR = "Red";
var HIGHLIGHT_STROKE_HOVER_COLOR = "Green";
var COUNTRIES_COLOR = "DarkBlue";
var COUNTRIES_STROKE_COLOR = "White";

function shapeCreated(e) {

if (e.shape.dataItem.properties["GEO_ID"].substring(0, 2) === '05') {
if (e.shape.dataItem.properties["STATE"] === getParameterByName("ID")) {

var COUNTY_NAME = e.shape.dataItem.properties["NAME"];
var COUNTIES_COLOR = getcountycolor(e.shape.dataItem.properties["NAME"]);

e.shape.options.set("fill.color", COUNTIES_COLOR);
e.shape.options.set("stroke.color", COUNTRIES_STROKE_COLOR);
e.shape.innerHTML = e.shape.dataItem.properties["NAME"];

}
else { e.shape.options.set("visible", false); }
}


}

function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
function shapeMouseEnter(e) {
document.getElementById("lblShapeName").innerHTML = e.shape.dataItem.properties["NAME"];
e.shape.options.set("fill.color", HIGHLIGHT_STROKE_COLOR);
e.shape.options.set("stroke.color", HILIGHT_STROKE_COLOR);

e.shape.toolTip.set(e.shape.dataItem.properties["NAME"]);


}

function shapeMouseLeave(e) {

e.shape.options.set("fill.color",COUNTRIES_COLOR);
e.shape.options.set("stroke.color", COUNTRIES_STROKE_COLOR);
}

function shapeClick(e) {

if (e.shape.dataItem.properties["GEO_ID"].substring(0,2) === '05')
{
var County = e.shape.dataItem.properties['NAME'];
var state = getParameterByName("state");
window.location = "http://olaagenthub.onelifeamerica.com/OrderLeadsCounties.aspx?County=" + County + "&state="+state+"&ID=" + e.shape.dataItem.properties['STATE'];
}
else{
var state = e.shape.dataItem.properties['NAME'];
window.location = "http://olaagenthub.onelifeamerica.com/OrderLeadsCounties.aspx?state="+state+"&ID="+e.shape.dataItem.properties['STATE'];
}


}



function markerCreated(e) {
e.preventDefault();
}

function clientClick(e) {
toolTip.hide();
}

function clientPan(e) {
toolTip.hide();
}

function zoomStart(e) {
toolTip.hide();
}



function buildToolTipFromShape(shape, div) {

div.innerHTML = "<div><span class='detail'>Name: </span><span>" + shape.dataitem.properties["NAME"] + "</span></div>"

}

function getColorFromMagnitude(magnitude) {
return interpolateColor(magnitude, 3, 7, 255, 255, 0, 240, 0, 0);
}

function interpolateColor(value, minimum, maximum, R1, G1, B1, R2, G2, B2) {
value = value > maximum ? maximum : value;
value = value < minimum ? minimum : value;
value = value - minimum;
var percent = value / (maximum - minimum);

var r1 = R1 / 255.0, g1 = G1 / 255.0, b1 = B1 / 255.0;
var r2 = R2 / 255.0, g2 = G2 / 255.0, b2 = B2 / 255.0;

var r3 = (r1 + (r2 - r1) * percent) * 255;
var g3 = (g1 + (g2 - g1) * percent) * 255;
var b3 = (b1 + (b2 - b1) * percent) * 255;
return rgb2hex(r3, g3, b3);
}

function rgb2hex(red, green, blue) {
var rgb = blue | (green << 8) | (red << 16);
return '#' + (0x1000000 + rgb).toString(16).slice(1)
}
Vessy
Telerik team
 answered on 15 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?