Telerik Forums
UI for ASP.NET Core Forum
1 answer
185 views
How do I put a spacer or a separator between entries in the PanelBar?  The Items in my PanelBar have some grouping that I'd like to show visually.  Old-school Menus used to let the developer put a dash (-) in the entry in order to visually show a separator.
Veselin Tsvetanov
Telerik team
 answered on 09 Aug 2019
1 answer
99 views

Hi,

 

Is there a way to set color on the value for some fields according to some rule?  yes/no or >0, <0.

Marin Bratanov
Telerik team
 answered on 08 Aug 2019
1 answer
211 views

Hi,

 

I want to get the filters from the grid to perform server side filtering. Is this possible with your grid and RazorPages?

I want to show a lot of logmessages, that have to be filtered on the database, because i would load to many records.

 

Best Regards

Moritz

 

Moritz
Top achievements
Rank 1
 answered on 07 Aug 2019
5 answers
708 views

Hi all,

I'm looking to cleanse data exported from a Kendo Grid to an Excel Spreadsheet and I've not yet been able to find any way of doing this using the available Kendo Grid functions.

Does anyone know of a way to manipulate data exported from a Grid, before it's pushed into an Excel spreadsheet?

For example, I'm looking to escape Excel formula characters to make sure malicious code is not run on a client machine, when they open up an Excel spreadsheet (which has been filled with exported grid data). I need to replace characters such as equal to (=), plus (+), etc.

I'm currently using the Telerik.UI.for.AspNet.Core (2019.2.514) nuget package.

Many thanks in advance,

John

Alex Hajigeorgieva
Telerik team
 answered on 07 Aug 2019
2 answers
112 views

The documentation found here has some formatting issues that makes it quite hard to read.  Look at the IndexController.cs tab:

https://demos.telerik.com/aspnet-core/grid/index

Also, by convention the file name should be the same as the class name.  Therefore, the tab should be renamed as GridController.cs

Alex Hajigeorgieva
Telerik team
 answered on 06 Aug 2019
1 answer
138 views

I stepped through this process because my Grid would not show up.  After the process... it still wouldn't show up:

https://docs.telerik.com/aspnet-core/getting-started/getting-started-copy-client-resources

So, then I used the Telerik Extension to create a project.  After reviewing the template I see that pretty much nothing in this start up instruction is there.  I the article obsolete?  If so, please update it.

Rumen
Telerik team
 answered on 06 Aug 2019
3 answers
3.5K+ views

i already install telerik

and by nuget from commercial download link

but still got problem

do you have any idea?

 

thank you

Dimitar
Telerik team
 answered on 05 Aug 2019
5 answers
466 views

Hi,

