Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
456 views
I have a RadGrid setup so that the Edit is done in the modal popup.

Is there anyway to disable the "draggability" of the popup?

I want the popup window to stay where it is displayed initially.  I don't want the users to be able to drag it around. 

(Don't ask - long story)  :)

Any help would be appreciated-

Thanks-

John
Top achievements
Rank 1
 answered on 03 Jan 2020
3 answers
225 views
hi,

Find the attached grid image

I am using nestedviewtemplate in my application. i am saving the grid values using this query
 gvAddPlans - This original grid
gvAddSubPlans - This is nestedview grid

For Each item As GridDataItem In gvAddPlans.Items
 Next

How to get NestedView grid values.

i used this query

For Each NesItem As GridNestedViewItem In gvAddPlans.Items
Next

but it is not working
please give me any idea for this one.

Thanks,
Eyup
Telerik team
 answered on 03 Jan 2020
1 answer
118 views

I have a RadDataForm that contains several RadDropdownLists.   They are all using client binding each with their own instance of RadClientDataSource.

 

How can I unsure the dropdown list data is retrieved and bound before the dataform data is retrieved and attempted to bind?

 

eg.  I have event handler on OnSetValues as follows:

<telerik:RadDataForm RenderMode="Lightweight" runat="server" ID="RadDataForm1"
    DataKeyNames="RecordID" RenderWrapper="true"  ClientDataSourceID="RadClientDataSource1">
    <ClientSettings>
        <ClientEvents OnSetValues="dataFormSetValues" OnGetValues="dataFormGetValues" OnDataFormCreated="dataFormCreated"       />
    </ClientSettings>

 

function dataFormSetValues(sender, args) { 
 
        var dataItem = args;
 
       $telerik.findControl(document, "EditJobTypeDD").findItemByValue(dataItem.JobType).select();
 }

 

The .select() in the javascript function above will fail occasionally when the webservice for the form data returns quicker than the webservice to populate the dropdown list, because there are no items in the dropdownlist yet.

 

Is there a best practice to implement this sort of scenario correctly?

Eyup
Telerik team
 answered on 02 Jan 2020
3 answers
116 views

Hi All,

I copied the demo code for Excel-Like filtering (here) into one of my projects, but the checkboxes in the filterlist are not rendering. However, they do render in the demo app on the Telerik website.

Possible bug in my version of the controls? I'm on 2019.3.1023.45.

Thx in advance - M.

Rumen
Telerik team
 answered on 31 Dec 2019
1 answer
172 views

Hi all

I am trying to create a RadGrid where the value of the product tags are replaced by the tag name. I attached and image for the grid I want to replace the product tag column with the names instead of the values.

Eyup
Telerik team
 answered on 31 Dec 2019
2 answers
246 views

Hi there,

 

I'm trying to use RadlistBox with custom item template under RadAjaxPanel where my page is a webform which use a MasterPage file.

And I'm receiving the following error:

Server Error in '/' Application.

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).] System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +9812992 Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +142 [HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.] Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +190 Telerik.Web.UI.RadAjaxControl.PerformRender() +405 Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1187 Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +75 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +270 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +14 System.Web.UI.Page.Render(HtmlTextWriter writer) +30 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +67 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +101 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1342

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.3752.0

 

How can I solved it? below is my asp.net webform  declaration.

 

Looking forward to your earliest reply,

Thanks,

Hagai.

<telerik:RadAjaxPanel ID="RadAjaxPanelPublications" runat="server">
   <telerik:RadListBox ID="RadListBoxPublications" runat="server" AllowReorder="True" EnableDragAndDrop="True" SelectionMode="Multiple" Width="98%" Height="700px">      
       <ItemTemplate>           
           <div class="row">
               <div class="col-md-9">
                   <div dir="<%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Language == Idc.FacultySites.Models.Publication.LanguageName.Hebrew? "rtl" : "ltr" %>"
                       class="<%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Language == Idc.FacultySites.Models.Publication.LanguageName.Hebrew? "text-right-fix" : "text-left-fix" %>">
                       <a id="PublicationLink" runat="server">
                           <%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Text %>
                       </a>
                   </div>
               </div>
               <div class="col-md-1"> </div>
               <div class="col-md-2">
                   <div class="row">
                       <div class="col-md-2">
                           <telerik:RadButton ID="RadButtonEditPublication" runat="server" RenderMode="Lightweight" ToolTip="<%$ Resources:FacultySites, Edit%>" CommandArgument="<%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Id %>" OnCommand="RadButtonEditPublication_Command">
                               <ContentTemplate>
                                   <span class="glyphicon glyphicon-edit"></span>
                               </ContentTemplate>
                           </telerik:RadButton>
                       </div>
                       <div class="col-md-2">
                           <telerik:RadButton ID="RadButtonDeletePublication" runat="server" RenderMode="Lightweight" ToolTip="<%$ Resources:FacultySites, Delete%>" OnClick="RadButtonDeletePublication_Click" CommandArgument="<%# (DataBinder.GetDataItem(Container) as Idc.FacultySites.Models.Publication).Id %>" OnCommand="RadButtonDeletePublication_Command">
                               <ContentTemplate>
                                   <span class="glyphicon glyphicon-remove"></span>
                               </ContentTemplate>
                               <ConfirmSettings ConfirmText="<%$ Resources:FacultySites, GeneralActionConfirmMessage%>" />
                           </telerik:RadButton>
                       </div>
                       <div class="col-md-8"> </div>
                   </div>
               </div>
           </div>
           <div class="row">
               <div class="col-md-12"> </div>
           </div>               
       </ItemTemplate>
   </telerik:RadListBox>
   </telerik:RadAjaxPanel>

 

