Telerik Forums
UI for ASP.NET MVC Forum
24 answers
749 views

Hi

 

I saw a thread about not getting to the ID of a panelbar item in the OnSelect handler from 2012. I almost can't believe that Telerik did not yet fix this issue. But i can't find anything so i'm afraid they didn't. 

It should be that easy to add to the component.

 

Eric

 

Ivan Danchev
Telerik team
 answered on 30 Aug 2019
1 answer
139 views

I have a partial view that contains a TabStrip and each that contains a grid. The view works, it's currently in a different page and I'd like to move it to a kendo window.

I've moved it to a kendo window and the window displays great.

Here's the code that generates my window (please note the variable names have been changed for this).

var window = $("#window").kendoWindow({
                content: {
                    url: "/Case/CaseDetail",
                    data: {
                        Daid: Daid,
                        CaseID: CaseID,
                        RecordID: RecordID,
                        CanUserView: cuv,
                        OffenseCount: OffenseCount,
                        CoDefendantCount: CoDefendantCount,
                        VWCount: VWCount,
                        InternalProcessCount: InternalProcessCount,
                        ChargeDispositionCount: ChargeDispositionCount,
                        SentenceCount: SentenceCount,
                        OtherCaseCount: OtherCaseCount
                    }
                },
                actions: [
                    "Pin",
                    "Minimize",
                    "Maximize",
                    "Close"
                ],
//                close: onClose
            });
 
            window.kendoWindow().data("kendoWindow").center().open()

 

The window appears and the tabs are visible, the content of the 1st tab is loaded via an AJAX call that is never executed (so no content) and none of the tabs are functional when I click on it.

When I look at the page source I can see that the window was rendered as text and all associated javascript is actual text and not, all the scripts related seem to be escaped, here's an example of some rendered content:

<script type="text/javascript">
    function ProcessErrorO(args) {
        ProcessError(args, 'O_grid_' + '#= RecordID #');
    }
<\/script>

 

Any help would be appreciated.

Thanks

Martin
Telerik team
 answered on 29 Aug 2019
1 answer
572 views

I had a subcription 5 years ago and have decided to renew my subscription to get the latest version of Kendo for MVC. Our code uses bootstrap as well as Kendo, with JQuery. I was expecting to be able to upgrade all of these to their latest versions. However, I notice that the JQuery file used by Kendo is still 1.12.4, but Visual Studio is referenceing 3.4.1 by default. 

Is it possible to ditch 1.12.4 and kendo work with 3.4.1?

 

Nikolay
Telerik team
 answered on 29 Aug 2019
2 answers
173 views

Hello everyone,

It's possible to apply a filter on one field automatically?  When I load the page I want one filter applied without the user have to do it each time.  Of course he can remove it.

 

See attachment.

 

Louis
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 28 Aug 2019
3 answers
665 views

Hello, with my code below I want to populate the dropdown and the grid(with all rows), then if the user makes a selection in the dropdown I want the grid to be refreshed with the filtered rows. The NewPartsRead controller action does return the filtered rows, but the grid does not rebind to the filtered rows returned.

What am I doing wrong?

Index:

 @using (Html.BeginForm())
                {    <div class="demo-section k-content" style="padding:20px;">
                     
                        @(Html.Kendo().DropDownList()
                                                    .Name("EngMake")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .BindTo(Model.EngMakeList)
                                                    .SelectedIndex(0)
                                                    .OptionLabel("Select Engine Manufacturer")
                                                    .HtmlAttributes(new { style = "width:300px" })
                                                    .Filter(FilterType.Contains)
                        )

 

 

                    </div>

                         @(Html.Kendo().Grid(Model.NewParts)
                                           .Name("grid")
                                           .Columns(columns =>
                                           {
                                               columns.Bound(p => p.EngDescription);
                                               columns.Bound(p => p.PartType);
                                               columns.Bound(p => p.EngYear);
                                               columns.Bound(p => p.EngCylinders);
                                               columns.Bound(p => p.EngBore);
                                               columns.Bound(p => p.PartYears);
                                               columns.Bound(p => p.Partieb);
                                               columns.Bound(p => p.PartNotes);
                                           })
                                           .Pageable()
                                           .Sortable()
                                           .Scrollable()
                                           .Filterable()
                                           .HtmlAttributes(new { style = "height:550px;" })
                                           .DataSource(dataSource => dataSource
                                               .Ajax()
                                               .PageSize(20)
                                               .Read(read => read.Action("Index", "NewPartsRead"))
                                            )
                    )
                }

 

Controller:

  public class NewPartsController : Controller
    {
        // GET: NewParts
        public ActionResult Index()
        {
            var model = new NewPartsModel();
            return View(model);
        }
        [HttpPost]
        public ActionResult NewPartsRead(NewPartsModel newPartsModel)
        {
            newPartsModel.NewParts = newPartsModel.NewPartsRead(newPartsModel.EngMake);

            return Json(newPartsModel.NewParts);
        }
    }

 

