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

I have a Kendo dropdown list in my project, data of which is dependent from some external conditions and can be changed while widget is already constructed.

When you have 1 item initially and you open dropdown - height for the suggestions popup is fine and covers this 1 item.

When you later change number of items to 6 for example and try to open it - height is still covers only one item and creates a scroll instead of just expand to all available area.

Here is a Dojo example of how it works: https://dojo.telerik.com/oGubaqiX

You should open dropdown, then hit "Change DS" button and the open dropdown again.

As you can see the behavior is absolutely wrong.

How can I change it or what am I doing wrong?

Neli
Telerik team
 answered on 10 Aug 2023
0 answers
236 views

I have a kendo grid which is populated by a model from an MVC controller.  Column 1 and 2 are not editable and are populated with data from the model. Column 3 is an editable column. Column 4 is rendered empty and is not editable.

I need to allow the user to enter a numeric value in the cell in column 3 and then when that cell looses focus, execute a javascript function which will compute a value and place it into the cell in column 4.  So, for example, if row 1, column 1 has a value of "2023/24" and row 1, column 2 has a value of 1000, and the user enters 50 into row1, column 3, the javascript function will compute 1000 - 50 and will place the value of 950 into row1, column 4.

Here is the complete kendo grid definition:


                            @(Html.Kendo().Grid<TaxCertApp.ViewModels.SettlementMemoViewModel>()
                                  .Name("SettlementMemodGrid")
                                  .Columns(columns =>
                                  {
                                      columns.Bound(nr => nr.TaxYear).Width(50).Title("Tax Year");
                                      columns.Bound(nr => nr.OriginalAssessment).Width(100).Title("ORIG. ASSESSMENT").Format("{0:##########0}");
                                      columns.Bound(nr => nr.Reduction).Width(100).Title("REDUCTION").EditorTemplateName("Integer");
                                      columns.Bound(nr => nr.FinalAssessment).Width(100).Title("FINAL ASSESSMENT").Format("{0:###,###,##0}");
                                      columns.Bound(nr => nr.Rate).Width(100).Title("RATE").EditorTemplateName("Currency");
                                      columns.Bound(nr=> nr.RefundSavings).Width(100).Title("REFUND/SAVINGS").Format("{0:###,###,##0}");
                                      columns.Bound(e => e.Type).Width(100).EditorTemplateName("TypeList").Title("TYPE (R S R/S)");
                                  })
                                .Editable(editable => editable.Mode(GridEditMode.InCell))
                                .Pageable()
                                .Scrollable()
                                .Selectable(selectable => selectable
                                    .Mode(GridSelectionMode.Single)
                                    .Type(GridSelectionType.Cell))
                                .Events(e => e.Edit("OnEdit"))
                                .Events(ev => ev.Change("OnChange"))
                                .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .Batch(true)
                                    .ServerOperation(false)
                                    .Model(model =>
                                    {
                                        model.Id(n => n.TaxYear);
                                        model.Field(n => n.OriginalAssessment).Editable(false);
                                        model.Field(n => n.Reduction).Editable(true);
                                        model.Field(n => n.FinalAssessment).Editable(false);
                                        model.Field(n => n.Rate).Editable(true);
                                        model.Field(n => n.RefundSavings).Editable(true);
                                        model.Field(n => n.Type).Editable(true);
                                    })
                                    .PageSize(20)
                                    .Read(read => { read.Action("SettlementMemoFetchGrid", "Forms").Data("BuildObjectGridSettMemo"); })
                                 )
                            )

Currently, when a user clicks in row1, column 3, the onChange AND onEdit events fire, even before the user types any data into the cell.  Neither event first when the user moves off the cell.

 

And the second piece of this question is, once the javascript computes the 950 value, how do I get that 950 value to display in the grid?

 

Thank you for any assistance.

jonathan
Top achievements
Rank 1
Iron
 asked on 09 Aug 2023
1 answer
145 views

Hello friends,

For the  Kendo Grid, when we add a new record, a date field is always the default value 01/01/0001 in the post back record. It should return the input date value rather than 01/01/0001 (or null if this date field is not required)

However, when we update this 01/01/0001 field in this new created record, the correct date value is returned in the post back record and can be updated successfully.

We are using VS 2022. (When checking mdGiving, we found that date field value is always 01/01/0001 no matter what we entered for that field in the grid.)

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult AddMdGivingData([DataSourceRequest] DataSourceRequest request, MDGIVING mdGiving)
        {

        }

Any ideas?

Thank you very much for your help.

Andrew  

Anton Mironov
Telerik team
 answered on 09 Aug 2023
1 answer
149 views

Hi, buttons in toolbar template are smashed together after loading a saved grid state. The problem can be reproduced in demo application https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/grid-preserve-server-toolbar-template-after-set-options

I have used the same code for at long time without issues but this was just noticed during testing. Please see attached images to see how the buttons are smashed together after pressing Save-/Load Settings.

Please advise.

/Br. Anders

Anton Mironov
Telerik team
 answered on 09 Aug 2023
1 answer
410 views

Hi,

I am working on a grid having inline edit functionality.  I am trying to create a dropdown which display a list of persons, however, I want to save the email id of the person in our backend SQL DB.

I am trying to implement this with editor template approach -

I have tried the below code -

Grid:

columns.Bound(mm => mm.Person).Title("Assigned To").EditorTemplateName("PersonList").HeaderHtmlAttributes(new { style = "white-space: normal" });

PersonList.chstml

