Telerik Forums
UI for ASP.NET MVC Forum
7 answers
2.8K+ views
I've got this example and i want to change a numeric value with a string value using an enum. I've tried a few methods, like .ClientTemplate and .EditorTemplateName. How can i use an enum to format the rows? Here is a grid example:

@(Html.Kendo().Grid<TelerikAspNetCoreApp2.Models.OrderViewModel>()
            .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(p => p.OrderID).Filterable(false);
                columns.Bound(p => p.Freight).EditorTemplateName("Test"); //This is the value to change
                columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}");
                columns.Bound(p => p.ShipName).Filterable(f => f.UI("shipName"));
                columns.Bound(p => p.ShipCity).Filterable(f => f.UI("shipCity"));
            })
            .Pageable()
            .Sortable()
            .Scrollable()
            .Navigatable()
            .Pageable()
            .Scrollable()
            .Filterable()
            .HtmlAttributes(new { style = "height:550px;" })
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(20)
                .Read(read => read.Action("Orders_Read", "Grid"))
            )
        )

 

And this is the example enum

public enum Test
{
    zero = 0,
    one = 10,
    two = 20,
    three = 30,
    four = 40,
    five = 50
}

Suad
Top achievements
Rank 1
 answered on 24 Jun 2020
7 answers
1.9K+ views

Hi,

I have some problem displaying the grid pager buttons :

The 'next page' and 'last page' buttons are not always displayed on Chrome with the Material theme, and are not displayed on IE11 with the 2 themes.

 

I use last version on Kendo MVC 2919.1.115, and I downloaded the latest SASS version for Material and Default themes (via NPM)

The problem comes from the margin-left which is calculated with this formula in some cases:

$pager-numbers-margin: calc(
    #{add-three( 2 * $button-border-width, 2 * $button-padding-y, $button-line-height * 1em, 2)} +
    #{$pager-padding-x} +
    #{2 * $button-border-width}
) !default;

 

In Material Theme, $button-border-width=0 => Crash with Chrome and IE11

In Default Theme, $button-border-width=1px => Crash on IE11 (IE11 does not accept the use of several "calc", even the use of more than 2 terms in the "calc")

(see attached files)

 

Question : What makes my pager in k-pager-sm and not in k-pager?

 

 

Regards

Thierry

Preslav
Telerik team
 answered on 24 Jun 2020
3 answers
1.6K+ views
Hi ,

I am using the Filter row in my grid, it works fine if there are no client template. but if there are any client template it gives error.
@(Html.Kendo().Grid<Document>()
                        .SetDefaults()
                        .Name("gridDocuments")
                        .Groupable()
                        .Editable(editable => editable.Mode(GridEditMode.InLine))
                        .Events(x => x.DataBinding("OnDataBound").Edit("EditGrid"))
                        .Columns(columns =>
                        {
                            columns.Bound(x=>x.CategoryCode).Filterable(false).ClientTemplate(#=data.CategoryDescription#").EditorTemplateName("CategoryTypeMultiselect"); 
                            columns.Bound(x => x.AssetTag).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").SuggestionOperator(FilterType.Contains)));
                            columns.Command(command =>
                            {
                                command.Edit().Text(" ").CancelText(" ").UpdateText(" ");
                                command.Custom("Del").Text("<span class='k-icon k-i-delete'></span>").Click("PageGridDelClicked");
                            }).Width("3%").HtmlAttributes(new { style = "text-align:center;background:#=RowColor#" });
                        })
                        .Selectable(selectable => selectable
                        .Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell))
                        .Navigatable()
                        .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
                        .DataSource(dataSource => dataSource
                        .SetDefaults()
                        .PageSize(20)
                        .Model(model =>
                        {
                            model.Id(p => p.Id);
                            model.Field(p => p.AssetTag).Editable(false);
                            model.Field(p => p.CategoryType).Editable(true);
                        })
                        .Read(x => x.Action("GetSelectedData", "Assets", new { CacheKey = PageUID }).Data("getAssetId"))
                        .Update(x => x.Action("UpdateDocuments", "Assets", new { CacheKey = PageUID }).Data("getAssetId"))))
if i enable filter for Categorycode i am getting error.
Please suggest me how to use the Filter row when we have ClientTemplate in the column.
Tsvetomir
Telerik team
 answered on 24 Jun 2020
6 answers
880 views

I have kendo mvc grid and basically all functions are correct but when i try to export my excel from my grid it's downloading excel but hiding all columns results weirdly
Here my grid

