Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
92 views
This is related to my last post which was solved:
http://www.telerik.com/forums/radeditor-stripping-html-tags-i-need

The problem I am having is that it is adding <script> tags to the <head> tag based on other <script> tags in the document.
Also it is encoding scripts that I have in the page .. these are in  /* <![CDATA[ */ tags.
Why is the control doing this.

I just want to be able to put ANYTHING in the editor and save it WITHOUT the control changing or adding anything.  I don't think this is an unreasonable request.  I am trying to build a CMS system and I keep having to fight this control.  Please help.  How do I get the editor to stop automatically changing my entries?
This is the HTML for my RadEditor:
 
<telerik:RadEditor ID="reContent" runat="server" Skin="Office2010Blue" Height="850px" Width="100%" StripFormattingOptions="MSWordRemoveAll"<br>                                EmptyMessage="Add Content Here - Content is Required" NewLineMode="Br" OnClientLoad="OnClientLoad" ContentFilters="None"><br>                            </telerik:RadEditor>


In the code-behind I have this associated with it:
Me.reContent.DisableFilter(EditorFilters.RemoveScripts)
Me.reContent.EnableFilter(EditorFilters.None)


Thanks,
Jim
Ianko
Telerik team
 answered on 13 Jan 2015
1 answer
229 views
Hey

I want to use your sample Marker to create mine.

I use your javascript file :

(function(global, undefined) {
 
    function OnMarkerCreated(e) {
        var marker = e.marker,
            tooltip = marker.options.tooltip,
            countryFlag = marker.dataItem.country.toLowerCase(),
            newTemplate = tooltip.template;
 
 
        countryFlag = countryFlag.replace(/\s/g, "");
        newTemplate = newTemplate.replace(/class='flag'/i, "class='flag flag-" + countryFlag + "'");
        tooltip.template = newTemplate;
 
        // The following custom functionality is built due to design decision that tooltips with autoHide="false"
        // should hide previously opened tooltips.
        setTimeout(function () {
            addShowHandler(marker);
        }, 0);
    }
 
    function addShowHandler(marker) {
        var tooltip = marker.element.getKendoTooltip();
        tooltip.bind("show", hideAllNonValidPopups);
    }
 
    function hideAllNonValidPopups(e) {
        var shownPopup = e.sender.popup.element[0],
            $ = $telerik.$,
            tooltipCollection = $(".k-tooltip");
 
        tooltipCollection.each(function () {
            var that = this;
 
            if (that != shownPopup) {
                $(that).getKendoPopup().close();
            }
        })
    }
    global.OnMarkerCreated = OnMarkerCreated;
 
})(window);

And your Default.aspx

<form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
                </asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadClientDataSource runat="server" ID="RadClientDataSource1">
            <DataSource>
                <WebServiceDataSourceSettings>
                    <Select DataType="JSON" Url="JSON/MarkersData.json" />
                </WebServiceDataSourceSettings>
            </DataSource>
        </telerik:RadClientDataSource>
        <div class="demo-container size-auto">
            <h2 class="mapTitle">TELERIK OFFICES</h2>
            <telerik:RadMap runat="server" ID="RadMap1" Zoom="2" CssClass="MyMap" LayersDataSourceID="">
                <CenterSettings Latitude="23" Longitude="10" />
                <LayersCollection>
                    <telerik:MapLayer Type="Tile" Subdomains="a,b,c"
                        UrlTemplate="http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"
                        Attribution="© <a href='http://osm.org/copyright' title='OpenStreetMap contributors' target='_blank'>OpenStreetMap contributors</a>.">
                    </telerik:MapLayer>
                    <telerik:MapLayer Type="Marker" Shape="PinTarget" ClientDataSourceID="RadClientDataSource1" LocationField="location">
                        <TooltipSettings AutoHide="false" Width="300"
                            Template="<div class='leftCol'><div class='flag'></div></div><div class='rightCol'><div class='country'>#= marker.dataItem.country #</div><div class='city'>#= marker.dataItem.city #</div><div class='address'>#= marker.dataItem.address #</div><div class='address'>#= marker.dataItem.address2 #</div><div class='phone'>p #= marker.dataItem.phone #</div><div class='email'>e <a href='mailto:#= marker.dataItem.email #'>#= marker.dataItem.email #</a></div><div class='location'>Location:#= location.lat #, #= location.lng #</div></div>">
                            <AnimationSettings>
                                <OpenSettings Duration="300" Effects="fade:in" />
                                <CloseSettings Duration="300" Effects="fade:out" />
                            </AnimationSettings>
                        </TooltipSettings>
                    </telerik:MapLayer>
                </LayersCollection>
                <ClientEvents OnMarkerCreated="OnMarkerCreated" />
            </telerik:RadMap>
            <div id="contactsContainer">
            </div>
        </div>
    </form>


