Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
177 views

 

I'm using AJAX RadImageEditor in an aspx page:

                <telerik:RadImageEditor ID="RadImageEditorFront" CssClass="ImageCtrl"  runat="server" Skin="Telerik" Width="545px" Height="300px" RenderMode ="Lightweight" StatusBarMode="Hidden" style="top: 0px; left: 0px">
                    <Tools>
                        <telerik:ImageEditorToolGroup>
                            <telerik:ImageEditorTool Text="ZoomIn" CommandName="ZoomIn" /> 
                            <telerik:ImageEditorTool Text="ZoomOut" CommandName="ZoomOut" />
                            <telerik:ImageEditorTool Text="ZoomOut" CommandName="Zoom" />
                            <telerik:ImageEditorTool Text="Rotate Right" CommandName="RotateRight" /> 
                            <telerik:ImageEditorTool Text="Rotate Left" CommandName="RotateLeft" />
                            <telerik:ImageEditorTool Text="Flip Vertical" CommandName="FlipVertical" />
                        </telerik:ImageEditorToolGroup>                

                    </Tools>
                </telerik:RadImageEditor>

 

I need to change the percentage that the AJAX RadImageEditor zooms in or out on the loaded image when I call the client side methods zoomIn() or zoomOut().

When I use the client side methods zoomIn() or zoomOut(), the image is zoomed in at 50%.

var radImageEditor = $telerik.findControl(document.documentElement, $(this).attr("id"));

radImageEditor.zoomIn(); or radImageEditor.zoomOut();

(note: jQuery code above)

I have tried zoomImage(zoomLevel, shouldUpdateUI), but that did not appear to be the solution (the image became a small dot on the screen).

How can I change the zoom in and zoom out percentage (scale) to 10% for the AJAX RadImageEditor - or asked another way - how can I get the image to scale 10% (instead of 50%) each time I call zoomIn() or zoomOut (or another zooming method)? 

 

Vasko
Telerik team
 answered on 24 Nov 2023
1 answer
218 views

Hello,

I have a grid with

EditMode='Batch' 
<BatchEditingSettings EditType="Cell" OpenEditingEvent="DblClick"/>

When I double-click on the cell it (the cell) goes into edit mode which is expected behavior, however I need to achieve the same result by pressing another button located on the same page as grid.

Following code puts entire row into edit mode, but I wonder is there a method to invoke for editing single cell only.

masterTable.editItem(masterTable.get_selectedItems()[0].get_element());
Please advise.
Vasko
Telerik team
 answered on 22 Nov 2023
1 answer
210 views

I have a Weight column in my RadGrid, which I'm using a CustomValidationFunction, which is working fine. It disallows invalid values.

But I want blank, 0 (or below) to be set automatically to the minimum value allowed, rather than making the user put it in manually. How can I accomplish this?

 

Here is the column I'm validating:

                                <telerik:GridTemplateColumn UniqueName="Weight" HeaderText="Weight" DataField="Weight" AllowFiltering="false">
                                    <ItemTemplate><%# Eval("Weight") %></ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="WeightAmt" runat="server" />
                                        <asp:CustomValidator runat="server" ID="WeightValidator" EnableClientScript="true" ControlToValidate="WeightAmt"
                                            ClientValidationFunction="WeightValidator" />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
And here is the validation function as it currently stands:

        function WeightValidator(sender, args) {
            var thisWeight = parseInt(args.Value);
            if (thisWeight > maxWeight) {
                sender.textContent = "Weight may not be larger than " + maxWeight;
                args.IsValid = false;
                return;
            }
            if (thisWeight < 1) {
                thisWeight = minWeight;
                arguments[0].parentElement.parentElement.getElementsByTagName("input")[0].textContent = minWeight.toString();
            }
            if (thisWeight < minWeight) {
                sender.textContent = "Weight may not be smaller than " + minWeight;
                args.IsValid = false;
                return;
            }
            args.IsValid = true;
        }
Debug indicates the `arguments` statement sets the value, but this isn't actually tied to anything on the page, so it gets lost. The only place I see the cell value is in a hidden `div` (`style="display: none")` and I don't see any way of changing that.

In searching for a solution, I see it is recommended to edit the `innerHTML`, but that doesn't even contain the value I'm wanting to edit.

Is there a good way for validation to correct data errors that it can instead of just calling it invalid?

Vasko
Telerik team
 answered on 16 Nov 2023
1 answer
124 views

Hi

I have an application that had a telerik Rad Grid, with filtering enabled.

The application can be opened via another application, passing filters to the first 2 columns like below. However when passing the filters like this the rows are not reflecting what is in the filter. If I was to manually enter the value in the filter it will work.

 

I have this in my code for ItemDatabound

 protected void rg_CallDetails_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(department))
                {
                    rg_CallDetails.MasterTableView.FilterExpression = "([Department] " + "LIKE " + "\'%" + department + "%\' AND [CallNumber] " + "LIKE " + "\'" + callTypePre + "%\' ) ";
                    GridColumn column = rg_CallDetails.MasterTableView.GetColumnSafe("Department");
                    column.CurrentFilterFunction = GridKnownFunction.Contains;
                    column.CurrentFilterValue = department;


                    //rg_CallDetails.MasterTableView.FilterExpression = "([CallNumber] " + "LIKE " + "\'" + callTypePre + "%\') ";
                    GridColumn columnCallType = rg_CallDetails.MasterTableView.GetColumnSafe("CallNumber");
                    columnCallType.CurrentFilterFunction = GridKnownFunction.Contains;
                    columnCallType.CurrentFilterValue = callTypePre;

                    rg_CallDetails.MasterTableView.Rebind();

                }
            }

        }

