Telerik Forums
UI for ASP.NET MVC Forum
2 answers
152 views

I am having an issue on an inline editable grid with bulk edit on whereby when I click in the foreign key column I see a quick box and then it goes back to being uneditable - no dropdown as per the Editor template GridForeignKey.  I have got this installed in my project.

What also seems to be happening is any integer columns aren't appearing with the styled edit box with the round edges. But I can click and edit the values.

Has anyone seen this before?

Even if I remove the Editor Template from the project the behaviour is the same, so I don't think its the editor template causing the issue!

I am on version 2016.3.914

 

Any help would be greatly appreciated

 

Dawn
Top achievements
Rank 1
 answered on 21 Feb 2017
3 answers
396 views

Hi,

We encounter a filtering issue in cascading dropdownlist. we have two dropdownlists ​and the value of dropdownlist is indicated from server. 

After the 2nd dropdownlist display ​corresponding ​items according to  the 1st dropwdownlist,  we type some filter criteria in the 2nd dropdownlist textbox, the filtering function doesn't work.

We have attached the image below and please kindly assist. Thanks!

Ianko
Telerik team
 answered on 21 Feb 2017
7 answers
1.0K+ views
Hi,

I have a Grid with a ClientDetailTemplate, which also contains a Grid. Currently the grid has to make a request to the server for each row the user expands. But actually I already have my data loaded in the grid and could provide it in a collection property on the parent row. Is it possible to tell the Childgrid in the template to get the data from the parent row instead of requesting it from the server?

Thanks in advance. 
Boyan Dimitrov
Telerik team
 answered on 21 Feb 2017
1 answer
146 views

Currently I'm trying to access the value of a cell in the grid, but the property is always undefined.

                             @(Html.Kendo().Grid<IA.Models.PatientInfo>()
                              .Name("PatientGrid")
                              .Columns(columns =>
                              {
                                  columns.Bound(c => c.PatientId).Title("Id").Width(50);
                                  columns.Bound(c => c.FullName).Width(200);
                                  columns.Bound(c => c.DOB).Width(140).Title("Date of Birth").Format("{0:dd/MM/yyyy}");
                                  columns.Bound(c => c.MANumber).Width(90);
                                  //columns.Command(command => { command.Destroy(); }).Width(50);
                                  columns.Command(c => c.Custom("Delete").Click("open")).Width(50);
                              })
                              .Filterable()
                              .Sortable()
                              .Selectable()
                              .Pageable(pageable => pageable
                              .PageSizes(true)
                              .ButtonCount(5))
                              //.HtmlAttributes(new { style = "height: 80px" })
                              .Events(ev => ev.DataBound("function(){this.trigger('change')}"))
                              .DataSource(dataSource => dataSource
                                .Ajax()
                                .Destroy(update => update.Action("Destroy", "Provider"))
                                .Read(read => read.Action("Patient_Read", "Provider", new { id = Model.ProviderId }))
                                .PageSize(10)
                                .ServerOperation(false)
                                .Model(model =>
                                {
                                    model.Id(m => m.PatientId);
                                })
                                )

         )

        <script type="text/javascript">

            function open(e) {
                e.preventDefault();

                var row = $(e.currentTarget).closest("tr");

                   var test = row.PatientId;
                    alert(test);
                   }

</script>

 

I've also I've also tried using selectItem() and that doesn't seem to work either.

Viktor Tachev
Telerik team
 answered on 20 Feb 2017
12 answers
2.0K+ views

Hello,

In my JavaScript file I bind to serveral events of the grid like:

var grid = $("#grdStandort").data("kendoGrid");
grid.bind("change", function () {
    loadTabstripData(tabstrip.select().text());
});
tabstrip.bind("show", function () {
    loadTabstripData(tabstrip.select().text());
});

 

