Telerik Forums
UI for ASP.NET Core Forum
5 answers
455 views

Hi, i have a chart see attached image.

1. How can i hide the "Total" label from the Legend and the corresponding column?

2. Sorting doesn't seem to work

Here's 

@(Html.Kendo().Chart<UpdateLine>()
    .Name("chart")
    .Title("API Calls")
    .Legend(legend => legend
        .Position(ChartLegendPosition.Top)
    )
    .SeriesDefaults(defaults => defaults
        .Column()
        .Visual("chartVisual")
    )
    .Series(series =>
    {
        series.Column(model => model.Count).Name("#= group.value #").CategoryField("Date");
 
        series.Line(model => model.Total, x => x.Date)
            .Color(Colours.Orange)
            .VisibleInLegend(false)
            .Axis("Total");
    })
    .SeriesColors(Colours.Blue, Colours.Orange, Colours.Grey, Colours.Yellow, Colours.LightBlue, Colours.Green)
    .ValueAxis(axis => axis.Numeric()
        .Labels(l => l.Format("{0:N0}"))
    )
    .CategoryAxis(axis => axis
        .Date()
        .Name("DateAxis")
        //.Min(1)
        .Labels(labels => labels.Format("dd MMM"))
    )
    .ValueAxis(axis => axis
        .Numeric()
        .Name("Total")
        .Title("Total Calls")
        .Color(Colours.Orange)
    )
    .Tooltip(tooltip => tooltip
        .Visible(true)
        .Format("{0:N}")
        .Template("#= series.name #: #= kendo.format('{0:N0}', value) #")
    )
    .Events(events => events.
        DataBound("onDataBound")
    )
    .DataSource(dataSource => dataSource
        .Read(read => read.Action("Chart", "Updates"))
        .Group(group => group.Add(model => model.Zone))
        .Sort(sort => sort.Add(model => model.Date).Descending())
    ))
Nikolay
Telerik team
 answered on 04 Mar 2021
2 answers
124 views

I need to create custom editor for employee leave requests. I know how to create custom template but I am not sure how to change that title in title bar. I want it to be name of the employee since it is not event but rather leave request in my case. 

 

Igor Stefanovic
Top achievements
Rank 1
 answered on 03 Mar 2021
3 answers
1.2K+ views

Hi Progress,

 

Im trying to make an grid view that uses an edit button. My goal is for the user to be taken to another page (an edit page) when pressing that button. I do not want inline editing of that item. Since i found the tag helpers very useful and readable, making it easier for other developers to read them, i im currently looking to make an navigation between edit button and passing an value to an View where Customer is supposed to edit the chosen item.  

 

Iv'e tried the following without any luck:

actionlink through using your taghelpers.

         <update  url="@Url.Action("Edit", "VehicleHome", *What do i post here* )"type="PATCH" />

 

<commands>
                        <column-command text="Edit" name="edit">/*What do i post here*/</column-command>
                    </commands>

 

However i do not know how to pass an value of the item i want to edit through taghelpers. 

 

My grid looks as followed.

   <kendo-grid name="VehicleHome" height="550">
            <columns>
                <column field="Id" title="ID">
                    <filterable enabled="false"></filterable>
                </column>
                <column field="Name" title="Namn" />
                <column field="Street" title="Gata" />
                <column field="PostalCode" title="Postnummer" />
                <column>
                    <commands>
                        <column-command text="Edit" name="edit"></column-command>
                    </commands>
                </column>
            </columns>
            <scrollable enabled="true" />
            <sortable enabled="true" />
            <pageable enabled="true" />
            <filterable enabled="true" />
            <pageable button-count="5" refresh="true" page-sizes="new int[] { 5, 10, 20, 50}"></pageable>
            <datasource type="DataSourceTagHelperType.Ajax" page-size="20">
                <transport>
                    <read url="@Url.Action("Get_VehicleHomes", "Grid")" type="GET" />
                    <update  url="@Url.Action("Edit", "VehicleHome", 1 )"type="PATCH" />
                </transport>
            </datasource>
        </kendo-grid>

 

