Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
141 views

I am trying to post an array from jQuery on an .aspx page to a method in the codebehind using Telerik AjaxManager. The problem I am having is converting the string to a list or even an array using C#. The string (after using Json.stringify in jQuery) looks like this:

string zoneString = "[[1,[["Ticket Core.AFE"],["Ticket Core.CompanyName"]]],[2,[["Ticket Core.CompanyCity"],["Ticket Core.CompanyState"]]]]"

I tried to deserialize like this:
List<ZoneInfo> zones = JsonConvert.DeserializeObject<List<ZoneInfo>>(zonesString);

But that produced an error.

Here is my client-side code:
var zones = [];

for (var i = 1; i <= zoneCount; i++)

{

var o = $.data(listBox, i.toString());

if(o != undefined){var items = [];var a = o._array;

//pull the key/value

for (x = 0; x < a.length; x++)

{

var item = a[x];

var value = item.get_value();

value items.push([value]);

}

zones.push([i, items]);

}}

jsonZones = JSON.stringify(zones);

var ajaxManager = $find("<%= ((RadAjaxManager)this.Page.Master.FindControl("RadAjaxManager1")).ClientID %>"); ajaxManager.ajaxRequest('CREATEREPORT|' + jsonZones + '|' + tid);

 

Here is my server-side code:
protected void AjaxMgr_AjaxRequest(object sender, AjaxRequestEventArgs e)

{

string[] args = e.Argument.Split('|');

string sCommand = args[0];

switch (sCommand.ToUpper())

{

case "CREATEREPORT":string zonesString = args[1];

List<ZoneInfo> zones = JsonConvert.DeserializeObject<List<ZoneInfo>>(zonesString);

var template = args[2];

string[] zone = new string[zones.Count];break;

}

InitializeWizard();}

Brad
Top achievements
Rank 1
 asked on 14 Feb 2020
3 answers
550 views

I am implementing a RadGrid with batch mode editing using clientside binding with a RadClientDataSource.   I am finding that calling .hasChanges() results in records flagged for Delete to not actually get deleted when .saveChanges() executes.

 

This is my setup: 

I created my own button for saving,  as such:

<CommandItemTemplate>
             <telerik:RadButton  ID="RadButtonSave" runat="server" Text="Save" CssClass="GoButton" AutoPostBack="false" OnClientClicked="function(){ saveChanges();}" >
            </telerik:RadButton>
</CommandItemTemplate>

 

Which calls the following javascript function:

 

function saveChanges() {
  var grid = $find("<%= RadGrid1.ClientID %>");
  //var isDirty = grid.get_batchEditingManager().hasChanges(grid.get_masterTableView());
  grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());
}

If I make changes to grid data and click the Save button the webservices for the insert, update, delete are being called.

HOWEVER, if I uncomment the "var isDirty...." line in the above .saveChanges() function that calls .hasChanges(),  then the Deletes will no longer save.   The web service for deletes simply does not get called. Inserts and update still work correctly.   If i comment out that line, then the deletes work again.

 

I found the same behaviour on a LiveDemo example that checks .hasChanges().

https://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/client-data-source-binding/defaultcs.aspx

Steps to reproduce:

- Make any change to the first record, such as modifying the Contact Name.

- On the second record, Click the "x" under the DELETE column to mark it for delete.

- Click any column heading to sort.  (This calls a UserAction event handler that calls .hasChanges())

- Choose to Cancel at the popup prompt.

- Click "Save changes".

- Monitor the browser console, you will find that webservice UpdateCustomers is called,  but DeleteCustomers is not.

 

Please confirm whether this is a bug and if there is a workaround.

 

Attila Antal
Telerik team
 answered on 13 Feb 2020
3 answers
139 views

It seems that Column names (title, start time, end time,..) are not translated via dictionary (RadGantt.resx)

Is there a way to change column names?

 

 

Peter Milchev
Telerik team
 answered on 13 Feb 2020
3 answers
256 views

Hi,

 

I have same drodown in ItemTemplate and edititemTemplate.iI don't want to  click the cell and edit.If anything i edit in itemtemplate,the cell should be recognised as edited. same way in Edititemtemplate.So i don't want the cell disable.I found one link related to check box.I want same for dropdown also.But it is not working for dropdown 

https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes?_ga=2.38799904.202473376.1576560062-1142414788.1551175497

 

sai
Top achievements
Rank 1
 answered on 13 Feb 2020
2 answers
209 views

Hi,

