Telerik Forums
UI for ASP.NET MVC Forum
1 answer
1.2K+ views

I have a field in a grid, which is a nullable Boolean. However, the filter option for this field, shown by the grid just has options for true and false.

This is obviously incorrect for a nullable Boolean, which should also show a filter option for null.

How can I rectify this?

I'm using version v2021.1.119 

Thanks

Eyup
Telerik team
 answered on 26 May 2021
1 answer
1.0K+ views

Hi,

I am trying to use the same Dropdownlist in a parent grid, and its hierarchal/child grid. This Dropdownlist was written in jQuery and is kept inside the Shared/EditorTemplates folder and works as expected for the parent grid. However, when I apply it to columns on the child grid, it does not appear. It ignores the template and prompts me for an input like usual for inline editing instead of displaying the dropdownlist options.

Is it possible to use the same EditorTemplate inside of a hierarchy grid?

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 25 May 2021
0 answers
160 views

 

how do I remove the upload done and change it to "ok"

 

        @(Html.Kendo().Upload().Name("files")
                                                    .TemplateId("fileTemplate")
                                                    .Multiple(false)
                                                    .Messages(m => m.Select("Selecionar Arquivo...").UploadSelectedFiles("Importar").StatusUploading("OK").StatusUploaded("OK"))
                                                    .Async(a => a
                                                        .Save("SaveAsync", "Util")
                                                        .Remove("Remove", "Util")
                                                        .AutoUpload(false))
                                                    .HtmlAttributes(new { accept = ".xml,.xlsx,.xlsb,.xls" })
                                                    .Events(e => e.Error("uploadError").Complete("carregarGridErros")))

 

 

Douglas
Top achievements
Rank 1
Veteran
 asked on 25 May 2021
1 answer
2.2K+ views

Hi,

I am creating a Kendo grid which involves using a Dropdown List for certain cells. I have created the Editor Template for the dropdown inside the Shared/EditorTemplates folder called DropdownList.cshtml. The dropdown list works as intended, I have inline editing enabled and I am able to update the values via Ajax.

Here's the column in the initial grid:

columns.Bound(e => e.Balance).Width(40).Title("Balance").ClientTemplate("<span>#=getIcon(Balance)#</span>").EditorTemplateName("DropdownList");

The problem occurs when I try to use that same EditorTemplate called DropdownList in a hierarchy grid, just below its predecessor. The subgrid is configured using .ClientDetailTemplateId("template"), where the child grid is titled .Name("tracking-grid_#=id#"), and linked using .ToClientTemplate(). (As shown in the Telerik demonstration here.).

As soon as I add the .EditorTemplateName("DropdownList"); to the following line, the grid does not load and I receive the following error in the browser console: Uncaught Error: Invalid template

columns.Bound(e => e.Balance).Width(40).Title("Balance").ClientTemplate("<span>#=getIcon(Balance)#</span>").EditorTemplateName("DropdownList");

** Note: I know these columns have the same name, but they are being taken from different datasets. It just so happens to appear in both grids.

