We are using near-latest version of the product. In our web site we have to display dynamically generated (via javascript) context menus. We cannot generate them on the back-end because we don't know how many or what options there will be until the user takes certain actions. However, each menu item will come from the master menu-bar that is created on the back-end for the overall site.
When the user takes action, we use javascript to determine which menu items from the master menu-bar are needed within the context menu. For each item, we create a new item and add it to the context menu (ps - the context menu is declaratively created on our master page's html, albeit with no menu items):
var newItem = new Telerik.Web.UI.RadMenuItem();popMenu.get_items().add(newItem);
The problem is, when the navigate url is rendered, it is total mangled.
Here is an example link from the 'main' menu bar (which works perfectly):
<a class="rmLink" style="width: 268px;" href="javascript:goDnetPage('attrition_total_exempt','4829','functions/reports/front_ends/pages/HRMetrics.aspx','Report=attrition_total_exempt') "><span class="rmText">Total Attrition</span></a>
The 'value' of the href attribute, when assigned into the 'newItem' object is correct - we have console.logged it (via newItem.get_navigateUrl) and it is accurate. However, when the menu item is rendered by the menu code, it comes out as:
<a class="rmLink" href="javascript:goDnetPage(" '="" hrmetrics.aspx','report="attrition_total_exempt')" pages="" front_ends="" reports="" attrition_total_exempt','4829','functions=""><span class="rmText">Total Attrition</span></a>
Something, I presume within the Telerik js, is totally munging up the href value, creating additional attributes for the 'a' element as it sees fit. I have tried replacing/escaping single ticks and slashes, but cannot seem to get it to come out right.
Any advice would be appreciated. Thank you.
Hi,
I have a radtabstrip which has sercontrols in it's pageview.
On the usercontrol I have a radiobuttonlist and I want to update a textbox on selection of a radiobutton. Howevere, the code is performing a full postback.
Below is my code.
ASCX:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucElection.ascx.cs"
Inherits="enrollment_ucElection" %>
<
telerik:RadAjaxManagerProxy
ID
=
"RadAJAXManagerProxy1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"_ElectionsOptions"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"Panel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
asp:ScriptManagerProxy
ID
=
"ScriptManagerProxy1"
runat
=
"server"
>
</
asp:ScriptManagerProxy
>
<
table
>
<
tr
>
<
td
>
<
asp:RadioButtonList
ID
=
"_ElectionsOptions"
runat
=
"server"
RepeatDirection
=
"Vertical"
AutoPostBack
=
"true"
OnSelectedIndexChanged
=
"_ElectionsOptions_SelectedIndexChanged"
RepeatLayout
=
"Flow"
/>
<
asp:Panel
ID
=
"Panel1"
runat
=
"server"
>
<
telerik:RadNumericTextBox
ID
=
"txtBuyUpPercent"
Type
=
"Percent"
runat
=
"server"
>
<
NumberFormat
DecimalDigits
=
"0"
/>
</
telerik:RadNumericTextBox
> (max 10%).
</
asp:Panel
>
</
td
>
</
tr
>
</
table
>
.CS:
protected void _ElectionsOptions_SelectedIndexChanged(object sender, EventArgs e)
{
if (_deferralElectionsOptions.SelectedIndex == 0)
{
txtBuyUpPercent.ReadOnly = true;
txtBuyUpPercent.Text = "";
}
else
{
txtBuyUpPercent.ReadOnly = false;
}
}
Content ASPX page:
<%@ Page Language="C#" MasterPageFile="~/enrollment/enrollmentWizard.master" AutoEventWireup="true"
CodeFile="ELIP.aspx.cs" Inherits="enrollment" Title="Enrollment" %>
<%@ Register TagPrefix="iSys" TagName="insuranceApplication" Src="~/enrollment/ucInsuranceApplication.ascx" %>
<%@ Register TagPrefix="iSys" TagName="deferralElections" Src="~/enrollment/ucElection.ascx" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"ContentPlaceHolder2"
runat
=
"Server"
>
<
div
>
<
telerik:RadTabStrip
ID
=
"rtsEnrollment"
runat
=
"server"
MultiPageID
=
"rmpEnrollment"
OnTabClick
=
"rtsEnrollment_TabClick"
SelectedIndex
=
"0"
CausesValidation
=
"true"
AutoPostBack
=
"true"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Deferral Election"
PageViewID
=
"ElectionsTab"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Insurance Application"
PageViewID
=
"insuranceApplicationTab"
></
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
ID
=
"rmpEnrollment"
runat
=
"server"
OnPreRender
=
"rmpEnrollment_PreRender"
RenderSelectedPageOnly
=
"true"
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"ElectionTab"
Selected
=
"true"
>
<
iSys:deferralElections
ID
=
"ucElection"
runat
=
"server"
/>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"insuranceApplicationTab"
>
<
iSys:insuranceApplication
ID
=
"ucInsuranceApplication"
runat
=
"server"
/>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
div
>
</
asp:Content
>
RADAjaxManager is declared on the master Page file.
Please suggest what am I doing wrong.
RadHtmlChart - I am looking into a way to export all the images (or svg's) in a HtmlChartHolder.
I saw this update here but have heard no help posted there yet. http://www.telerik.com/support/code-library/exporting-radhtmlchart-to-png-and-pdf
my issue is the text does not show up. it may be a permissions issue or the font library looking in the wrong place.
I have tried the fixes suggested there but I still only get 1 image without text created.
also I look at the page and there is the HtmlChartHolder in a div and then multiple svg's inside it of my charts.
so I think I would need a way to loop them and send them all to the server to be created into an image.
maybe I should look into a different svg to image on server program?
also, I have done some image combining myself so if I can get to those images put into a folder such as img01.jpg, img02.jpg etc etc I have my own code to combined them I can use (if nothing out of the box does it)
Doug
Dear Team,
I'm creating a TileList Dynamically using the below code. The content template tile is having a anchor tag, when I click on it the associated method has to be called. Instead of calling the click event associated to anchor tag, the RadTileList onclickclick event is getting fired. Please help on this. Below is the code.
<asp:UpdatePanel ID="UpdatePanelTileList" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<telerik:RadTileList runat="server" AutoPostBack="false" OnClientTileClicking="OnClientTileClicking" ID="ProjectAssetsTileList"
Width="97%"
EnableDragAndDrop="true" OnTileDataBound="ProjectAssetsTileList_TileDataBound"
SelectionMode="Multiple">
</telerik:RadTileList>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function OnClientTileClicking(titleList, args) {
debugger;
alert('hi');
args.set_cancel(true);
$telerik.cancelRawEvent(args);
return false;
}
function MyFunctionEdit() {
alert('hi edit');
return false;
}
</script>
</telerik:RadScriptBlock>
</ContentTemplate>
</asp:UpdatePanel>
Tile creation Code:
private class ContentTemplate : ITemplate
{
private DomainDAL.ProjectAsset asset;
public ContentTemplate(DomainDAL.ProjectAsset asset)
{
this.asset = asset;
}
public void InstantiateIn(Control container)
{
string tileContent = string.Empty;
if (asset==null)
{
tileContent = @"<div class='card add'>
<div class='dotted-box'>
<h1>+</h1>
</div>
<div class='menu'>
<ul class='list-group'>
<a href='#' class='list-group-item' data-toggle='modal' data-target='#text-edit-lightbox'><span class='icon icon-text'></span>Add Text Frame</a>
<a href='#' class='list-group-item' data-toggle='modal' data-target='#image-library'><span class='icon icon-media'></span>Browse Media Library</a>
<a href='#' class='list-group-item' data-toggle='modal' data-target='#upload-library'><span class='icon icon-upload'></span>Upload images or videos</a>
</ul>
</div>
</div>";
}
else if (asset.ContentType==Constants.ContentType.Image )
{
tileContent = @"<div class='card' onclick='alert(hidiv);'><div class='card-wrapper'>
<div><img src='" + String.Format("{0}/{1}/{2}", BLOB_ROOT_URL, asset.Container, asset.ImageUrl) + @"' class='thumb-image'/>
<div class='pull-righ static-icon'>
<span class='close'><img src='../images/icons/icon-trash.png'/></span>
</div>
<div class='backdrop' >
<a href='javascript:MyFunctionEdit();' class='btn btn-transparent' data-toggle='modal' data-target='#image-editing'>Edit</a>
<span class='close'><img src='../images/icons/garbage.png'/></span>
</div>
</div>
<div>
<h4><img src='../images/icons/icon-photo.png' class='icon-margin'/>" + asset.Caption + @"</h4>
<p>Lorem ipsum dolor sit amet, conset adipiscing elit.</p>
</div>
</div>
</div>";
}
else
{
tileContent = @"<div class='card'><div class='card-wrapper'>
<div><div class='text-tile'><h2>" + asset.AssetName + @"</h2><h4>" + asset.Caption + @"</h4></div>
<div class='pull-righ static-icon'>
<span class='close'><img src='../images/icons/icon-trash.png'/></span>
</div>
<div class='backdrop'>
<a href='href='javascript:void(0)' onclick='event.preventDefault();alert(hi);' class='btn btn-transparent' data-toggle='modal' data-target='#image-editing'>Edit</a>
<span class='close'><img src='../images/icons/garbage.png'/></span>
</div>
</div>
<div>
<h4><img src='../images/icons/icon-photo.png' class='icon-margin'/>" + asset.Caption + @"</h4>
<p>Lorem ipsum dolor sit amet, conset adipiscing elit.</p>
</div>
</div>
</div>";
}
LiteralControl literal = new LiteralControl(tileContent);
container.Controls.Add(literal);
}
}
Bind Data to Tile List
protected void BindDataToTileList(List<DomainDAL.ProjectAsset> workingProjectAssets)
{
if (ProjectAssetsTileList.Groups.Count>0)
ProjectAssetsTileList.Groups.RemoveAt(0);
TileGroup group = new TileGroup();
foreach (DomainDAL.ProjectAsset asset in workingProjectAssets.Where(x => x.State != (int)Constants.AssetStatus.Deleted))
{
RadContentTemplateTile contTile = new RadContentTemplateTile();
contTile.ContentTemplate = new ContentTemplate(asset);
contTile.CssClass = "card";
group.Tiles.Add(contTile);
}
RadContentTemplateTile newAssetTile = new RadContentTemplateTile();
newAssetTile.ContentTemplate = new ContentTemplate(null);
newAssetTile.CssClass = "card add";
group.Tiles.Add(newAssetTile);
ProjectAssetsTileList.Groups.Add(group);
}
​
​
Hi,
how can I achive the creation of a new ressource URL for my combined scripts?
I have read I need to update the version of the assembly in which my scripts are embedded.
How can I do this in a (old) web site project? Here I do not have a properties folder and a AssemblyInfo.cs file.
Many thanks for any help.
This would seem easy but I've not been able to figure out how to change the GrandTotalHeaderColumn text.
I am able to change column text for regular columns like this:
if (IsModelDataCellPlannedHeader(modelDataCell))
{
e.ExportedCell.Value = "Plan";
}
private static bool IsModelDataCellPlannedHeader(PivotGridBaseModelCell modelDataCell)
{
return modelDataCell.TableCellType == PivotGridTableCellType.ColumnHeaderCell &&
modelDataCell.Field.UniqueName == "Plan";
}
This works fine but I cannot figure out how to tell if a column is a GrandTotalColumn.
This code does not work:
private static bool IsModelDataCellPlanGrandTotalHeaderColumn(PivotGridBaseModelCell modelDataCell)
{
if (modelDataCell.TableCellType == PivotGridTableCellType.ColumnHeaderCell &&
modelDataCell.CellType == PivotGridDataCellType.ColumnGrandTotalDataCell &&
modelDataCell.Field.UniqueName == "plannedValue")
{
return true;
}
if (modelDataCell.TableCellType == PivotGridTableCellType.ColumnHeaderCell &&
modelDataCell.CellType == PivotGridDataCellType.RowGrandTotalColumnTotal &&
modelDataCell.Field.UniqueName == "plannedValue")
{
return true;
}
return false;
}
Obviously I was just shooting in the dark. It would be nice if there was a TableCellType of GrandTotalColumnHeader. That would seem to make sense.
Let me know if there is a way to do what I'm trying to do.
Thanks!