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

HI I am using asp.net mvc .net (not core).  I have a grid which has paging . Pagig size is 20.  Now lets say I have functionality for download excel file and pdf file.  When user click on the download I want to download all the data not just what user see on the particular page. 

 

Thanks

 

Ivan Danchev
Telerik team
 answered on 26 Nov 2021
1 answer
154 views

I'm trying to create a 3 level hierarchy grid, but for some reason the second level doesn't show the expand button.

The only reason the 3rd level is expanded in the pic is because of the dataBound script, which expands everything.

How do I make the second level expandable?

Here's the code:


@(Html.Kendo().Grid(Model.SalaryApprovalEmployments) .Name("grid") .Columns(columns => { columns.Bound(e => e.Id).Width(100); columns.Bound(e => e.TotalCost).Width(100); columns.Bound(e => e.Trend).Width(100); }) .DataSource(dataSource => dataSource .Ajax() .Model(model => { model.Id(sae => sae.Id); }) .ServerOperation(false) ) .Events(events => events.DataBound("dataBound")) .ClientDetailTemplateId("salaryCodeTemplate") .HtmlAttributes(new { style = "width:600px;" }) ) <script id="salaryCodeTemplate" type="text/kendo-tmpl"> @(Html.Kendo().Grid<SalaryApprovalTransactionDTO>() .Name("grid_#=Id#") .Columns(columns => { columns.Bound(o => o.SalaryApprovalEmploymentId).Width(100); columns.Bound(o => o.SalaryCodeId).Width(100); columns.Bound(o => o.Amount).Width(100); }) .DataSource(dataSource => dataSource .Ajax() .Model(model => { model.Id(sat => sat.SalaryCodeId); }) .Read(read => read.Action("HierarchyBindingTransactions", "SalaryApproval", new { salaryApprovalGroupId = Model.Id, salaryApprovalEmploymentId = "#=Id#" })) ) .Events(events => events.DataBound("dataBound")) .ClientDetailTemplateId("transactionTemplate") .ToClientTemplate() ) </script> <script id="transactionTemplate" type="text/kendo-tmpl"> @(Html.Kendo().Grid<SalaryApprovalTransactionDTO>() .Name("grid_#=SalaryApprovalEmploymentId#_#=SalaryCodeId#") .Columns(columns => { columns.Bound(o => o.SalaryCodeId).Width(100); columns.Bound(o => o.UnitPrice).Width(100); columns.Bound(o => o.Hours).Width(100); columns.Bound(o => o.Days); columns.Bound(o => o.Amount).Width(100); }) .DataSource(dataSource => dataSource .Ajax() .Model(model => { model.Id(sat => sat.Id); }) .Read(read => read.Action("HierarchyBindingTransactions", "SalaryApproval", new { salaryApprovalGroupId = Model.Id, salaryApprovalEmploymentId = "#=SalaryApprovalEmploymentId#", salaryCodeId = "#=SalaryCodeId#" })) ) .ToClientTemplate() ) </script> <script> function dataBound() { var grid = this; this.tbody.find("tr.k-master-row").each(function( index ) { grid.expandRow(this); }); } </script>

Martin
Top achievements
Rank 1
Iron
 answered on 26 Nov 2021
1 answer
1.3K+ views
HI Using asp.net mvc .net (not core).  I want to disable columns for edit. Person can read it but cannot overrite it.  How I can do that?
Yanislav
Telerik team
 answered on 26 Nov 2021
1 answer
198 views
HI I am using asp.net mvc .net (not core). Creating the grid.  The grid has multiple columns I only want to have sorting in 2 columns.  HOw I can do that?
Yanislav
Telerik team
 answered on 26 Nov 2021
4 answers
1.2K+ views
Adding tooltip to spreadsheet cell and also provide custom tooltip 
G.K. Raju
Top achievements
Rank 1
Iron
 answered on 25 Nov 2021
0 answers
170 views

Hi I am using the Autocomplete textbox.  It finding to the datasource fine.  Just like Product is being used in the demo. 

1. My question is if I have a product list. And it has the column product type , and I want to captrue the value of prodcut type then how I can do that. Product is binds with the userId. 

 

2.  I have a model class as 

ModelViewMY {

date TodaysDate {get;set} // date is not part of the list. 

List<Users> Users {get;set}

}