I have aspx file which refer another external jquery file.i.e. js file referred in aspx page.in this page we migration the old control into new telerik control.After selecting in autocomplete, they send a jquery ajax call for get data from the service and  rendering in respective control instead of typing.All this functionality is available in external js file.So how i can get the Radcombobox and change the value.Any suggestion on this. please Support me.

 

Thank you

S A Saikrisshnan

 

sai
Top achievements
Rank 1
 answered on 13 Feb 2020
1 answer
126 views

WAVE accessibility evaluation tool reports numerous errors with player button. How can we configure to avoid? Please attached image. 

 

 <telerik:RadMediaPlayer RenderMode="Lightweight" ID="RadMediaPlayer1" Skin="Bootstrap" runat="server" Width="340" BackColor="Black" AutoPlay="true" MimeType="video/mp4" EnableAriaSupport="true"
                        StartVolume="80" Height="200px">
                    </telerik:RadMediaPlayer>

Rumen
Telerik team
 answered on 12 Feb 2020
6 answers
203 views

Hello,

I have a styling problem when a dialog is shown in RadEditor (e.g. linkmanager). I have assigned my own skin.:

<telerik:RadEditor ID="radEditor" runat="server" AutoResizeHeight="true" EditModes="Design,Html" DialogsCssFile="/editordialog.css">
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" />
            <telerik:EditorTool Name="PastePlainText" />
            <telerik:EditorTool Name="FormatStripper" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="Bold" />
            <telerik:EditorTool Name="Italic" />
            <telerik:EditorTool Name="Unterline" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="Indent" />
            <telerik:EditorTool Name="Outdent" />
            <telerik:EditorTool Name="InsertUnorderedList" />
            <telerik:EditorTool Name="InsertOrderedList" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="LinkManager" />
            <telerik:EditorTool Name="InsertParagraph" />
            <telerik:EditorTool Name="ApplyClass" />
        </telerik:EditorToolGroup>
    </Tools>
    <CssClasses>
        <telerik:EditorCssClass Name="remove CSS" Value="" />
        <telerik:EditorCssClass Name="title" Value="p.EditorTitle" />
    </CssClasses>
    <CssFiles>
        <telerik:EditorCssFile Value="~/App_Themes/EditForm/Form.css" />
    </CssFiles>
</telerik:RadEditor>

 

Skin, EmbeddedSkins and RenderMode are defined in web.config.

I have read some older posts like:

https://www.telerik.com/forums/css-skin-not-setting-for-radeditor-dialogs#D2y6DCqSQkiiOjw0-LqBhA
https://feedback.telerik.com/aspnet-ajax/1377496-adding-dialogscssfile-to-radeditor-changes-radeditor-class

But this doesn't change anything.

<telerik:RadEditor ID="radEditor" runat="server" AutoResizeHeight="true" EnableEmbeddedSkins="false" Skin="myown" RenderMode="Lightweight" EditModes="Design,Html" DialogsCssFile="/editordialog.css">

 

editordialog.css

@import url("/App_Themes/RadControls/myown/FormDecorator.myown.css");
@import url("/App_Themes/RadControls/myown/ColorPicker.myown.css");
@import url("/App_Themes/RadControls/myown/FormDecorator.myown.css");
@import url("/App_Themes/RadControls/myown/Grid.myown.css");
@import url("/App_Themes/RadControls/myown/Input.myown.css");
@import url("/App_Themes/RadControls/myown/PanelBar.myown.css");
@import url("/App_Themes/RadControls/myown/Rotator.myown.css");
@import url("/App_Themes/RadControls/myown/Slider.myown.css");
@import url("/App_Themes/RadControls/myown/Splitter.myown.css");
@import url("/App_Themes/RadControls/myown/TabStrip.myown.css");
@import url("/App_Themes/RadControls/myown/ToolBar.myown.css");
@import url("/App_Themes/RadControls/myown/TreeView.myown.css");
@import url("/App_Themes/RadControls/myown/Upload.myown.css");
@import url("/App_Themes/RadControls/myown/Window.myown.css");
@import url("/App_Themes/RadControls/myown/ComboBox.myown.css");
@import url("/App_Themes/RadControls/myown/Button.myown.css");
@import url("/App_Themes/RadControls/myown/Editor.myown.css");
@import url("/App_Themes/RadControls/myown/ListBox.myown.css");

 

I created the style with the theme builder tool on this site: https://themebuilder.telerik.com/aspnet-ajax

I tested with versions 2019.3.1023 and 2020.1.114

 

Maybe I missed something important. I hope you can help me.

 

Regards

Karsten

Karsten
Top achievements
Rank 1
 answered on 12 Feb 2020