Thank you!

Nikolay
Telerik team
 answered on 01 Mar 2021
2 answers
166 views
I upgraded Telerik UI ASP.NET Core NuGet package from 2018.1.226 to 2021.1.119. The application contained references https://kendo.cdn.telerik.com/2018.1.221/*. (I'm not sure why there was an inconsistency between 226 and 221.) When I change all the cdn references to https://kendo.cdn.telerik.com/2021.1.119/*, there are many small styling inconsistencies throughout the application. Should have approach have given me the same styling? Did I do something wrong?
Steve
Top achievements
Rank 1
 answered on 26 Feb 2021
1 answer
149 views

Hi!

When I load an Excel-File from disk to show it inside Spreadsheet component the font families are not taken into account. For example, I formatted a cell with Arial Black, but it only shows Arial. How can I ensure that the fonts are included in the import?

Regards
Heiko

Misho
Telerik team
 answered on 26 Feb 2021
6 answers
78 views

Ok, I've got a grid like so-

 

@(Html.Kendo().Grid<Honovi.ACT.MVCCore.Models.Bond>()
      .Name( "GridBond" )
      .Columns( columns =>
      {
    
        //columns.Bound ( p => p.BondBotyNumber ).ClientTemplate ( " #= BondBotyNumberNavigation ? BondBotyNumberNavigation.BotyDesc : '' # " ).Title ( "Type" );  // works for edit but clicking add button fails
        //columns.Bound (p => p.BondBodyNumber.BodyDesc) // works for edit but clicking add button fails
         columns.Bound( p => p.BondBotyNumber ); works, but I want display the description here
      
        // Bunch of other columns
        columns.Command( command => { command.Edit(); command.Destroy(); } ).Width( 172 );
      } )
      .ToolBar( toolbar => toolbar.Create() )
       .Editable( editable => editable.Mode( GridEditMode.PopUp ).TemplateName( "_Bond" ).Window( w =>
            w.Title( "\uD83D\uDD89 Manage Bonds" ) 
            .Name( "winRate" )
            .Width( 560 )
       ) )
      .Selectable( selectable => selectable.Mode( GridSelectionMode.Single ) )
      .Pageable()
      .Sortable()
      .DataSource( dataSource => dataSource
          .Ajax()
          .PageSize( 10 )
          .Model( model => model.Id( p => p.BondGuid ) )
          .Events( events => events.Error( "error_handler" ) )
          .ServerOperation( false )
          .Read( read => read.Action( "Bonds_Grid_Read", "Bonds", new { corpGuid = Model.CorpGuid } ) )
          .Update( update => update.Action( "Bonds_Grid_Update", "Bonds" ) )
          .Create( update => update.Action( "Bonds_Grid_Create", "Bonds", new { corpGuid = Model.CorpGuid } ) )
          .Destroy( update => update.Action( "Bonds_Grid_Destroy", "Bonds" ) )
      )
)

 

The problem I'm having is with the column.  It is a navigation property on my model that is a foreign key that relates back to another model that is just an int / string that is used for a drop down.  On the grid the edit button works fine.  But when I click the add button nothing happens and I get the following js error in the console-

ReferenceError: BondBotyNumberNavigation is not defined[Learn More]  kendo.all.min.js%20line%2025%20%3E%20Function:3:66

If I comment out the offending navigation property and just use the int value (as above) the add button works and I get no error.

Note I'm using with EditMode.Popup if that matters.  Also I can post model code and such but it is pretty vanilla so I'm thinking I'm missing something more basic.

A little help!  Thanks.

 

 

 

 

 

Dimo
Telerik team
 answered on 26 Feb 2021