Now i want to create my PinMarker in my codeBiehind, like this :
protected void Page_Load(object sender, EventArgs e)
{
       MapMarker myMarker = new MapMarker();
       myMarker.Shape = MarkerShape.PinTarget.ToString();
       myMarker.Title = "Test";
       myMarker.LocationSettings.Latitude = 0;
       myMarker.LocationSettings.Longitude = 0;
        
       RadMap1.MarkersCollection.Add(myMarker);
}


And now, how can I put the template of your ToolTipSetting etc on my PinTarget ?

But look, this is my result :
http://puu.sh/ehc4D/991a1123c6.png


Can you help me ?

Ianko
Telerik team
 answered on 13 Jan 2015
5 answers
144 views
Hi,

I have added a custom button to the RadFileExplorer.Toolbar. Within the ExplorerPopulated event of the RadFileExplorer I modify the text of the button but this change does not appear within the browser.
eg:

protected void Page_Load(object sender, EventArgs e)
{
    btnSpace = new Telerik.Web.UI.RadToolBarButton();
    btnSpace.Enabled = false;
    btnSpace.CssClass = "CustomButton";
    RadFileExplorer1.ToolBar.Items.Add(btnSpace);
}

protected void RadFileExplorer1_ExplorerPopulated(object sender, Telerik.Web.UI.RadFileExplorerPopulatedEventArgs e)
{
    btnSpace.Text = "hello";
}

How do I force the text to update?

Thanks

Nic
Ianko
Telerik team
 answered on 13 Jan 2015
7 answers
241 views
Hey,

I have a small problem with my Markers in Telerik , look: http://puu.sh/e9fCH/1b594764eb.jpg

How can i change the size of my Makers Because it's really big to ...

Cya !
Ianko
Telerik team
 answered on 13 Jan 2015
3 answers
87 views
This is a general question, but I thought it might belong
here. I’m looking at a business application that requires us to draw many (in the hundreds)
slanted lines representing the production rate (quantity in time) in a
chart-like fashion. Drawing using a Canvas is very close to what I need, but it’s
missing the ability you have in the Gantt Chart where you can click a line and
move it or get some feedback from the line, like clicking it and opening
another page with the data in a grid for that line. So the elements on the
Canvas need to be “active” and “responsive” to the user action. Any suggestions
or recommendations?

Marbry
Top achievements
Rank 1
 answered on 12 Jan 2015
0 answers
57 views
I have 3 radlive tiles that are being updated by a webservice that gets the count from the sharepoint list.

My issue is if there are no items in the view I want to display zero in the tile. But for some reason it keeps bypassing the tile whose view is empty and goes to the next views.

I have tried if tbl!=null that does not work either. Looking for some suggestions that will make this work.