@(Html.Kendo().Grid<Alerts>()
                .Name("grdWaterAlert").AutoBind(false)
                .HtmlAttributes("width: 100%;cellpadding:0;")
                .DataSource(d => d.Ajax().Read("GridWaterAlertBinding", "Dashboards"))
                .Columns(columns =>
                {
                    columns.Bound(e => e.BelIdent).Title("Id").Width("auto");
                    columns.Bound(e => e.StationCode).Title("Station Code").Width("auto");
                    columns.Bound(e => e.StationName).Title("Station Name").Width("auto");
                    columns.Bound(e => e.BelTarih).Title("DateTime").ClientTemplate("#= kendo.toString(BelTarih, 'MM/dd/yyyy') #").ClientGroupHeaderTemplate("DateTime" + ": #=  kendo.toString(value, 'MM/dd/yyyy') #").Width("auto");
                    columns.Bound(e => e.BelInsTime).Title("Alert Time").ClientTemplate("#= kendo.toString(BelInsTime, 'MM/dd/yyyy HH:mm tt') #").ClientGroupHeaderTemplate("DateTime" + ": #=  kendo.toString(value, 'MM/dd/yyyy HH:mm tt') #").Width("auto");
                    columns.Bound(e => e.BelTankId).Title("Tank ID").Width("auto");
                    columns.Bound(e => e.ProductCode).Title("Product Code").Width("auto");
                    columns.Bound(e => e.BelAlarm).Title("Alarm").Width("auto");
                    columns.Bound(e => e.BelTotCapacity).Title("Total Capacity").Width("auto");
                    columns.Bound(e => e.BelWaterVol).Title("Water Volume").Width("auto");
                })
                .ToolBar(toolBar =>
                {
                    toolBar.Excel().HtmlAttributes(new { @class = "btnexcel" }).Text(" ").IconClass("k-i-excel");
                    toolBar.Custom().Text((string)ViewData["ClearFilter"]).HtmlAttributes(new { @class = "k-button", id = "cleargrid", href = "#", onclick = "clearFiltersWaterLevel()" });
                })
                .Excel(excel => excel.FileName("WaterAlert.xlsx").Filterable(true))
                .Selectable()
                .Sortable()
                .AutoBind(false)
                .Pageable(pageable => pageable
                .Refresh(true)
                .PageSizes(true)
                .ButtonCount(5))
                .Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                .ForString(str => str.Clear()
                .StartsWith((string)ViewData["Startswith"])
                .Contains((string)ViewData["Contains"])
                ))
                )
                .Groupable()
                .Scrollable(scrolling => scrolling.Height("100%"))
                .Resizable(config =>
                {
                config.Columns(true);
                })
                .Reorderable(config =>
                {
                config.Columns(true);
                })
                .ColumnMenu()
            )

 

How can i fix this?

 

Thanks

Adil
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 23 Jun 2020
1 answer
575 views

Hi 

I Have a main grid and detail grid like this

https://docs.telerik.com/kendo-ui/knowledge-base/grid-excel-export-hierarchy-master-and-detail-separate-sheets

i need to have the detail grid column values separated in comma in another new  columns in excel in the same row of can you please help on this.

 

Thanks

Mohammed

 

 

Alex Hajigeorgieva
Telerik team
 answered on 23 Jun 2020
3 answers
290 views
Greetings,

I need a spellchecker to implement in my Telerik MVC editor.
From what I read in your documentation, I know I can integrate a spellchecker in my editor or I can use the RadSpellChecker.

I think these are to viable solutions, but I need one more functionality.
Is there anyway that I can right click the misspelled word and correct it, using Telerik dictionaries instead of native browser dictionaries?

Regards.

Petar
Telerik team
 answered on 23 Jun 2020
5 answers
1.0K+ views

My company is trying to be on the cutting edge. 

We built some CRUD pages using Kendo UI. But having problems with the drop down list. In .Net Core we are using razor pages, but the concepts is the same.

 

    @(Html.Kendo().Grid<NG.Analytics.Models.Applications>()//(Model.Data)
                    .Name("Grid")
                    .Columns(columns =>
                    {
                        columns.Bound(a => a.Id).Title("ID").Visible(false);
                        columns.Bound(a => a.CategoryId).EditorTemplateName("ApplicationCategory"); //Having trouble with what to put right here. 
                        columns.Bound(a => a.CategoryId).Title("CategoryID");
                        columns.Bound(a => a.Title).Title("Title").Width(200);
                        columns.Bound(a => a.Description).Title("Description");
                        columns.Bound(a => a.BaseUrl).Title("Base Url").Width(120);
                        columns.Bound(a => a.Url).Title("Url");
                        columns.Bound(a => a.IconUrl).Title("Icon Url").Width(350);
                        columns.Bound(a => a.IsExternal).Title("Is External").Width(120);
                        columns.Command(command => { command.Edit(); }).Width(90);
                        columns.Command(command => { command.Destroy(); }).Width(100);
                        columns.Command(command => command.Custom("ViewDetails").Click("showDetails"));
                    })
                    .ToolBar(toolbar => toolbar.Create())
                    .Editable(editable => editable.Mode(GridEditMode.PopUp))
                    .Sortable()
                    .Scrollable()
                    .Filterable()
                    .HtmlAttributes(new { style = "height: 750px;" })
                    .DataSource(dataSource => dataSource
                            .Ajax()
                            .Model(model =>
                            {
                                model.Id(a => a.Id); // Specify the property which is the unique identifier of the model
                    model.Field(a => a.Id).Editable(false); // Make the ID property not editable
                                                            //model.Field(p => p.CategoryId).DefaultValue(
                                                            //Model.ApplicationCategory as Models.ApplicationCategory);
                })
                            .Read(read => read.Url("?handler=Data").Type(HttpVerbs.Get))
                            .Create(update => update.Url("?handler=CreateApplications").Type(HttpVerbs.Post))
                            .Destroy(update => update.Url("?handler=Applications").Type(HttpVerbs.Delete))
                            .Update(update => update.Url("?handler=UpdateApplications").Type(HttpVerbs.Put)))
    )

    <partial name="EditorTemplates/ApplicationCategoryEditor" /> //Editor is working as expected when normally use.

