Telerik Forums
UI for ASP.NET MVC Forum
3 answers
247 views
Hi. I'm attempting to bind the attached data example to a Stacked Bar Chart and not having much luck using the example here:

http://demos.kendoui.com/dataviz/bar-charts/grouped-stacked-bar.html

The goal is to have Months on the X-axis and Product totals per month, each product stacked on the Y-axis. The example provided only show configuration for building using static data is a particular format. Is it possible to use the data sample attached without reorganizing?

Thanks.
Dimiter Madjarov
Telerik team
 answered on 08 Feb 2013
1 answer
285 views
Hi,

I know how to specify aggregates when using a DataSource to populate the grid.

But how do I define aggregates when I'm populating the Grid using BindTo?

I want a Sum row at the bottom of this Grid:
@(Html.Kendo().Grid<Models.AgentLeaderData>()
        .Name("AgentLeaderData")
        .Columns(col =>
        {
            col.Bound(p => p.AgentName);
            col.Bound(p => p.Revenue).HtmlAttributes(new { style = "text-align:right" });
        })
         
        .BindTo(Model.AgentLeaderData)
)
Daniel
Telerik team
 answered on 08 Feb 2013
2 answers
244 views
I am successfully populating my treeview via the BindTo method.  As you can see below, I bind to a single entity of type "Organisation" which has collection of child organisations called "ChildOrganisations".   You can also see that I do some conditional formating of styles depending of the value of property "organisation.organisation_type_id"
@(Html.Kendo().TreeView()
    .Name("OrganisationTreeview")
    .ExpandAll(true)
    .BindTo(Model, mapping => mapping
        .For<Organisation>(binding => binding
            .Children(organisation => organisation.ChildOrganisations)
            .ItemDataBound((item, organisation) =>
            {
                item.Text = organisation.organisation_unit_name;
                item.Id = organisation.organisation_unit_id.ToString();
 
                if (organisation.organisation_type_id == 1)
                {
                    item.HtmlAttributes.Add("style", "font-size: 18px;font-weight:bold;");
                }
                else if (organisation.organisation_type_id == 3)
                {
                    item.HtmlAttributes.Add("style", "font-size: 14px;font-weight:bold");
                }
                else if (organisation.organisation_type_id == 2)
                {
                    item.HtmlAttributes.Add("style", "font-size: 12px;font-weight:normal");
                }
            })))
)


As I bind the children nodes via the item.Text and item.Id properties, I also want to be able to add an image next to the node text.  The image will be different depending on the value of a organisation.enabled.  How can I do that?
James Vassallo
Top achievements
Rank 2
 answered on 08 Feb 2013
1 answer
339 views
Is it possible to make a column header to be dentered while the rest follows the default setting?
Iliana Dyankova
Telerik team
 answered on 07 Feb 2013
3 answers
1.6K+ views
I cant seem to get window to open, I get error
 Unable to get property 'open' of undefined or null reference

$("*[data-add-team]").click(function () {
    var win = $("#teamWindow")
    win.show().data("kendoWindow").open().center().toFront();
})
    <div data-menu-item="teams">
        @code
            Dim TeamCreateWindows As Kendo.Mvc.UI.Window = Html.Kendo.Window() _
                                                               .Name("teamWindow") _
                                                                   .Title("Create Team") _
                                                                   .Actions(Sub(actions)
                                                                                    actions.Custom("custom")
                                                                                    actions.Minimize()
                                                                                    actions.Maximize()
                                                                                    actions.Close()
                                                                            End Sub) _
                                                                        .LoadContentFrom("create", "team", New With {.area = "contractor"}).Animation(True) _
            .Content(Sub()
    @<text>
    Loading.......
    </text>
                     End Sub) _
        .Draggable().Resizable().Width(500)
     
    TeamCreateWindows.Render()
End Code
            @Html.Button("addTeam", "Add Team", BO.Enumerators.ButtonType.Button, BO.Enumerators.ButtonStyle.LoLight, New With {.data_add_team = True})
 
        @Html.Partial("_Teams", Model.Contractor)      
    </div>

Alan Mosley
Top achievements
Rank 1
 answered on 06 Feb 2013
1 answer
108 views
Is there an MVC wrapper for mobile in the works?  If so what would be a rough estimate of release date?
Sebastian
Telerik team
 answered on 06 Feb 2013
2 answers
152 views
I've got a chart, which I want to be able to dynamically set the theme for - based upon a value set in a ViewBag variable.

I can do this if the chart is defined in JavaScript, however I can't seem to set it when the chart is defined using the helper.

i.e.:-
@(Html.Kendo().Chart<CMS_2013.Models.Temp_Data_Summary>()
      .Name("Chart")
      .Legend(false)
      .Title("Data in Temporary Pricing Table")
      .DataSource(dataSource => dataSource
          .Read(read => read.Action("GetSummaryChartData", "Pricing"))          
      )
      .Series(series => {
          series.Column(d => d.Records).Tooltip(true) ;
          
      })
      .CategoryAxis(axis => axis
          .Categories(model => model.Class)
      )
       
      .HtmlAttributes(new { style = "width:350px; height:250px;"})
)
If I do:-

.Theme(ViewBag.SelectedTheme) - the page returns an error.  How can I do this?
AP
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 06 Feb 2013
4 answers
164 views
if i have this code
@(Html.Kendo().Grid(Model)    
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.emplmark).Groupable(false);
        columns.Bound(p => p.firstname);
        columns.Bound(p => p.lastname);
        columns.Bound(p => p.location);
        columns.Bound(p => p.county);
    })
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("GetWork", "Company"))
    )
)

The source return around 2000 records,but after i press next page(page 2),the data disapear.why?it isn't enough to put Pageable,to work the paging?
Daniel
Top achievements
Rank 1
 answered on 06 Feb 2013
3 answers
924 views
I have a question about filtering on the Kendo Grid.  I have looked all over the API docs, these forums, and SO and haven't come up with anything, so I figured I'd ask here.

Is there a straightforward way to set the filtering type to a different type other than the underlying type of the bound column?  

E.g.
I have a column called "ActivityID" bound to an int property in my ViewModel.  In the ClientTemplate of the bound column, I'm showing a property from my ViewModel called "ActivityNumber", which is a string.  When the user hits the filter drop down in the column header, I want them to be able to filter based on the string operators I have set up in the grid, not the number operators.

Does anyone know if there a straightforward way in the Kendo().Grid() configuration to achieve this?  I'm sure there's  a way to do it on the client side, but I was hoping that I was missing something really obvious before going down that path.
Dimiter Madjarov
Telerik team
 answered on 06 Feb 2013
5 answers
562 views
Hi,

i'm a bit surprised, because i Just moved from Telerik MVC extensions to Kendo UI Complete for MVC, and i noticed that the load event of the grid disappeared.

And if i try to do what i want in the document load event ($(document).ready(......)), the grid is not yet constructed or available if i call it like this :

var

grid = $("#Grid").data("kendoGrid"); => error

Did I miss something ?

 

Atanu
Top achievements
Rank 1
 answered on 06 Feb 2013
Narrow your results
Selected tags
Tags
+? 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?