Eyup
Telerik team
 answered on 31 Dec 2019
12 answers
235 views

Hello,

I have my grid in ajaxpanel.

With one Edit link button,

When I click on Edit button my header flicks.

Is there any way to find Linkbuttons ClientDatakey so that we can avoid post back ?

Thanks 

Ashish

Eyup
Telerik team
 answered on 31 Dec 2019
1 answer
119 views

There's an oddity when using shift and the left arrow key to select text, where it will skip the first character and then start over. This only happens when using the left arrow, and only at the last word in a line, which makes me think that there's something strange going on with how whatever this is treats the ends of lines.

Highlighting using arrow keys top to bottom and right to left seems fine. But highlighting left to right and bottom to top, seems to cut off highlighting and it doesn't highlight the text as you expect, but instead un-highlights sections you've previously highlighted. 

Reproducible here https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx 

Any help would be appreciated.

Rumen
Telerik team
 answered on 30 Dec 2019
1 answer
177 views
     Hi;

I had added the radnavigation to a masterpage. Everything works well if there is no ajax postback in pages.. When you make a ajax postback with ajaxmanagerproxy in a page, the navigation locks and can't use.. Only nodes without subitems can be clickable...
Rumen
Telerik team
 answered on 30 Dec 2019
9 answers
491 views

I’m trying to set up a call to an api method inside of some client side javascript.
The javascript function (GetDb) is called from the ClientEvents-OnValueChanged event of a RadMaskedTextBox

In that javascript function I set the url of a RadClientDataSource and do a fetch. To be honest I don’t completely understand how this works and how I can access the data using the RadClientDataSource after the fetch. My goal is to call the api through the javascript and get data back that I need to use.

As you can see in the RadClientDataSource, I have a dummy url which I replace in the Javascript function GetDb. I did this because if there was an empty url in the RadClientDataSource I was unable to set the dataSource._transport.read.url in the javascript. The url will have to be created dynamically in the long run (right now it’s hard coded) so I am changing the transport url in the javascript. Eventually the final parameter in the rest call in the url will have to be passed and will be variable.

From what I can see the a RadClientDataSource is not being activated and the api method is not being called. After the fetch I looked at the data source property and there were no rows

I set up the API by creating a Controllers folder in my project and then adding a scaffolded controller that uses Entity framework. This API controller inherits from APIController.

I tested the controller by running the function I want to use (GetMeasureByControlName) in fiddler and it worked.

Below is the code. I pieced this together from existing examples but there is none that do exactly what I want. I’d appreciate any help.

<telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server" Width="80px" Mask="##.##" ClientEvents-OnValueChanged="GetDb" >  </telerik:RadMaskedTextBox>



<telerik:RadClientDataSource runat="server" ID="RadClientDataSource1">
    <DataSource>
        <WebServiceDataSourceSettings ServiceType="OData">
            <Select Url="localhost:53558/api/measure/GetProductById/blah" DataType="JSONP" />
        </WebServiceDataSourceSettings>
    </DataSource>
</telerik:RadClientDataSource>

I set a dummy url because unless there was something in there I couldn’t reset the transport url below in GetDb (javascript function).

 

Here is Clientside code called by the RadMaskedTextBox1 above:

function GetDb(sender, args) {
            debugger;
            var docTypeID='<%=Session["DocTypeId"]%>';
            if (args != null) {
                var value = args.get_newValue();
                var dataSource = $find("<%= RadClientDataSource1.ClientID%>");
                dataSource._transport.baseUrl = 'http://localhost:53558/api/documentmeasuretypes/';
                dataSource._transport.read.url = dataSource._transport.baseUrl + "GetMeasureByControlName/CYLINDER%20BLOCK%20HEIGHT";
                dataSource.fetch();
                var items = dataSource.view();
                var item = items[0];
                alert(item);
                alert('after fetch');
            }
        }

After the fetch the Total rows in the data source was 0.

The controller method does work; I tested it in fiddler. Here it is.
        public DocumentMeasureType GetMeasureByControlName(string controlname)
        {
            using (APIManufacturingEntitiesConsolidated db = new APIManufacturingEntitiesConsolidated())
            {
                var product = db.DocumentMeasureTypes.FirstOrDefault(m => m.MeasureName.Contains(controlname));
                if (product == null)
                {
                    throw new HttpResponseException(HttpStatusCode.NotFound);
                }
                return product;
            }
        }

 

And here is the routing:
  RouteTable.Routes.MapHttpRoute(
           name: "ActionApi",
           routeTemplate: "api/{controller}/{action}/{controlname}",
           defaults: new { id = RouteParameter.Optional }
);

            RouteTable.Routes.MapHttpRoute(
            name: "DefaultApi",
            routeTemplate: "api/{controller}/{id}",
            defaults: new { id = System.Web.Http.RouteParameter.Optional }




Eric R | Senior Technical Support Engineer
Telerik team
 answered on 27 Dec 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?