Question now: if I am using the AutoComplete in my mvc project then how I can set the DataTextFiled(Useres.UserId). I tried but I am getting errors. 

 

 @(Html.Kendo().AutoComplete()
                        .Name("searchParam")
                        .DataTextField("Id") //DataTextField("dataField")
                        .Filter("contains")
                        .MinLength(3)                       
Salma
Top achievements
Rank 1
Iron
 asked on 24 Nov 2021
1 answer
802 views

Hello, 

I have a kendo grid, with custom filter in some columns defined like this:

c = columns.Bound(x => x.Field1).Title("Field1").Width(130).Filterable(filterable => filterable.Extra(false).UI("customField1Filter").Operators(op => op.ForString(str => str.Clear().IsEqualTo("Is equal to"))));

and

function customField1Filter(element) {
        element.kendoDropDownList({
            dataTextField: "Text",
            dataValueField: "Value",
            dataSource: {
                transport:{
                    read: {
                        data: getdata(),
                        url: "@Url.Action("PopulateField1Filter", "Common")"
                    }
                }
            },
            optionLabel: "--Select Value--"
        });
    }

 

It works fine, but in order to implement a complex cascading filtering betweent a lot of columns, I have to refresh the options of them.

For exemple: columns 1 display country, columns 2 display city, both are filterable. When I select a country on first filter, i have to refresh the options of the city filter.

How to programmacally refresh filter option of a specific column ? Or refresh filters of all columns witout refresh grid data ?

Thanks in advance

Edvin
Top achievements
Rank 1
Iron
 answered on 23 Nov 2021
1 answer
420 views
I have a Kendo MVC Grid, I don't want the edit button to edit the row. I want to enable the editing once the User clicks on the row. Is there any way to do this?
Edvin
Top achievements
Rank 1
Iron
 answered on 23 Nov 2021
1 answer
145 views
I need to implement cell editing in Kendo Grid and save the cell value like this. Is there any way to do this? The given Inline InCell editing mode doesn't solve my purpose. please find the attached screenshot.
Edvin
Top achievements
Rank 1
Iron
 answered on 23 Nov 2021
1 answer
1.8K+ views

I have the following set of code for picking a start date and end date from user in the 'dd/MM/yyyy HH:mm tt' format.

<tr>
        <td>Start DateTime</td>
            <td>
                @(Html.Kendo().DateTimePickerFor(model => model.StartDateTime).Name("StartDateTime").Format("dd/MM/yyyy HH:mm tt").ParseFormats(new string[] { "dd/MM/yyyy HH:mm tt" }).HtmlAttributes(new { style = "width:300px;", onkeydown="javascript:return false;" }))
            </td>
        </tr>
        <tr>
            <td>Expiration DateTime</td>
            <td>
                @(Html.Kendo().DateTimePickerFor(model => model.ExpirationDateTime).Name("ExpirationDateTime").Format("dd/MM/yyyy HH:mm tt").ParseFormats(new string[] { "dd/MM/yyyy HH:mm tt" }).HtmlAttributes(new { style = "width:300px;", onkeydown="javascript:return false;" }))
            </td>
        </tr>

The javascript code is as follows : 


$(document).ready(function () {

        function onChange() {

            var StartDateTime = $("#StartDateTime").val().split(" ");
            var date = StartDateTime[0].split("/");
            var time = StartDateTime[1].split(":");
            var dd = date[0];
            var MM = date[1];
            var yyyy = date[2];
            var HH = time[0];
            var min = time[1];
            var tt = StartDateTime[2];
            StartDateTime = new Date(yyyy,MM-1,dd,HH,min);
            var ExpirationDateTime = new Date(StartDateTime.setHours(StartDateTime.getHours() + 1));
            $("#ExpirationDateTime").data("kendoDateTimePicker").value(ExpirationDateTime);
            
        }

        $("#StartDateTime").kendoDateTimePicker({
            change: onChange,
            format: "dd/MM/yyyy HH:mm tt",
            parseFormats: ["dd/MM/yyyy HH:mm tt"]
        }).data("kendoDateTimePicker");

        $("#ExpirationDateTime").kendoDateTimePicker({
            format: "dd/MM/yyyy HH:mm tt",
            parseFormats: ["dd/MM/yyyy HH:mm tt"]
        }).data("kendoDateTimePicker");
    });

The underlying model :


[Required(ErrorMessage = "Start Datetime is required.")]
[DataType(DataType.DateTime)]
public DateTime StartDateTime { get; set; }

[Required(ErrorMessage = "Expiration Datetime is required.")]
[DataType(DataType.DateTime)]
public DateTime ExpirationDateTime { get; set; }

But whenever I do a sumbit, I get error saying :

  • The value '18/11/2021 10:59 AM' is not valid for StartDateTime.
  • The value '18/11/2021 11:59 AM' is not valid for ExpirationDateTime.

But if the day(dd) is less than or equal to 12 , the date is accepted. How do I make it accept all dates and in the format I want?

Ivan Danchev
Telerik team
 answered on 23 Nov 2021
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?