But the application errors with stackoverflow exception error on the rebind.

I have tried rg_CallDetails.Rebind()

But also gives the same error.

Any advise please?

Thanks

 

                                       
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 15 Nov 2023
1 answer
184 views

Hi all,

I'm basically trying to create something similar to the demo presented here:

https://demos.telerik.com/aspnet-ajax/multiselect/virtualization/defaultcs.aspx

I've got a web service as a data source, and everything works (and looks) great without virtualization. I would obviously like to reap the benefits of virtualization, since the multiselect could potentially need to pull in a lot of data.

The issue occurs when I'm trying to select an item:

Telerik.Web.UI.WebRe…1f%3a619d6d01:13732 Uncaught TypeError: Cannot read properties of null (reading 'toJSON')
    at init.select (Telerik.Web.UI.WebRe…3a619d6d01:13732:38)
    at init.trigger (Telerik.Web.UI.WebRe…%3a619d6d01:5322:14)
    at init._select (Telerik.Web.UI.WebRe…%3a619d6d01:13489:7)
    at init._click (Telerik.Web.UI.WebRe…%3a619d6d01:13247:3)
    at init.d (Telerik.Web.UI.WebRe…a619d6d01:2435:3873)
    at init.trigger (Telerik.Web.UI.WebRe…%3a619d6d01:5322:14)
    at init._clickHandler (Telerik.Web.UI.WebRe…3a619d6d01:12931:54)
    at HTMLLIElement.d (Telerik.Web.UI.WebRe…a619d6d01:2435:3873)
    at HTMLUListElement.dispatch (Telerik.Web.UI.WebRe…619d6d01:2436:12445)
    at r.handle (Telerik.Web.UI.WebRe…a619d6d01:2436:9174)

Also, if I try to hook onto the OnSelect client-side event, it seems that the data item is not populated - my function onSelect(sender, args) gets triggered, but args.get_dataItem() returns null. Is it possible some binding didn't go as planned? Is there an extra step that needs to be done when using virtualization, or does perhaps some additional data need to be returned from the web service?

My VirtualSettings look like this:

<VirtualSettings ItemHeight="25" MapValueTo="dataItem" ValueMapper="valueMapper" />

and the ValueMapper isn't to blame because it's not getting triggered; I'm doing a simple scenario where there are no initially selected values to display.

I've tried going through docs for both RadMultiSelect and the Kendo control it wraps, but to no avail. I was initially using a version released in 2022, but have tried just replacing it with 2023.3.1010 - it didn't seem to help. I've also tried explicitly adding the  Virtual="true" option to my RadMultiSelect instance, but that seemed to have no effect either.

Thanks in advance,

Marko

Edit: I've also found the unanswered question regarding the same topic here:
https://www.telerik.com/forums/radmultiselect#1557910

I can't confirm whether the demo works, since it looks like the data source doesn't fetch any data:

Locally, if I basically copy/paste it and implement the web service, without virtualization everything works, when I add the VirtualSettings node, I'm getting the aforementioned error (probably caused by the fact that dateitem is actually null). I've also tried binding initial values, and they get displayed properly in the multiselect and can be deselected without issues.
branko
Top achievements
Rank 1
Iron
 answered on 15 Nov 2023
0 answers
102 views

Hi 

I have radgrid for an application that has the filters set to show.

When the page first loads and grid is populated the filter works successfully, however if I do anything like click on another button so the page reloads for example, the filters stop working. So when I click on the filter button the drop down of options does not show anymore.

Any advise on why its behaving like this please?

Thanks

Rakhee

Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 15 Nov 2023
1 answer
90 views

I have a RadGrid using BatchEdit mode. The automated validation is working fine, but I want to program in an exception: blank values are not allowed for fields, but the database is full of records with existing blank values. I want the validation to accept a blank value if the existing record already has a blank value.

Here is my validation method. Note that the attribute OriginalValue doesn't exist; it's part of my trying to find the original value, but adding it turned out to be problematic.

        function BlankFieldValidator(sender, args) {
            if (args.Value.length == 0) {
                if (sender.getAttribute("OriginalValue").length != 0) {
                    args.IsValid = false;
                }
            }
        }

In debugging the page, I can examine the sender and args objects, but I see nothing that contains the original value in it. I conclude it must be in the Telerik data structure somewhere, since one can still click Cancel Changes to revert all changes to the RadGrid.

What is a good method for retrieving the original value to compare to the edited value?

Vasko
Telerik team
 answered on 14 Nov 2023
0 answers
250 views

Validator text shows as required, however the message on the validator doesn't show in the asp:ValidationSummary control.

 

RBarnes
Top achievements
Rank 1
 asked on 08 Nov 2023
1 answer
86 views

Hi,

How to disable zooming?

Regards,

Omar

Vasko
Telerik team
 answered on 06 Nov 2023
1 answer
98 views

 

Sometimes i have unwanted suggestions in a grid on entry (like 11,122 in attached pic).

Is there a way to eliminate this?

 

 

 

Vasko
Telerik team
 answered on 06 Nov 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?