Telerik Forums
UI for ASP.NET MVC Forum
1 answer
181 views

Hello,

I am Kendo Grid in MVC

The grid is set up for in-cell batch editing. One of the fields is a date field. If the date is selected using date picker the value stays in the cell, whereas if the date value is manually entered the value does not hold in the cell. Any suggestions why the value is not holding in the cell when manually entered.

Thank you

 

Eyup
Telerik team
 answered on 21 Dec 2022
3 answers
421 views
we implemented one global filter for other columns (i removed the columns in below code) but we need to do add the filter to the particular column (date)

@(Html.Kendo().Grid<Model>
            ()
            .Name("Activitiesgrid")
            .Columns(columns =>
            {               

                columns.Bound(c => c.ActivityRecordCreateDate).HeaderHtmlAttributes(new { style = "font-weight: bold;font-size: 13px;" }).HtmlAttributes(new { style = "font-size: 12px" }).Width(50);
                
                columns.Bound(c => c.ActivityDate).HeaderHtmlAttributes(new { style = "font-weight: bold;font-size: 13px;" }).HtmlAttributes(new { style = "font-size: 12px" }).Width(100).Format("{0:M/d/yyyy}");
                

            })
            .ToolBar(tools => tools.Excel().Text("Export"))
            .Excel(excel => excel.AllPages(true)
        .Filterable(true)
            
            )
              .Events(events => events.ExcelExport("incompleteCOATestsGridOnExcelExportActivities"))
            .DataSource(dataSource => dataSource
            .Ajax().Model(m =>
            {
                m.Id(p => p.rowIndex);

            })
            .PageSize(0)
            .Read(read => read.Action("GetKendoActivities", "EventsActivities", new { invokedFromMainMenu = true }))
            .ServerOperation(false)            
            .Events(events=>
            {
                events.RequestStart("request_start");
                events.RequestEnd("request_end");

            })
            )
            .NoRecords()
            .Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                        .ForDate(date => date.Clear()
                        .IsEqualTo("Is equal to")
                        .IsGreaterThan("Is After")
                        .IsLessThan("Is Before")
                        .IsNull("Is empty")
                        .IsNotNull("Is not empty"))
                        )
                )
            .Sortable()
            .Pageable()
            .Selectable()
            .NoRecords(x => x.Template("<div class='empty-grid' style ='float: top'></div>"))
            .Events(events =>
            {
                //events.FilterMenuInit("CustomFilter");
                events.FilterMenuOpen("CustomFilterOpen");
            })
// .ClientTemplate("#=AssignedDateFormat(data)#")
)
Eyup
Telerik team
 answered on 19 Dec 2022
1 answer
1.7K+ views

In CSP we were using script-src 'self' 'unsafe-inline' 

but for security purpose need to remove 'unsafe-inline' , we added  'nonce-a9f04fd1-06cf-4948-9d66-ea306e581896' for inline script.

applied nonce for inline script 

<script type="text/javascript" nonce="a9f04fd1-06cf-4948-9d66-ea306e581896">

</script>

but after applying these change kendo  controls not working. Our assumption is there are dynamic inline scripts generated  for kendo controls which not contains nonce. so it may cause an issue.

we also tried DeferredScripts but no success. after applying 'unsafe-inline'  it works.

<script type="text/javascript" nonce="a9f04fd1-06cf-4948-9d66-ea306e581896">

    @Html.Kendo().DeferredScripts()

</script>

 

Please suggest as we want to remove 'unsafe-inline' with kendo controls need to work.

 

Ivan Danchev
Telerik team
 answered on 16 Dec 2022
0 answers
673 views

Hi,

I have a razor page that implements a grid. I want to use javascript to set / unset the dirty markers for certain fields in the grid when there is an error.

I have searched this forum and google'd the problem, but I cannot get anything to work.

I tried :

  • setting .dirty to true
  • addClass("k-dirty-cell")
  • grid.refresh() after setting the dirty markers

Tried these suggestions:

Can I please get a simple example of when the on error fires the js function runs and marks / unmarks a cell dirty and the grid reflects those changes?

Here is a simplified example from a different post:

        function onError(e) {
            // got any error messages
            if (e.errors) {
                e.preventDefault();
                var grid = $("#grid").data("kendoGrid");
                var data = grid.dataSource.data();

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

                    data[i].dirty = true;
                }
                grid.refresh();
            }
        }

Thank you for your help.

Jeff
Top achievements
Rank 1
 asked on 13 Dec 2022
2 answers
303 views

Good day,

How do I validate the content of a file on the upload event?  I want to read the contents of an excel file and get a distinct list from one of the columns.  Thank you.

Regards,

Jerome

Jerome
Top achievements
Rank 1
Iron
 answered on 12 Dec 2022
1 answer
507 views

Hello,

In Page load, I need to populate date field from database. I am trying to do using ASP.NET MVC Kendo().textbox(). Please share some sample code or advice.

Thanks in advance.

Thanks,

 

Anton Mironov
Telerik team
 answered on 08 Dec 2022
0 answers
315 views

Hi,

I would like to know if it is possible to Bind a Grid to a property of an object which is a list of primitive type (i.e. a List<string>).

My ViewModel is something like that:

public class ExampleViewModel
{
   public SomeType { get; set; }
   public SomeOtherType { get; set; }
   public List<string> SomeValues { get; set; }
}

And I imagined I could build the grid like that:

Html.Kendo().Grid<string>(Model.SomeValues)
   .Name("SomeValuesGrid")
   .Columns(columns => columns.Bound(x => x))

As you understand, it would be a very simple grid consisting of only one column, with each row displaying one of the string values.
Is it possible, or can grid only work with objects and not with primitive types?

If I do that, it is to keep the Kendo's grid visual style, instead of manually writing and styling a table.

Thanks for your help.

Thibault
Top achievements
Rank 1
 asked on 08 Dec 2022
1 answer
291 views
Is there a way to control the way selected list view items are rendered? Can it be selected with a radio button instead of being highlighted?
Ivan Danchev
Telerik team
 answered on 06 Dec 2022
1 answer
130 views
Hi! I want to disable aria-pressed when I click on the button in buttons group.
How do it?

Anton Mironov
Telerik team
 answered on 06 Dec 2022
1 answer
188 views

Hi! I want to disable aria-pressed when I click on the button in buttons group.

How do it?

Anton Mironov
Telerik team
 answered on 06 Dec 2022
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
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
DateTimePicker
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?