@(Html.Kendo()
            .DropDownList()
            .Filter("contains")
            .Name("Person")
            .DataTextField("Name")
            .DataValueField("Email")
            .DataSource(dataSource =>
            {
                dataSource.Read(read => read.Action("GetPeopleByArea", "Common").Data("getPeopleByArea"))
                .ServerFiltering(true);
            })
            //.HtmlAttributes(new { required = "required", data_required_msg = "Select Person Name", style = "width: 100px" })
            .ValuePrimitive(true)
            .AutoWidth(true)
            .OptionLabel("-- Please Select --")            
    )

 

function getPeopleByArea() {
        var grid = $("#Grid").data("kendoGrid");
        var dataItem = grid.dataItem("tr.k-grid-edit-row");
        return {
            Area: dataItem.Area
        };
    }

When I edit the grid the dropdown work list works fine and it displays the filtered list of people as expected.  However, Instead of the email id the record is getting updated with Null or blanks in the backend table.

However, this approach works fine if I do not use getPeopleByArea function to filter the area based on certain conditions and use a different controller function to get the whole list.

Also, if I am using  .DataTextField("Name") and  .DataValueField("ID"), ID is getting stored and same is getting displayed on the grid instead of the Name.

What am I doing wrong here ? Can anyone please suggest.

Please let me know if you have any questions.

 

 

Thanks

Saurabh

 

Saurabh
Top achievements
Rank 1
Iron
 answered on 07 Aug 2023
1 answer
206 views

ASP 4.8 MVC application using kendo 2023.2.606

Have a page w/ a grid on it - bound to a list in my model - and wanted to add a default sort.  

Here's a stripped down version of my grid:

@(Html.Kendo().Grid(Model.RepList)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.SalesRepname).Title("Sales Rep");
    })
    .Sortable()
    .Pageable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Sort(sort => sort.Add("SalesRepname").Ascending())
        .ServerOperation(false)
     )
)

 

The default sort works - but the UI presents a double-sort arrow.  Clicking the column again re-sorts the column - flipping both arrows the other direction.  Is there a workaround for this bug to only have one sort arrow?  or is there a fix for this in an upcoming release?

Evan
Top achievements
Rank 1
Iron
 answered on 07 Aug 2023
0 answers
108 views

Was originally doing this with ASP.NET AJAX WebForms Telerik Grid, but because of walls we hit with other functionality we are moving page to MVC.

Thing of Order Line and then as detail table we have Line Items. The Order Line has a Category Drop Down. When the Order Line Category gets changed all the Line Items must be changed to the same Category of the Order Line. If a Line Item category is changed then if all the Line Items have the same category then the Order Line needs to get changed to the category of all the Line Items. If all of the Line Items arent the same then the Order Line must be changed to the "Multiple" category.

We have been able to make changes to the datasource of the Line Items and if you click on the drop down in a Line Item the DropDown will change and the Category of the Order Line is shown as selected, but not until then.  When page 1st renders the Order Line has a drop down with "Category One" showing, then all the Line Items will also show that category in the drop down. If you change the Category of the Order Line with say "Category Two" the line items get changed, but user doesnt see in grid. If the user clicks on the Line Item dropdown the drop down appears and the item selected shows "Category Two".

How to make this work as desired with MVC and Kendo?

Keith
Top achievements
Rank 1
Iron
Iron
 asked on 04 Aug 2023
1 answer
408 views

hi,

When Multi checkbox column is enabled in MVC Kendo Grid, it keeps spinning and not loading filter checkboxes for large dataset.
Please find the sample code attached.

We use Kendo.Mvc, Version=2022.1.412.0.
This sample code uses lesser version.

@(Html.Kendo().Grid<TelerikMvcApp6.Models.OrderViewModel>()
            .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(p => p.OrderID).Filterable(false);
                columns.Bound(p => p.Freight);
                columns.Bound(p => p.ShipName);
                columns.Bound(p => p.ShipCity).Filterable(f => f.Multi(true).Search(true));
            })
            .Pageable()
            .Sortable()
            .Scrollable()
            .Filterable()
            .HtmlAttributes(new { style = "height:550px;" })
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(10)
                .Read(read => read.Action("Orders_Read", "Grid"))
            )
        )

Regards

Karthik

Ivan Danchev
Telerik team
 answered on 04 Aug 2023
1 answer
264 views
could you please  answer the question from SO here https://stackoverflow.com/questions/76809963/check-kendo-spreadsheet-for-validation-errors

Using a (ASP.NET Core) Kendo spreadsheet, how to know if on the sheet are or not validation errors and what kind of if any.

I used this code to add validation

myCell.Validation(v => v
    .ComparerType("custom")
    .DataType("custom")
    .From("R[0]C[0] > 0")
    .Type("warning")
    .ShowButton(true)
    .AllowNulls(true)
    .TitleTemplate("Alerte de validation")
    .MessageTemplate("Attention, cette valeur est négative !"));
Alexander
Telerik team
 answered on 04 Aug 2023
0 answers
123 views
I believe the issue is something is triggering jquery unobtrusive to fire.  When I open a popup from a grid with a required text field (marked with the "required" attribute) it displays the error message without even waiting for me to enter data.   It isn't a huge deal (hence a forum post vs a support ticket and I have a workaround) but It only appeared after I updated to the r2 release.  Can anyone confirm a similar issue or suggest a fix?  my "workaround" is a custom validator.
John
Top achievements
Rank 2
Iron
Iron
Veteran
 asked on 03 Aug 2023
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
Window
ListView
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?