Web Service:

      public static int getView_Count(string viewname) //Returns the count for the view
        {

           //Get Values siteName/listName/viewName
            string siteName = null;
            string listName = null;
            string viewName = null;
            string[] temp = viewname.Split(';');

            foreach (string s in temp)
            {
                if (s.Contains("SiteName"))
                {
                    siteName = s.Substring(9);
                }
                else if(s.Contains("ListName"))
                {
                    listName = s.Substring(9);
                }
                else if (s.Contains("ViewName"))
                {
                    viewName = s.Substring(9);
                }
            }

            //Check SiteName null

            if (string.IsNullOrEmpty(siteName))
            {
                siteName = "0";

            }
           
            if(siteName!="0")
            {
           // SPSite mySite = SPContext.Current.Site;
            SPSite mySite=new SPSite(siteName);
            {
                using (SPWeb myWeb = mySite.OpenWeb())
                {
                   // SPList list_Probs = myWeb.Lists["Probs"];
                    SPList list_Probs = myWeb.Lists[listName];
                    DataTable tbl = new DataTable();

                    ////if (!string.IsNullOrEmpty(viewname))
                    //if (!string.IsNullOrEmpty(viewName))
                    //{
                        //SPView view_Probs = list_Probs.Views[viewname];
                        SPView view_Probs = list_Probs.Views[viewName]; //This is where it bypasses the view that has no value and goes on to the one that has a value

                        tbl = list_Probs.GetItems(view_Probs).GetDataTable();
                        myWeb.Dispose();
                        mySite.Close();
                        return tbl.Rows.Count;
                    }
                
            }
            }
                    else
                    {
                        //SPQuery PQuery = new SPQuery();
                        //PQuery.Query = "<Where><IsNull><FieldRef Name='AS400Date'/></IsNull></Where>";
                        //tbl = list_Probs.GetItems(PQuery).GetDataTable();
                        //myWeb.Dispose();
                        //return tbl.Rows.Count;
                        return 0;
                    }
            
                }

 Code Behind:

namespace DashboardCount.DashboardCount
{
    public partial class DashboardCountUserControl : UserControl
    {
        public DashboardCount DashboardCount { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            //Initialize the radlive tiles
            
            
            try
            {
                if (!string.IsNullOrEmpty(DashboardCount.Title ))
                {
                    lblTile.Text = DashboardCount.TitleWebPart;
                }
                else
                {
                    lblTile.Text = null;
                }
                lblExcep.Visible=false;
                InitializeTile(RadDash);
                InitializeTile(RadDash1);
                InitializeTile(RadDash3);
            }
            catch (Exception ex)
                {
                   lblExcep.Visible=true;
                lblExcep.Text=ex.Message;
                }
        }
        
        private void InitializeTile(RadLiveTile tile)
        {
           
                //tile.CssClass = "liveTile";
                string name = tile.ID;
                tile.Target = "_blank";
            

                //The text between the #= # characters is replaced by the corresponding properties of the data item
                //returned on the web service response.

                if (name == "RadDash")
                {
                    if (!string.IsNullOrEmpty(DashboardCount.Link1))
                    {
                        tile.NavigateUrl = DashboardCount.Link1;
                    }
                    tile.ClientTemplate = @"
                  <div style='width:170px;height:170px;background-color: #= GetColor #'> 
                <div style='text-align:center;font-size:60px;'><strong> #= ViewCount #</strong></div>  
                 <div style='text-align:center;font-size:18px;'><strong> #= GetTileName #</strong></div><br></br>                 
                 <div style='position:absolute;bottom:0;right:0;font-size:12px'> #=DDate  #</div>
                </div>";

                    tile.Value = "SiteName:" + DashboardCount.SiteName + ";ListName:" + DashboardCount.ListName + ";ViewName:" + DashboardCount.View1Name +";TileName:"+DashboardCount.Tile1Name +";MaxNormalCount:" + DashboardCount.MaxNormalCount1 + ";MaxWarningCount:" + DashboardCount.MaxWarningCount1 ; 
                }
                else if (name == "RadDash1")
                {
                    if (!string.IsNullOrEmpty(DashboardCount.Link2))
                    {
                        tile.NavigateUrl = DashboardCount.Link2;
                    }
                    tile.ClientTemplate = @"
                <div style='width:170px;height:170px;background-color:#= GetColor #'> 
                <div style='text-align:center;font-size:60px'><strong>#= ViewCount #</strong></div>  
                <div style='text-align:center;font-size:18px'><strong>#= GetTileName #</strong></div><br></br> 
                <div style='position:absolute;bottom:0;right:0;font-size:12px'> #=DDate  #</div>
                </div>";
                    tile.Value = "SiteName:" + DashboardCount.SiteName + ";ListName:" + DashboardCount.ListName + ";ViewName:" + DashboardCount.View2Name + ";TileName:" + DashboardCount.Tile2Name + ";MaxNormalCount:" + DashboardCount.MaxNormalCount2 + ";MaxWarningCount:" + DashboardCount.MaxWarningCount2; 
                }
                else if (name == "RadDash3")
                {
                    if (!string.IsNullOrEmpty(DashboardCount.Link3))
                    {
                        tile.NavigateUrl = DashboardCount.Link3;
                    }
                    tile.ClientTemplate = @"
                     <div style='width:170px;height:170px;background-color:#= GetColor #'> 
                     <div style='text-align:center;font-size:60px;'><strong>#= ViewCount #</strong></div> 
                    <div style='text-align:center;font-size:18px'><strong>#= GetTileName #</strong></div><br></br>                  
                    <div style='position:absolute;bottom:0;right:0;font-size:12px'> #=DDate  #</div>
                     </div>";
                    tile.Value = "SiteName:" + DashboardCount.SiteName + ";ListName:" + DashboardCount.ListName + ";ViewName:" + DashboardCount.View3Name + ";TileName:" + DashboardCount.Tile3Name + ";MaxNormalCount:" + DashboardCount.MaxNormalCount3 + ";MaxWarningCount:" + DashboardCount.MaxWarningCount3; 
                }
                //Configure the web service providing the live data.
                tile.WebServiceSettings.Path = "~/_layouts/DashboardWS/DashboardWS.asmx";
                tile.WebServiceSettings.Method = "GetEmpData";


                //Attach client side event handlers.
                tile.OnClientDataLoaded = "tileDataLoaded";
                tile.OnClientDataLoadingError = "tileDataLoadingError";
                //tile.OnClientTemplateDataBound = "tileClientTemplateDataBound";
            }

            
        }
    }



 
