Telerik Forums
UI for ASP.NET Core Forum
1 answer
200 views

With reference to reported issue 

RichTextBox HtmlFormatProvider export overflow document (especially table),

Rad rich textbox Html Binding is not working when specific characters found in data and many other internal issues raised in RadRichTextBox in WPF with HTMLFormatProvider, we are considering to replace it with XamlFormatProvider.

We are designing our services in such way that it will provide HTML to old application while Xaml to WPF app. This can be done to export Telerik.Windows.Documents.Model.RadDocument to required format

I noticed that XamlFormatProvider is not available in Document Processing Asp.Net core. It means using WPF Radrichtext box with Web api's are not compatible. Currently we are unable to use XamlFormatProvider.

Another option we can consider to use DocxFormatProvider, but it export document as byte[], while our existing DB and web services structure accepts/response string data. So is there anyway to export DocxFormatProvider as Open Office Xml?

Another reason we cannot use byte[] or base64string in database, because we have search service. In this case we will unable to search on byte array or converted base 64 string.

 

 

Dimitar
Telerik team
 answered on 08 Apr 2022
1 answer
386 views

I have the following grid and it is properly displaying several records added to the list on page load:


@(Html.Kendo().Grid(IndexModel.logHolder.DataList)
    .Name("logGrid")
    .ToolBar(t => t.Search())
    .Columns(columns =>
    {
    columns.Bound(p => p.CreateDateTime).Title("Date/Time").Format("{0:MM/dd/yyyy hh:mm:ss}").Width(200);
    columns.Bound(p => p.ClientId).Title("Client ID").Width(150);
    columns.Bound(p => p.ClientName).Title("Client Name").Width(150);
    columns.Bound(p => p.Message).Title("Message");
    })
    .Pageable()
    .Sortable()
    .Scrollable(scr=>scr.Height(430))
    .Search(s => {
    s.Field(o => o.CreateDateTime, "eq");
    s.Field(o => o.ClientId, "eq");
    s.Field(o => o.ClientName, "contains");
    s.Field(o => o.Message, "contains");
    })
    .Filterable()
    .DataSource(dataSource => dataSource
    .Ajax()
    .PageSize(20)
    .ServerOperation(false)
    ))

I have some signalr code that is running and adding items to the list IndexModel.logHolder.DataList.  I can see in my code behind that items are in fact being added to the list.

Immediately after adding an item to the list, I am calling the following javascript to attempt to refresh the data, but it won't refresh:


function refreshData()
    {
        var grid = $("#logGrid").data("kendoGrid");
        grid.dataSource.read();
    }

What am I missing?

 

Thanks

 

 

Mihaela
Telerik team
 answered on 06 Apr 2022
1 answer
2.5K+ views

Hi Team,

In my application below jQuery version has been updated

"~/Scripts/jquery-3.6.0.min.js",
"~/Scripts/jquery-migrate-3.4.0.min.js", 

 

  After the upgraded version I am getting Uncaught TypeError: Cannot read properties of undefined (reading 'id')  this error 

In in my kendo grid like this  .Events(command => command.DataBound("onGridDataBound"))

 function onGridDataBound(e) {

        dataBoundNoResultsDisplayCheck(e);

//some custom business logic is here

}

and the error generating function is below 

 

   

function dataBoundNoResultsDisplayCheck(e) {

          switch (e.sender.table.context.id)

               {

                }

}

 

on the basis of id code is running but now after the update not able to get grid id can you help me on this finding workaround here for getting kendo grid id in event 

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 06 Apr 2022
1 answer
340 views

I am working on a media displaying application for use in-house.  The media player, as offered by Telerik, is an obvious choice.  While my initial attempts appear to be bearing fruit, I have run up against one item I cannot seem to crack.

The "toolbar" controls seem to never want to "hide".  That is when a video is displayed the controls appear to briefly overlay the videos lower portion allowing the user to adjust things.  While this is logical, they never seem to hide.

I have attempted to use the API to get a handle of the toolbar.  That works.  When I call the .hide() feature, nothing happens.

Ideally my goals are to hide both the controls and title bars.   Neither appear to be responding.

Am I missing something obvious?  While visually it is working, I am attempting to fine tune the user experience.

Here is a synopsis of the view displaying the media

@model ImageToolKit.Models.TitleModel

@{
    var urlValue = string.Format("{0}?id={1}", Url.Action("GetImageFromDb", "Home"), Model.Id);
}

    @(Html.Kendo().MediaPlayer()
        .Name("mediaPlayer")
        .AutoPlay(true)
        .Media(m => m
            .Title(Model.Title)
            .Source(@urlValue)
         )
         .Events(e => e.End("OnMediaPlayerEndOfMovieEvent"))
        .HtmlAttributes(new { style = "height:720px" })
    )

 

Tsvetomir
Telerik team
 answered on 06 Apr 2022
1 answer
324 views

I followed the direction in this forum post to disable the checkbox based on certain conditions:

https://www.telerik.com/forums/problem---select-all-checkbox-selects-disabled-row#login

Here's the runnable example:

https://dojo.telerik.com/alAtUWUb

However, when I click on the select-all checkbox, I realized selectedKeyNames() is selecting those that have been disabled.