this is working fine but now I want to bind to the "read" Event to set my parameters instead of using the .Data() property of the mvc grid (I don't want to set javascript in my grid Definition only want to bind/hook into Event from my external javscript file)

is there a event which I can bind to to set the parameters for the datasource?

 

robert

 

 

Konstantin Dikov
Telerik team
 answered on 20 Feb 2017
1 answer
100 views
I would like to use the Scheduler to schedule classrooms (my resource). My case is a bit different in that I don't have an exact date the classrooms are booked but more a day of week and time slots for the entire year. We are trying to track classroom usage for the year. Any ideas how this can be accomplished using the scheduler?
Vladimir Iliev
Telerik team
 answered on 20 Feb 2017
1 answer
228 views

Hi there,

I have several Kendo charts (bar charts and line charts) with the data series bound to remote and grouped data. I am using the "shared" tooltip to display information on the grouped data together. However, I would like to change the width of the tooltip. I can of course do it globally by changing the Kendo chart tooltip CSS, but this is far from being a good solution because then it doesn't look good on other charts -- please see the enclosed jpg file.

Question: Is it possible to change the CSS definitions (in particular "width") of the chart tooltip separately for every single chart?

Any suggestions are welcome!

-------------------------------------------------------------

An example code below:

@(Html.Kendo().Chart<AmeyQCMVC2.Models.ViewModels.BCIRatiosViewModel>()

        .Name("bciChart_DefectCategoryRatios")
        .DataSource(ds => ds.Read(read => read.Action("GetDefectCategoryBCIRatios", "Report"))
                                              .Group(group => group.Add(model => model.ConditionIndex))
                                              .Sort(sort => sort.Add(model => model.DefectCategory))
        )
        .Theme("Fiori")
        .Title("Component Condition Index per Defect Category")
        .Legend(legend => legend
            .Position(ChartLegendPosition.Right)
        )
        .ChartArea(chartArea => chartArea
            .Margin(15)
        )
        .SeriesDefaults(seriesDefaults =>
            seriesDefaults.Bar()
        )
        .SeriesColors("limegreen", "yellowgreen", "gold", "tomato", "red")
        .Series(series =>
        {
            series.Bar(model => model.Ratio)
                  .Name("");
        })
        .CategoryAxis(axis => axis
            .Categories(model => model.DefectCategory)
            .MajorGridLines(lines => lines.Visible(true))
            .MajorTicks(lines => lines.Visible(true))
        )
        .ValueAxis(axis => axis.Numeric()
            .Title("Percentage of components")
            .Min(0)
            .Max(1)
            .MajorGridLines(lines => lines.Visible(true))
            .AxisCrossingValue(0)
            .Labels(l => l.Format("{0:p0}"))
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Shared(true)
            .Format("{0:p2}")
            .Color("white")
            .Background("green")
            .Border(1, "green")
        )
        .ToClientTemplate()

)

-------------------------------------------------------------

The viewmodel class is defined as follows:

   public class BCIRatiosViewModel
    {
        public string DefectCategory { get; set; }
        public int ConditionIndex { get; set; }
        public double Ratio { get; set; }
    }

Daniel
Telerik team
 answered on 20 Feb 2017
4 answers
775 views

I have a bar chart that is getting its data from my controller in the form of Json data as shown below:

[
{"SiteId":1,"Hour":9,"Quantity":9.0000,"Value":43.0500,"NumCustomers":5},
{"SiteId":1,"Hour":10,"Quantity":18.0000,"Value":43.6900,"NumCustomers":8},
{"SiteId":1,"Hour":11,"Quantity":7.0000,"Value":22.4200,"NumCustomers":3},
{"SiteId":1,"Hour":14,"Quantity":1.0000,"Value":1.0000,"NumCustomers":1}
{"SiteId":2,"Hour":9,"Quantity":10.0000,"Value":48.0500,"NumCustomers":7},
{"SiteId":2,"Hour":10,"Quantity":20.0000,"Value":83.6900,"NumCustomers":11},
{"SiteId":2,"Hour":11,"Quantity":9.0000,"Value":27.4200,"NumCustomers":5},
{"SiteId":2,"Hour":14,"Quantity":3.0000,"Value":11.0000,"NumCustomers":4}
{"SiteId":3,"Hour":9,"Quantity":7.0000,"Value":33.0500,"NumCustomers":4},
{"SiteId":3,"Hour":10,"Quantity":16.0000,"Value":35.6900,"NumCustomers":7},
{"SiteId":3,"Hour":11,"Quantity":7.0000,"Value":22.4200,"NumCustomers":3},
{"SiteId":3,"Hour":14,"Quantity":2.0000,"Value":5.0000,"NumCustomers":2}
]

 

As you can see, there are multiple sites for the same hours.  The horizontal axis should represent each hour from the data.  Each hour should have a column representing each site, very similar to the 'Column Chart' example on your site.  The code example on the site shows the series data like this:

.Series(series => {
    series.Column(new double[] { 3.907, 7.943, 7.848, 9.284, 9.263, 9.801, 3.890, 8.238, 9.552, 6.855 }).Name("India");
    series.Column(new double[] { 4.743, 7.295, 7.175, 6.376, 8.153, 8.535, 5.247, -7.832, 4.3, 4.3 }).Name("Russian Federation");
    series.Column(new double[] { 0.010, -0.375, 1.161, 0.684, 3.7, 3.269, 1.083, -5.127, 3.690, 2.995 }).Name("Germany");
    series.Column(new double[] { 1.988, 2.733, 3.994, 3.464, 4.001, 3.939, 1.333, -2.245, 4.339, 2.727 }).Name("World");
})

 

My current code that shows the hourly totals for 1 site is listed below, but I'd like this to work for multiple sites as shown the in above collection of Json data. What is the best way to accomplish this?

My current code:

    @(Html.Kendo().Chart<CBECloudBO2.ViewModels.ChartHourlySales>()
            .Name("chartHourlySales")
            .Title("Hourly Sales")
            .DataSource(datasource => datasource
                .Read(read => read.Action("Chart_HourlySales", "Home")))
            .Legend(legend => legend
                .Visible(false))
 
            .ChartArea(chartArea => chartArea
                .Background("transparent"))
 
    .Series(series =>
    {
        series.Column(p => p.Value).Name("Total Sales");
    })
    .CategoryAxis(axis => axis
        .Name("series-axis")
        .Line(line => line.Visible(false))
    )
    .CategoryAxis(axis => axis
        .Name("label-axis")
        .Categories(p => p.Hour)
    )
    .ValueAxis(axis => axis
        .Numeric()
        .AxisCrossingValue(0, int.MinValue)
    )
    .Tooltip(tooltip => tooltip
        .Visible(true)
        .Format("{0}%")
        .Template("#= series.name #: #= value #")
    )
)

 

Thanks,

Shawn

Shawn
Top achievements
Rank 1
 answered on 17 Feb 2017
3 answers
834 views

Apologies for what I hope is a stupid question, given I'm new to MVC & web development.

I have a TreeView with manually added child nodes off the root. I then want to add child nodes to each of those nodes via a foreach loop

The code (that is wrong) is

    @(Html.Kendo().TreeView()
        .Name("treeview")
        .Items(treeview =>
        {
            treeview.Add().Text("Root")
                .Expanded(true)
                .Items(root =>
                {
                    root.Add().Text("Child")
                        .Expanded(true);

                    foreach(var item in Model.Entity.GrandChildData)
                    {
                        {add to Child } item.data;
                    }

 

Thanks

Joana
Telerik team
 answered on 16 Feb 2017
1 answer
227 views

Good day. This must be a very basic thing to do, though I didn't manage to find any information on it.

 

I have a treeview setup like this:

@(
  Html.Kendo().TreeView()
      .Name("treeview")
      .DataTextField("Text")
      .DataSource(dataSource => dataSource.Read(read => read.Action("GetView", "Tree"))
   )

My controller looks like this:

    public class TreeController : Controller
    {
        private readonly IRepository _repository;
 
        public TreeController(IRepository repository)
        {
            _repository = repository;
        }
         
        [HttpGet]
        public JsonResult GetView()
        {
            var items = _repository.GetItems();
            var viewmodel = items.Select(t => new
            {
                id = t.Id,
                Text = t.Text,
                hasChildren = t.HasChildren
            });
            return Json(viewmodel, JsonRequestBehavior.AllowGet);
        }
 
}

That part works just fine.

Now, I would like to add a button that would, say, rename the selected item. So,I know how to get the selected item in the treeview. What I do not know how to implement is the connection viewmodel -> data model. That is, knowing the selected html item I have no idea how to get the model item it coresponds to. That would be solvable if I could add my custom html "model-id" property on every item and pass it back to controller on my button click. Which I have no idea how to implement either.

 

Thank you in advance.

Joana
Telerik team
 answered on 16 Feb 2017
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
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
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?