Reeba
Top achievements
Rank 1
 asked on 12 Jan 2015
1 answer
156 views
On save button click i want to save the values stored in all my ItemTemplate's Label which is inside GridTableView of a RadGrid.

I 'm not sure how to write the foreach statement on Save button click to get the those.

My Efforts-

protected void btnSave_Click(...)
{
     foreach(GridDataItem item in rgScopeOfWork.MasterTabelView.Items)
     {
          // here we can get only those which are outside of the GridTableView 
     }
}

How to write foreach ​to get to loop through the columns inside GridTableView?

Thanks . 
Pavlina
Telerik team
 answered on 12 Jan 2015
1 answer
66 views
http://www.telerik.com/forums/radconfirm-on-page-load

building on the post from above is there a way to change this so the window only appears the first time (per session). I want the user to see it the first time they start a new session on the site, but should they revisit the homepage i dont want them to see the confirm window again. Thanks
Marin Bratanov
Telerik team
 answered on 12 Jan 2015
1 answer
103 views
I cannot get the RadNotification to display from a button click (.Show) if I put a RadFileExplorer control in it. I get an error of 'Uncaught TypeError: Cannot read property 'getContentElement' of null'.

Is this achievable? I'm trying to create a 'sidebar' where the user can navigate files.

Tnx
Marcel


Marin Bratanov
Telerik team
 answered on 12 Jan 2015
4 answers
198 views
Hi, I am having a problem formatting a HtmlChart. Specifically I want to reduce spacing/padding or margins in the the axis.I also want to hide the borders (lines) of the x and y axis but cant seem to find a way to do this. Below is aspx. I have also attached image of how it looks now (current). And how I want it to look (desired). I want the horizontal bars to have almost no gap (eg 5 px or so) so that its more compact. How can I accomplish this do I have to hack w css? If so what are the relevant properties? Thanks

<telerik:RadHtmlChart runat="server" ID="rcRatings" Height="150px"
Width="200px">
<PlotArea>
<Series>
<telerik:BarSeries DataField="rating" Name="Rating">
<Appearance >
<FillStyle BackgroundColor="Orange" />
</Appearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:BarSeries>
</Series>
<XAxis DataLabelsField="title">
<MinorGridLines Visible="false"></MinorGridLines>
<MajorGridLines Visible="false"></MajorGridLines>
</XAxis>
<YAxis Step="1">
<MinorGridLines Visible="false"></MinorGridLines>
<MajorGridLines Visible="false"></MajorGridLines>
<LabelsAppearance Visible = "false" />
<TitleAppearance Visible = "false" />
</YAxis>
</PlotArea>
<Legend>
<Appearance Visible="false"></Appearance>
</Legend>
<ChartTitle>
<Appearance Visible="False" />
</ChartTitle>
</telerik:RadHtmlChart>
Lee
Top achievements
Rank 1
 answered on 12 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?