You can verify that by adding "alert(this.selectedKeyNames().join(","));" in onChange function, and it will alert disabled checkbox id as well.

This is not desirable. How can I get the selectedKeyNames() for those checkboxes that are not selected?

Georgi Denchev
Telerik team
 answered on 06 Apr 2022
1 answer
120 views

When I configure like this

var supportedCultures = new[] { new CultureInfo("zh-CN") };//new CultureInfo("en-US"), new CultureInfo("zh-CN")

app.UseRequestLocalization(new RequestLocalizationOptions
{
    DefaultRequestCulture = new RequestCulture("zh-CN"),
    SupportedCultures = supportedCultures,
    SupportedUICultures = supportedCultures
});

and

	<link href="https://cdn.kendostatic.com/2022.1.301/styles/kendo.bootstrap-main.min.css" rel="stylesheet" type="text/css" />
	<script src="https://cdn.kendostatic.com/2022.1.301/js/jquery.min.js"></script>
	<script src="https://cdn.kendostatic.com/2022.1.301/js/jszip.min.js"></script>
	<script src="https://cdn.kendostatic.com/2022.1.301/js/kendo.all.min.js"></script>
	<script src="https://cdn.kendostatic.com/2022.1.301/js/kendo.aspnetmvc.min.js"></script>

    <script src="https://kendo.cdn.telerik.com/2022.1.301/js/cultures/kendo.culture.zh-CN.min.js"></script>
    <script src="https://kendo.cdn.telerik.com/2022.1.301/js/messages/kendo.messages.zh-CN.min.js"></script>
    <script>
        kendo.culture("zh-CN");
    </script>
</head>

The page effect is not displayed properly

I found that the second screen start of the scroll bar is not localized

But when I set it up like this


var supportedCultures = new[] { new CultureInfo("en-US") };//new CultureInfo("en-US"), new CultureInfo("zh-CN")

app.UseRequestLocalization(new RequestLocalizationOptions
{
    DefaultRequestCulture = new RequestCulture("en-US"),
    SupportedCultures = supportedCultures,
    SupportedUICultures = supportedCultures
});
_Layout.cshtml configuration remains unchanged

it shows correct

There is a problem with the product configuration documentation(https://docs.telerik.com/aspnet-core/globalization/localization)
Why is this? How can I remodel?
I use the default aspnet.core MVC project (V2022 R1 SP1)
grateful
Stoyan
Telerik team
 answered on 06 Apr 2022
1 answer
398 views

Afternoon.

I have a MVC Grid with popup editing, created using an example posted on a previous question from me:

https://www.telerik.com/forums/grid-popup-editing-1551548

The popup edit only updates some of the fields in the grid.

I have a datetime field Dateinpost which is set when the record is created - it doesn't need to be updated.

I have set its format in the model:

        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        [DataType(DataType.DateTime)]
        public DateTime? Dateinpost { get; set; }

It doesn't need to appear on the popup template, but I have included it here so that you can see its value:

    <div class="k-edit-field">
        @Html.EditorFor(model => model.Dateinpost)
    </div>

When I update any of the values I get the following ModelState error in the Update action, and the value of Dateinpost in the model is null;

As you can see, the format of the date in AttemptedValue is not correct.

I could write a work around that would clear the ModelState error and not update that field, as it's not to be updated anyway, but it seems that shouldn't be necessary.  I've also tried using a date format of "dd/MM/yyyy HH:mm:ss" but that doesn't work either.

Kind regards,

Richard

Tsvetomir
Telerik team
 answered on 06 Apr 2022
1 answer
1.3K+ views
I have used templates to alter the styling of my inline edit and delete buttons. How can I now change the update and cancel buttons to match?
Tsvetomir
Telerik team
 answered on 05 Apr 2022
1 answer
592 views

I have been trying to figure out why the model value is not binding to the RadioGroupFor control.

For instance:

@Html.Kendo().RadioGroupFor(m => m.Auth).BindTo(BoolYesNo.Items).Layout(RadioGroupLayout.Horizontal)
What am I doing wrong?
Alexander
Telerik team
 answered on 04 Apr 2022
2 answers
1.1K+ views

I need to show a command button conditionally based on data in the grid.  I'm using the example in the link below but it's not working.

If I leave off the parentheses in the visible property then the javascript call never gets made.  If I add them, the javascript call does get made but the data parameter is undefined. 

I am using Core and the Razor syntax, not MVC and the HTML helpers as the example shows but I would assume the same concept should work.  Any ideas on why this is not working?

ASP.NET MVC Data Grid Component Show Command Buttons Conditionally | Telerik UI for ASP.NET MVC


<commands>
<column-command name="questionanswers" click="goToQuestionAnswers" class-name="link-button" text="Answers" visible="isAnswerButtonVisible()"></column-command> <column-command name="edit" class-name="link-button" icon-class="k-no-icon"></column-command> <column-command name="destroy" class-name="link-button" icon-class="k-no-icon" text="Delete"></column-command> </commands>
    function isAnswerButtonVisible(data) {
        return data.QuestionType !== "TrueFalse";
    }


John
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 04 Apr 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?