Ok, so I have a grid, strangely enough called "grid". On it I have .Editable(e => e.Mode(GridEditMode.InCell) set. Everything works great. My data annotations do their job and catch errors. However, one of the columns has a unique index on it. I catch duplicate errors in a try/catch block on the server when they hit save. I add a Model error, but nothing is displayed.
The error message never shows. What am I missing?
Thanks … Ed

@(Html.Kendo().Grid<RoomsModel.RoomModel>()
    .Name("grid")
    .ToolBar(t =>
    {
        t.Create().Text("Add New"); t.Save().Text("Save Changes");
    })
    .HtmlAttributes(new { style = "height: 650px;" })
    .Editable(e => e.Mode(GridEditMode.InCell) //.TemplateName("RoomEditTemplate")
    .Window(w => w.Title("Room").Width(650)))
 
    .Columns(columns =>
     {
         columns.Bound(t => t.Id).Visible(false);
        if (((IEnumerable<Property>)ViewData["Properties"]).Count() > 1)
        {
             columns.ForeignKey(t => t.PropertyId, (System.Collections.IEnumerable)ViewData["Properties"],
             "Id", "PropertyName").Width(125);
        }
        columns.Bound(c => c.RoomNumber).Title("Room Number").Width(125);
        columns.Bound(c => c.RoomName).Title("Room Name").Width(120);
 
                 columns.Command(command =>
         {
             //command.Edit().Text("Edit/View Details");
             command.Destroy();
         }).Width(150);
 
     })
 
    .HtmlAttributes(new { style = "margin-left:3px" })
    .Resizable(resize => resize.Columns(true))
    .Selectable(s => s.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
    .Scrollable()
    .Filterable()
    .Sortable()
    .Pageable() //p => { p.PageSizes(true); })
    .DataSource(ds =>
    ds.Ajax()
    .Batch(true)
    .Events(ev => ev.Error("errorHandler"))
    .Read(r => r.Url("?handler=RoomsRead").Data("forgeryToken"))
    .Update(u => u.Url("?handler=RoomsUpdate").Data("forgeryToken"))
    .Create(c => c.Url("?handler=RoomsCreate").Data("forgeryToken"))
    .Model(m =>
    {
        m.Id(t => t.Id);//.Editable(false);
    })
    .PageSize(10)
 
    )
)

 

 

public IActionResult OnPostRoomsCreate([DataSourceRequest] DataSourceRequest request,
   [Bind(Prefix = "models")]IEnumerable<RoomsModel.RoomModel> Rooms)
   {
       Room rm;
 
       List<RoomModel> lstResults = new List<RoomModel>();
       if (ModelState.IsValid)
       {
           try
           {
               using (TransactionScope oScope = new TransactionScope())
               {
                   if (Rooms != null && ModelState.IsValid)
                   {
                       foreach (var r in Rooms)
                       {
                           rm = new Room();
                           rm.RoomName = r.RoomName;
                           .
                           .
                           .
                           _db.Rooms.Add(rm);
                           _db.SaveChanges();
 
                           RoomModel rmm = new RoomModel();
                           rmm.Id = rm.Id;
                           .
                           .
                           .
                           lstResults.Add(rmm);
                       }
                   }
                   oScope.Complete();
               }
           }
            
           catch (Exception ex)
           {
               var sqlException = ex.InnerException as SqlException;
 
               if (sqlException != null && sqlException.Errors.OfType<SqlError>()
                   .Any(se => se.Number == 2601 || se.Number == 2627 /* PK/UKC violation */))
               {
                   StatusMessage = "Error: Room number already used.";
                   ModelState.AddModelError("RoomNumber", StatusMessage);
                   return new JsonResult(new[] { lstResults.ToDataSourceResult(request, ModelState) });
               }
           }
       }
       return new JsonResult(new[] { lstResults.ToDataSourceResult(request, ModelState) });
   }

 

 

Randy Hompesch
Top achievements
Rank 1
 answered on 05 Aug 2019
4 answers
248 views

I am building a dashboard application where the Arc Gauge's value will be updated periodically.

Multiple Arc Gauges are added as item in ListView.

While CenterTemplate can be bound to a model (see OEE property in OEEDataModel), it appears that i can't do the same for Arc Gauge's Value property. 

How can i update each Arc Gauge's Value property in the ListView when the OEE value changes?

index.cshtml

 

@{
    ViewData["Title"] = "Dashboard";
}
@model VelaMfgDashboard.Models.Dashboard.DashboardModel;
 
<div class="dashboard-section k-content wide">
    <h1>Dashboard: @Model.ProductionLine</h1>
    <div class="dashboard-table">
        <h2 class="title">OEE</h2>
        <div class="data">
            @(Html.Kendo().ListView(Model.OEEDatas) 
                .Name("oeeListView")
                .TagName("div")
                .ClientTemplateId("oee-template")
                .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(5)
                .ServerOperation(false) // all data will be requested at once and data operations will be applied client-side
                .Read(read => read.Action("OEEDatas_Read", "Dashboard")))
                .Pageable(pageable => pageable
                .Refresh(true)
                .ButtonCount(5)
                .PageSizes(new[] { 5, 15, 30 })
                )
            )
        </div>
    </div>
</div>
 
<script type="text/x-kendo-tmpl" id="oee-template">
    <div class="oee-container" k-widget>
        <dl>
            <dt>Machine #:MachineNo#</dt>
            <dd>
                @(Html.Kendo().ArcGauge()
                            .Name("oeeGauge")
                            .Value(80)
                            .Scale(x => x.Min(0).Max(100))
                            .CenterTemplate("#:OEE#%")
                            .ToClientTemplate()
                )
            </dd>
        </dl>
    </div>
</script>
public class DashboardModel
{
    public string ProductionLine { get; set; }
 
    public List<OEEDataModel> OEEDatas { get; set; }
 
    public DashboardModel()
    {
        OEEDatas = new List<OEEDataModel>();
    }
}
 
public class OEEDataModel
{
    public double OEE { get; set; }
    public int MachineNo { get; set; }
}
Joel
Top achievements
Rank 1
Iron
 answered on 02 Aug 2019
5 answers
237 views

I have a grid with inline set to true.

my bound data is decorated with [UIHint("Integer")].

Everything is working great, the user clicks on the cell and teh numerictextbox comes up … left aligned. 

How to right align this thing?

I have the column right aligned via htmlattributes, but that has no effect on the numeric textbox.

Thanks … Ed

 

Eyup
Telerik team
 answered on 02 Aug 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?