4 answers
336 views

I have a gallery of three RadMediaPlayer controls.  The sources are added in the code behind.  The mp4 files are sitting in a folder at the root of the app.  The videos play in debug mode, but when I publish and upload to the dev web server, the video players don't play.  They are just black boxes.  I'm using IE11 and Chrome.  In debug mode, the videos all play in both browsers, but after publishing none of them play in either browser.  I have confirmed that the video files are included in the deployed published content and that the folder's path is consistent.  What would cause them to not play after publishing?

Code behind snippet:

protected void Page_Load(object sender, EventArgs e)
   {
       videoPlayer1.Source = ConfigurationManager.AppSettings["MediaUrl"] + "Video01_EMISPurposeOverview.mp4";
       videoPlayer2.Source = ConfigurationManager.AppSettings["MediaUrl"] + "Video02_AccessHomepageOverview.mp4";
       videoPlayer3.Source = ConfigurationManager.AppSettings["MediaUrl"] + "Video03_PrintingInspections.mp4";
       videoPlayer4.Source = ConfigurationManager.AppSettings["MediaUrl"] + "Video04_EnteringResultsResolutionOptions.mp4";
   }

HTML snippet:

    <tr class="galleryRow">
<td>
<div class="videoWrapper">
<telerik:RadMediaPlayer ID="videoPlayer1" runat="server" Source="" Width="300" />
<p class="videoCaption">EMIS Purpose Overview</p>
</div>
</td>
<td>
<div class="videoWrapper">
<telerik:RadMediaPlayer ID="videoPlayer2" runat="server" Source="" Width="300" />
<p class="videoCaption">Homepage Access & Overview</p>
</div>
</td>
<td>
<div class="videoWrapper">
<telerik:RadMediaPlayer ID="videoPlayer3" runat="server" Source="" Width="300" />
<p class="videoCaption">Printing Inspections</p>
</div>
</td>
</tr>

Stuart at Enjo Oz
Top achievements
Rank 1
 answered on 11 Feb 2020
2 answers
5.1K+ views

This topic is a constant source of confusion for me. Often referenced web pages sometimes seem out of date or conflicting. It's not clear whether the information is accurate for a specific release or for all time. I was going to blog this but maybe it's better if we can create a single forum thread here to become the definitive statement for the web.config definition of Telerik.Web.UI.WebResource.axd.

Here's one excellent reference on the topic:
http://www.telerik.com/help/aspnet-ajax/radscriptmanager.html
Really I think this information applies to most or all controls, but if you're aware of any exceptions for Telerik controls, please post a response here.

For IIS6, consider the following <httpHandler> lines:

<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/> 

and

<add path="Telerik.Web.UI.WebResource.axd"
     
type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
  
  verb="*"
     validate="false" />

When Telerik.web.ui is set to Copy Local (not GAC), is it better to not specify the PublicKeyToken?
Is it OK if we do when the DLL isn't in the GAC?  I think so.
Does the PublicKeyToken ever change?  I don't think so.

For IIS7, consider the following <system.webServer><handlers> lines:

<add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd"
     type="Telerik.Web.UI.WebResource"
   
 verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>

and

<add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd"
     type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
     verb="*" preCondition="integratedMode"/> 

I don't think the answer to the above questions is different for IIS, but if they are, please let us know.

Given the above, if you're not using the GAC, you should probably never have to change these web.config entries for a given site after they are initially set. See below if you're using the GAC.

Regarding that preCondition runtimeVersion2.0 spec, I'm thinking it doesn't need to be there. The documentation for that attribute says: "Specify the runtimeVersionv2.0 value when the handler should respond only to requests in application pools that are configured to use .NET Framework version 2.0.". I think this is a hold-over from when people were transitioning from v1.1 to 2.0. These days all application pools should be configured for .NET2.  The question becomes: what happens with .NET 3.x or .NET 4? Is it better to add that attribute parameter for the future, or to leave it out for the future?

The help page referenced above provides this sample for IIS7 when Telerik.web.ui.dll is in the GAC:

<add name="Telerik.Web.UI.WebResource"
    
path="Telerik.Web.UI.WebResource.axd" verb="*"
    
type="Telerik.Web.UI.WebResource, Telerik.Web.UI, 
           Version=[ASSEMBLY_VERSION], Culture=neutral, PublicKeyToken=121fae78165ba3d4"
 />