Here is what the partial looks like:

 

@(Html.Kendo().DropDownList()
                      .Name("CategoryName")
                      .DataTextField("CategoryName")
                      .DataValueField("Id")
                      .BindTo(Model.ApplicationCategory)
                      .HtmlAttributes(new { style = "width: 100%" })
)

 

I know you guys are pretty good and responsive. I just hope I can find the answer. 

Thanks, Trung

Georgi
Telerik team
 answered on 23 Jun 2020
1 answer
359 views

Is there a way to setup overflow on a ButtonGroup?

 

<div class="demo-section k-content"  >
  
            
                @(Html.Kendo().ButtonGroup()
                .Name("DashboardNavigate-select")
                .HtmlAttributes(new { style = "  display:" + displayToolbar + ";    " })

                        .Items(t =>
                    {
                      foreach (KeyValuePair<string, string>     kvp in Model.ButtonList)
                    {
                        
                              t.Add().Text(kvp.Value).HtmlAttributes(new { datavalue = kvp.Key.ToString() });
                         
                    }

                        })
                 .Events(events => events.Select("buttonNavigateNew"))

                )
              
</div>

Ivan Danchev
Telerik team
 answered on 22 Jun 2020
1 answer
390 views

I'm trying to use FileManager to access a network share on behalf of the user using the app. We want to make sure that the user using the app belongs to an active directory group that has access to the share.

I'm at the point where we can retrieve a list of active directory groups that have access to the requested network folder using a PrincipalContext, and can verify that the current user belongs to one of the groups with access permissions. 

However, it seems like this authorization takes ~2 minutes to complete, which makes the filemanager unusable by our users.

Is anyone using FileManager for something like this, and if so, do you have any recommendations for checking if the user has access to a network share?

Aleksandar
Telerik team
 answered on 22 Jun 2020
2 answers
594 views

I have a simple grid and try to get the updated row on server side but the model send is always empty

Client side Grid (View)

<div class="card-body">
        @(Html.Kendo().Grid<CoopTel_MultiLocation.Models.DummyModel>()
                    .Name("grid")
                    .Columns(columns =>
                    {
                        columns.Bound(p => p.Col1).Filterable(false);
                        columns.Bound(p => p.Col2);
                        columns.Bound(p => p.Col3);
                        columns.Bound(p => p.Col4);
                        columns.Bound(p => p.Col5);
                        columns.Bound(p => p.TestBooleen);
                        columns.Command(command => { command.Edit(); command.Destroy(); }).Title("Commandes").Width(250);
                    })
                    .Editable(editable => editable.Mode(GridEditMode.InLine))
                    .Pageable()
                    .Sortable()
                    .Scrollable()
                    .ToolBar(toolbar =>
                    {
                        toolbar.Search();
                        toolbar.Create();
                    })
                    .HtmlAttributes(new { style = "height:550px;" })
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .PageSize(20)
                        .Model(model => { model.Id(p => p.Col1); })
                        .Read(read => read.Action("GetLocationUI", "GestionLocation"))
                        .Update(update => update.Action("DetailLocationUpdate", "GestionLocation"))
                        .Destroy(destroy => destroy.Action("DetailLocationDestroy", "GestionLocation"))
                        .Create(update => update.Action("DetailLocationCreate", "GestionLocation"))
                    )
        )
    </div>

GestionLocationController

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult DetailLocationUpdate([DataSourceRequest] DataSourceRequest request, DummyModel Locations) <-- Location is always empty 
        {
            return Json("");
        }

Marc Jr
Top achievements
Rank 1
 answered on 22 Jun 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?