Model:

 protected readonly NewPartsProvider newPartsProvider = new NewPartsProvider();

        public string EngMake { get; set; }

        public List<DataObjects.NewPart> NewParts { get; set; }

        public List<SelectListItem> engMakeList = new List<SelectListItem>();

        public IEnumerable<SelectListItem> EngMakeList { get; set; }

        public NewPartsModel()
        {
            foreach (var engMake in newPartsProvider.GetEngMakeList())
                engMakeList.Add(new SelectListItem() { Text = engMake, Value = engMake });

            EngMakeList = engMakeList;
            NewParts = newPartsProvider.GetNewParts();
        }

        public List<DataObjects.NewPart> NewPartsRead(string engMake)
        {
            List<DataObjects.NewPart> NewParts = new List<DataObjects.NewPart>();

            NewParts = newPartsProvider.GetNewPartsByMake(engMake);

            return NewParts;
        }

 

n/a
Top achievements
Rank 1
 answered on 27 Aug 2019
1 answer
119 views

Hello,

@(Html.Kendo().Grid<Myproject.Areas.Maintenance.ViewModels.EquipementsInterventions.EquipementInterventionModel>()
            .Name("EquipementIntervention")
            .Columns(columns =>
            {
                columns.Bound(p => p.NoReference).Width(60);
                columns.Bound(p => p.DateIntervention).Format("{0:yyyy-MM-dd}").Width(60).HtmlAttributes(new { style = "text-align:center" });
            })
            .ToolBar(toolBar =>
            {
                toolBar.Create();
                toolBar.Save();
            })
            .Editable(editable => editable.Mode(GridEditMode.InCell))
            .HtmlAttributes(new { style = "font-size:11px;height: 300px;" })
            .Scrollable()
            .Selectable(s => s.Enabled(false))
            .Pageable(pageable => pageable
            .Refresh(true)
            .ButtonCount(5))
            .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .ServerOperation(false)
                .PageSize(100)
                .Model(model =>
                {
                    model.Id(field => field.NoEquipementIntervention);
                    model.Field(field => field.NoReference).DefaultValue("Test");
                    model.Field(field => field.DateIntervention).DefaultValue(System.DateTime.Now);
                })
                .Read(read => read.Action("Read", "Equipements", new { id = Model.EquipementId }))
                .Create(create => create.Action("Create", "Equipements", new { id = Model.EquipementId }))
                .Update(update => update.Action("Update", "Equipements"))
                .Destroy(destroy => destroy.Action("Destroy", "Equipements"))
            )
)

I try to set a default value when I add a new item in my grid.  Even with a hard coded value like "Test".  I have the same situation with a DateTime? field until I remove the ?.  Any idea about the NoReference (string) field?

The model :

[Key]
public Guid NoId { get; set; }
 
[Required]
 
public string NoReference { get; set; }
 
[UIHint("Date")]
[Required]
public DateTime DateIntervention { get; set; }

 

The Grid :

 

 

THANK A LOT TO EVERYONE.

 

 

 

Viktor Tachev
Telerik team
 answered on 27 Aug 2019
1 answer
449 views

Hello, I was wondering if it was possible to to the use DateRangePicker for selecting a range of months instead of days. I currently have the following code:

@(Html.Kendo().DateRangePicker()
                                  .Name("MonthlyDatePicker")
                                  .HtmlAttributes(new { style = "width: 100%" })
                                  .Events(e => e.Change("onMonthlyChange"))
                                  .Start("year")
                                  .Depth("year")
                                  .Format("MM yyyy")
                                )

 

This code appears the way I want it to but does not allow the user to select a month. Any help is much appreciated. Thanks

 

Viktor Tachev
Telerik team
 answered on 27 Aug 2019
1 answer
1.0K+ views

Hi,

How do we set the series colours on an AJAX MVC Bar chart.

there is an option to set the colors but doesnt seem to matter what is entered nothing works

@(Html.Kendo().Chart<CML.Models.TopRequestersSample_Result>()
    .Name("TopRequesters")
    .SeriesColors()
    .Title("Top 10 Requesters by Sample Count")
    .Legend(legend => legend.Position(ChartLegendPosition.Bottom))
    .DataSource(ds => ds.Read(read => read.Action( "GetTopRequesters","Dash" ) ))
    .Series( s => { s.Bar( a => a.Total ); } )
    .CategoryAxis(ca => {
        ca
   .Categories( a => a.DisplayName )
   .Name( "Requester" );
    })

 

Nikolay
Telerik team
 answered on 23 Aug 2019
3 answers
377 views

I used the solution (slightly modified for my use case) referenced in the docs to add a new row when tabbing out of the last editable column in the last row. However, when the new row is added, the changes made to that last editable cell are lost. How do I prevent that from happening?

Here's my code. The "return false;" was necessary to prevent the focus going to the second column of the new row. The undesired behavior is occurring whether or not I include it.

$(document).ready(function () {
    var grid = $("#ReceivingReportGrid").data("kendoGrid");
 
    grid.tbody.on("keydown", function (e) {
        if (e.keyCode == 9) {
            if ($(e.target).closest('td').is(':nth-last-child(2)') && $(e.target).closest('tr').is(':last-child')) {
                grid.addRow();
                return false;
            }
        }
    });
});
Georgi
Telerik team
 answered on 23 Aug 2019
1 answer
150 views

I have 2 comboBox(s) on a grid.  When the user clicks the edit button, I want the values that are in the comboBox to stay, currently they blank out.  Why is it doing this, and what's the simple solution.

 

 

Alex Hajigeorgieva
Telerik team
 answered on 22 Aug 2019
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?