For anyone not familiar with the syntax, the question might arise:
- Should the name attribute have underscores or periods?
I don't know. See this page for an example where underscores are used:
http://dotnetnotes.i-do-it.com/2009/05/17/CouldNotLoadFileOrAssemblyTelerikWebUI.aspx
I've seen that syntax elsewhere but I'm not sure if it's for web page formatting or if it's valid web.config formatting.

Note that for GAC references the assembly version is required, since the GAC can contain multiple assemblies for the same component but different versions.  The ASSEMBLY_VERSION must be the full version ID for your RadControls release.  For example:
Version=2009.3.1103.35
or
Version=2009.3.1314.35
In this case the PublicKeyToken is required.  More information on the topic is available here:
http://www.telerik.com/help/aspnet-ajax/web-resources-troubleshooting.html

What that means is that if you use the GAC to avoid having multiple copies of DLLs laying around, or to avoid having one application with DLLs for with 2009Q1 and another with 2009Q3, then you need to change web.config to use a specific version of RadControls whenever you upgrade your environment - that is, if you want a specific application to use the new version.

Why did I write this?  I was recently chasing down errors where FireBug is reporting 401 Unauthorized errors for WebResource.axd and Teleric.Web.UI.WebResource.axd. Fiddler2 reports no such errors.  Confused about this I started looking closely at my web.config and settings in my IIS6. I still haven't resolved those issues but I think I have a better understanding of what should be in web.config, so I thought I'd post a discussion on the topic here.  I hope this helps someone.

For anyone doing a search on this topic in the future, please correct any mis-information and provide links to solid resources on the topic. Again, it's important to ensure that someone can tell whether the information they see is only good for the current release, or if it applies to all releases.

Empire
Top achievements
Rank 1
 answered on 11 Feb 2020
1 answer
186 views

Hopefully this question has a simple answer.  I'm using a RadGrid with 1 hard coded column, and several autogenerated columns.  The grid is mapped to a file uploaded by the user that has unknown columns.  In the header for each dynamic column, i'm inserting a RadComboBox that allows the user to map the column from a predefined list of valid column names.  I add these RadComboBoxes in the ItemCommand event handler.  This works without issue.  When the user is finished making their selections in each of the RadComboBoxes, i need to capture the values from each of the RadComboBoxes and i do this using a custom item command. This is also working well with one caveat.  It only works great if the button that fires the ItmCommand is in the RadGrid header.  This is not ideal just from a display point of view.  i'd prefer to have the button below the grid.  I read through the docs and saw that i can fire a command event via javascript using the masterTable.fireCommand("CustomCommandName");  This works except that i need to be able to pass in a context that tells the server-side event handler that i need access to the header row.  When i use the button in the header and i step through my server-side ItemCommand code i can see that e.Item is of type GridHeaderItem which is perfect, this allows me to access the e.Item.Cells[x].Controls collection to find the RadComboxBox and extract the value that was selected by the user.  When i step through the same server-side ItemCommand code using the button located outside the grid (called via)  masterTable.FireCommand(), e.Item is of type GridDataItem instead of GridHeaderItem and so i'm not able to access the header row controls to find the RadComboBoxes and extract their values.   I can see that fireCommand accepts a commandargument parameter after the command name, but so far i'm not able to figure out what value should be sent to indicate that the command should be fired in the context of the header row and not an item row.  I've tried several different numeric values including -1, 0 and numbers > 0.  In each instance when the event fires e.Item is of type GridDataItem, which is no good.

The one work around that does seem to work, but is a little bit of a hack is to copy the actual javascript code of the button in the header, and then create a button outside the grid that mimics that.  This works, but i end up with something hard coded that looks like this:

<a id="ctl00_MainContent_rgMapFields_ctl00_ctl02_ctl00_lbtnImport1" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$MainContent$rgMapFields$ctl00$ctl02$ctl00$lbtnImport&quot;, &quot;&quot;, true, &quot;MapFields&quot;, &quot;&quot;, false, true))">Import</a>

This works but it doesn't leave me with a good feeling to rely on this too heavily.  It seems like there should be a simple answer as to what command argument i pass into the fireCommand Javascript method to indicate a command argument for the header.

 

Current javascript method is really basic and looks like this:

        function Import(sender) {
            var masterTable = $find("<%= rgMapFields.ClientID %>").get_masterTableView();
            masterTable.fireCommand("ValidateMapping", "");  // <-- something needs to go here other than ""
        }

I can provide code for the radgrid or any of the event handlers if needed, but i don't know that it's super relevant.  it is all working the way i want with the exception of just taking a button that fires an item command from the header and placing it below the grid.  

Thanks!

-Mark

 

Eyup
Telerik team
 answered on 11 Feb 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?