Searching for solutions, I made sure to try escaping all (#) hash characters with \\ wherever they appear, and I tried creating an alternate file in the EditorTemplates folder so they would be distinct. The grid still breaks and fails to render each time from just this one line.

I found a similar discussion here that I thought would help me, but no luck.

I understand that I am trying to use the same Editor Template in two separate grids. But I really need to use this dropdownlist in both. Is MVC not able to use the same editor template in nested grids like this, or is there something else I'm missing?

Thanks.

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 24 May 2021
4 answers
1.0K+ views

hello, 

I have students kendo grid in my MVC project with below settings . I’d like to mark dirty flag on the certain cells programmatically. But I didn’t see dirty flag (red triangle on let top corner) on the cell after I run js code. Could someone help me out? Thanks!

 

.Editable(editable => editable.Mode(GridEditMode.InCell))

                .ColumnMenu()

                .Resizable(resizable => resizable.Columns(true))

                .Pageable(p => p.PageSizes(new int[] {25, 50, 100 }))

                .DataSource(dataSource => dataSource

                    .Ajax()

                    .Batch(true)

                    .ServerOperation(false)

                    .PageSize(15)

                                ...

 

Run JavaScript when button click:

 

        $("#markDirty").click(function (e) {

            e.preventDefault();

            var grid = $("#studentGrid").data("kendoGrid");

            var data = grid.dataSource.data();

 

            for (var i = 0; i < data.length; i++) {

                if (data[i].ClassName == "MVC") {

                    data[i].ClassName = "MVC 5.0";

                    data[i].dirty = true;

                }

            }

            grid.refresh();//didn't see the data change without this line.

        });

Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 22 May 2021
1 answer
2.0K+ views

Hi,

I have a Kendo Grid with 20columns in that i have 12 columns as months. in one column am getting data like below attached image format (1/0,2/1,3/2).  in ClientFooterTemplate am displaying sum of this column. here i want to apply same logic all 12 months.

below is my code.

columns.Group(group => group.Title("200<hr> Jan").Columns(Jan =>
                        {
                            Jan.Bound(p => p.Jan_A).Width(60).Filterable(false).Editable("function(dataItem) {if (((new Date).getMonth() + 1) <= 1) {return true}else return false;}").ClientFooterTemplate("#=kendo.toString(conditionalSum(), '0,0')#").HtmlAttributes(new { style = "text-align: center;" }).HeaderHtmlAttributes(new { @class = "col-sm-1 col-md-1 col-lg-1 col-xl-1 ", style = "white-space: normal;text-align: center;" }).Title("A / F");
                        }));

below is Javascript code

function conditionalSum() {
        //alert("a")
        var dataSource = $("#Grid").data("kendoGrid").dataSource;
        var filters = dataSource.filter();
        var allData = dataSource.data();
        var query = new kendo.data.Query(allData);
        var data = query.filter(filters).data;

        //var data = dataSource.data();
        var item, Jansum = 0,Febsum=0;
        for (var idx = 0; idx < data.length; idx++) {
            item = data[idx];
            if (item.Jan_A != null) {
                if (item.Jan_A.includes("/") && item.Jan_A.split("/")[0] != "") {
                    Jansum += parseInt(item.Jan_A.split("/")[0]);
                }
            }
            if (item.Feb_A != null) {
                if (item.Feb_A.includes("/") && item.Feb_A.split("/")[0] != "") {
                    Febsum += parseInt(item.Feb_A.split("/")[0]);
                }
            }
        }
        return kendo.toString(Jansum, "0,0");
        
    }

 

this function is working fine for only month. how can i use same function for remaining 11 columns.

Anton Mironov
Telerik team
 answered on 21 May 2021
1 answer
133 views
How to bind data to dynamic grid MVC
Ivan Danchev
Telerik team
 answered on 21 May 2021
1 answer
632 views
In one of the columns of my grid I have a link.  It used to recognize the :visited property just fine, but I had to update to 2020.1.406 (I did not want to update, was kinda forced into it) and now the link in my grid doesn't use nor recognize the :visited property apparently.

These work as expected

.k-grid a {
color: black;
}

.k-grid a:hover {
color: green;
}

but for whatever reason, this does not:

.k-grid a:visited {
color: pink !important;
}

So how can I get the :visisted property to work correctly.  The users were using it to keep track of which record within a grid they had already worked with/processed.  I don't want to have to put in place some other roundabout way of tracking this...


Anton Mironov
Telerik team
 answered on 20 May 2021
1 answer
176 views

Can you tell me how to add a Hyperlink column to a MVC ASP.NET Grid?

I've tried everything i could find and none work.. JIRA_Ticket is the display value, and Service Desk holds the Hyperlink i want to open a new window with. It's possible i'm just not googling it right.. I'm fairly new to this so sorry if this is a dumb question.

    .Columns(columns =>
    {
        columns.Bound(m => m.JIRA_Ticket).Width(60).HtmlAttributes(new { @class = "txtovflw" });
        //.ClientTemplate("<a href='" + Url.Content("\\#= ServiceDesk \\#") + "' target='_blank'>\\#= ServiceDesk \\#Link</a>");
        //.ClientTemplate("<a href='\\#' onclick='proposalWindow(#= ServiceDesk #)'>" + "#= JIRA_Ticket #" + "</a>").Title("Title");

I just want to be able to click on the JIRA ticket column in the grid and open the servicedesk link in the model.

If this is not possible, happy to go with an action button..

 

Any help appreciated

 

Ivan Danchev
Telerik team
 answered on 20 May 2021
8 answers
3.7K+ views
I am running into an issue with a simple string property when using a custom EditorTemplate in the Kendo Grid and inline editing.

I am doing something very similar to this: http://docs.kendoui.com/documentation/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/editor-templates#create-custom-editor-for-a-bound-property

The issue appears to be that the model value for the property is not being passed to the editor template when entering edit mode. For example, if I remove the custom EditorTemplate usage, the grid works fine: clicking Edit shows a textbox for the string property with the saved value for the row prefilled in the textbox. When I use the custom EditorTemplate, the Model value is null. I've tried simplifying my editor template down to nothing but outputing the model value with the same results.

Any ideas of what might be causing this?
Eyup
Telerik team
 updated answer on 20 May 2021
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?