1 answer
182 views
Can I have this expander work vertically instead of horizontally?  Also, the default styling puts a box around it.  How do I change the style of this control so all I see is the title and the open/close handle?
Georgi Denchev
Telerik team
 answered on 25 Feb 2021
1 answer
129 views

Hi, first time posting here so let me know if I'm doing anything wrong.

 

I'm using a RadAsyncUploader to stash a file on S3. When a file is selected, it gets put into a virtual directory. Then when the "submit" button is clicked, the file is grabbed from the virtual directory and uploaded to S3. When I'm doing all of this locally, the whole process works perfectly fine. However, when I put the code on a server, I get a 500 error on file selection. I believe that this means that the RadAsyncUploader can't find the virtual directory.

 

Any ideas on why this is happening? I'll put the html where the uploader is defined below:

 

<telerik:RadAsyncUpload ID="radULDocument" runat="server" CssClass="ppUpload" MaxFileSize="10240000" AllowedFileExtensions="jpg,pdf,png" TargetFolder="~/tempImageUpload/original" AutoAddFileInputs="false" PostbackTriggers="btnSubmit" OnClientAdded="uploadLoaded" OnClientFileUploaded="fileUploaded" Localization-Select="Browse" Localization-Remove="Remove" />

Attila Antal
Telerik team
 answered on 24 Feb 2021
3 answers
230 views

Hi,

I'm using this example: https://demos.telerik.com/aspnet-core/grid/detailtemplate

I'm using the same apart from the "Orders" Tab i have called it "Notes", everything is working as expected. But i'd like to put the count of Notes also in the Tab Text i.e.

Text("Notes (#=kendo.format('{0:N}', data.aggregates.Note.count)#)")

 

I added the aggregate in the DataSource:

.Aggregates(aggregates =>
{
    aggregates.Add(p => p.Note).Count();
})

 

But i get the following console error:

Uncaught TypeError: data.aggregates is undefined

 

Is there anyway to achieve what i'm after?

 

 

--- Complete Tab Code:

items.Add().Text("Notes (#=kendo.format('{0:N}', data.aggregates.Note.count)#)").Content(
    @<text>
    @(Html
        .Kendo()
        .Grid<TaskReportLineNote>()
        .Name("grid_#=JobNumber#")
        .Columns(columns =>
        {
            columns.Bound(o => o.Posted).Width(150).Format("{0:dd/MM/yyyy HH:mm:ss}");
            columns.Bound(o => o.Poster).Width(250);
            columns.Bound(o => o.Note);
        })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(5)
            .Sort(sort => sort.Add(p => p.Posted).Descending())
            .Aggregates(aggregates =>
            {
                aggregates.Add(p => p.Note).Count();
            })
            .Read(read => read.Action("GridNotes", "TaskReport", new { TaskId = "#=TaskId#" })))
        .Pageable()
        .Sortable()
        .ToClientTemplate())
    </text>
);

Georgi Denchev
Telerik team
 answered on 22 Feb 2021
2 answers
200 views

Hi,

I'm trying to do an if like statement with the ClientTemplate Formatting, for basic usage this works:

#= (Location == "") ? 'N/A' : Location #

 

If the Location is empty it Displays N/A as needed, but if i try and make it a bit more advanced for another field i.e:

#= (AssignedToPhone == "") ? 'N/A' : '<a href="tel:AssignedToPhone" class="btn-link">AssignedToPhone</a>' #

 

I don't get any errors, but it renders as a link with the text as AssignedToPhone, how do i get it to show the actual value? I have also tried:

#= (AssignedToPhone == "") ? 'N/A' : '<a href="tel:#=AssignedToPhone#" class="btn-link">#=AssignedToPhone#</a>' #

 

This causing an error, and no render happens "Uncaught Error: Invalid template:' (then a bunch of HTML)"

 

 

 

 

 

Tsvetomir
Telerik team
 answered on 19 Feb 2021
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
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
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?