Telerik Forums
UI for ASP.NET MVC Forum
1 answer
207 views
Using the ASP.NET MVC wrappers, I have a tabstrip that loads it's respective tabitems contents from Html actions

@(Html.Kendo().TabStrip()
       .Name("inst_details_tabstrip")
       .Items(tabstrip => {
            tabstrip.Add().Text("Details").Content(@<text>@Html.Action("InstitutionDetails", "InstitutionSetup")</text>);
                       
            tabstrip.Add().Text("Locations").Content(@<text>@Html.Action("ServiceLocations", "InstitutionSetup")</text>);
                       
            tabstrip.Add().Text("Devices").Content(@<text>@Html.Action("Printers", "InstitutionSetup")</text>);
                       
            tabstrip.Add().Text("Users").Content(@<text>@Html.Action("UserList", "InstitutionSetup")</text>);
                       
        }))
This process works fine.  However, there is one case where when the page loads, the Users tab should be loaded by default rather than the Details tab.    

The following snippet will change the rendered state of the tabstrip to show the Users tab as selected, but will not switch to its corresponding contents (instead continues to show the Details tab content)


var tabstrip = $("#inst_details_tabstrip").data("kendoTabStrip");
tabstrip.select(tabstrip.tabGroup.find(':contains("Users")'));
var item = tabstrip.items()[3];
tabStrip.reload(item);
is there something simple I am missing?
Petur Subev
Telerik team
 answered on 20 Jun 2013
1 answer
270 views
Hi ,

I will appreciate if someone could help me with this issue.
I have a Model with the following structure:

public class PieChartModel
    {
        public string YearMonth { get; set; } //this have a data like 2013.05
        public decimal Balance { get; set; }
        public string ClientName { get; set; }
        public decimal EndingPercentage { get; set; }
    }

My task is to display this information in a graph that
contain multiple axis represented like in Image 1

The code I used to get the graph on Image 1 was this one:

@(Html.Kendo().Chart<AccutracDashboard.Models.PieChartModel>()
    .Name(Model.ChartName)
    .HtmlAttributes(new {style = "height: 500px"})
    .Title(Model.ChartTitle)
    .Legend(legend => legend
        .Position(ChartLegendPosition.Bottom)
    )
        .DataSource(ds => ds.Read(read =>
read.Action(Model.ChartAction, Model.ChartController))
                                      )        
    .Series(series => {
        series.Column(model =>
model.Balance)
            .GroupNameTemplate("#= group.value # (#= series.name #)").Labels(false);
        series.Line(model =>
model.EndingPercentage).Name("Percent")
            .Axis("percent").Labels(false);
    })
    .CategoryAxis(axis => axis
        .Categories(model => model.ClientName)
        .Labels(label => label.Visible(true).Rotation(45))
        .AxisCrossingValue(0, 21)
    )
    .ValueAxis(axis => axis.Numeric()
        .Labels(labels => labels
            .Format("${0}")
        ).Title("Indicator
$"))
    .ValueAxis(axis => axis
        .Numeric("percent")
            .Title("Frequency")
            .Labels(labels => labels.Format("{0}%"))
            .Min(0).Max(100)
    )
    .Tooltip(tooltip => tooltip
        .Visible(true)
        .Format("{0:N0}")
    )
)

but our client wants each bar to have a different color and
be shown as a legend in the graph as you can see on Image 2

Grouping by client I can implement  this request, but then the line graph is not represented properly.
The code I used to group is almost the same

@(Html.Kendo().Chart<AccutracDashboard.Models.PieChartModel>()
    .Name(Model.ChartName)
    .HtmlAttributes(new {style = "height: 500px"})
    .Title(Model.ChartTitle)
    .Legend(legend => legend
        .Position(ChartLegendPosition.Bottom)
    )
        .DataSource(ds => ds.Read(read =>
read.Action(Model.ChartAction, Model.ChartController))       
.Group(group => group.Add(model => model.ClientName)))        
    .Series(series => {
        series.Column(model => model.Balance)
            .GroupNameTemplate("#= group.value # (#= series.name #)").Labels(false);
        series.Line(model =>
model.EndingPercentage).Name("Percent")
            .Axis("percent").Labels(false);
    })
    .CategoryAxis(axis => axis
        .Categories(model => model.ClientName)
        .Labels(label => label.Visible(true).Rotation(45))
        .AxisCrossingValue(0, 21)
    )
    .ValueAxis(axis => axis.Numeric()
        .Labels(labels => labels
            .Format("${0}")
        ).Title("Indicator
$")
    )
    .ValueAxis(axis => axis
        .Numeric("percent")
            .Title("Frequency")
            .Labels(labels => labels.Format("{0}%"))
            .Min(0).Max(100)
    )
    .Tooltip(tooltip => tooltip
        .Visible(true)
        .Format("{0:N0}")
    )
)

What do I need to do in order to show the data in the graph displaying the bars with different color and showing  a legend per client,   and at the same time be able to see properly the line chart?

Please let me know if you need more information.

Thanks, Ainel



Iliana Dyankova
Telerik team
 answered on 20 Jun 2013
3 answers
581 views
Dear Kendo Team,

I have a grid of with a row that contains several values for each item.  I would also like to be able to filter and group by that row but I haven't got that far yet because I can't even display the information.

The grid looks like so:

@( Html.Kendo().Grid<ProjectXMVC3.ViewModel.PersonnelIndexViewModel>()
        .Name("Personnel")
        .Columns(columns =>
        {
            columns.Bound(o => o.AssetId).Hidden();
            columns.Bound(o => o.Num).Hidden();
            columns.Bound(o => o.Name).Width(150);
            columns.Bound(o => o.Email).Width(200);
            columns.Bound(o => o.AssetSubTypeName).ClientTemplate("# var j = AssetSubType.length; for(var i = 0; i < j; i++){# #: AssetSubType[i] #  #}#");
            columns.Bound(o => o.DateBirth).Format("{0:d}").Width(100);
            columns.ForeignKey(o => o.NationalityId, (System.Collections.IEnumerable)ViewBag.NationalityId, "CountryId", "Country").Title("Nationality");
            columns.ForeignKey(o => o.PreferedAirport, (System.Collections.IEnumerable)ViewBag.PreferedAirport, "AirportId", "AirportName").Title("Prefered Airport");
            columns.ForeignKey(o => o.ContractorTypeId, (System.Collections.IEnumerable)ViewBag.ContractorTypeId, "ContractorTypeId", "ContractorDescrip").Title("Contractor Type");
            columns.Command(com =>
            {
                com.Custom("Details").Click("onPersonSelected");
                com.Edit();
                com.Custom("Block").Click("onBlocked");
                com.Destroy();
            }).Width(240);
        })
        .DataSource(d => d
            .Ajax()
            .Model(model => model.Id(p => p.AssetId))
            .Read(read => read.Action("Read_Personnel", "Personnel"))
            .Events(events => events.Error("error_handler"))
            .Update(update => update.Action("Personnel_Update", "Personnel"))
            .Destroy(destroy => destroy.Action("Personnel_Destroy", "Personnel"))
        )
        .Events(ev => { ev.DataBound("onDataBound"); ev.Edit("onEdit"); })
        .Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("Person"))
 )

The problems occurs at the client template line which causes the grid to crash.  I can output the length, individual subtypes but as soon as it loops it crashes in a very terminal way. 

I've tried:

"# for(var i = 0; i <  AssetSubType.length;  i++){#  #: AssetSubType[i] #  #}#"
"# for(var i = 0; i <  AssetSubType.length;  i++){#  #= AssetSubType[i] #  #}#"

This works:

"# if(AssetSubType.length > 0){#  #: AssetSubType[0] #  #}#"

Any assistance would be very much appreciated.  Thanks in advance.
Daniel
Telerik team
 answered on 20 Jun 2013
1 answer
134 views
Hello,

I have a grid detail , i want to generate the name of the grid with a date .  How can i generate the name of the grid like this : 
"#= kendo.toString(Timestamp,  'dd_MM_yyyy_hh_mm_ss') #"

Thanks
Vladimir Iliev
Telerik team
 answered on 20 Jun 2013
3 answers
214 views
I NEED an editor that has the Format Code Block feature.  I've created an MVC app that uses Kendo, now the VS Telerik menu doesn't have the selection to apply the Telerik MVC Extensions to my MVC application, so I can use that Editor.  Do I have to add the Telerik MVC Extensions manually just to get the Editor with the Code Block?

Bottom line is, I need an editor with the Code Block feature.  What are the suggestions for this?  It doesn't seem like Kendo has one, correct?

Thanks,
King Wilder
Atanas Korchev
Telerik team
 answered on 20 Jun 2013
4 answers
538 views
I uploaded a repro project demonstrating the issue I'm having here: http://www.mediafire.com/download/s1ba31xy83naa8c/NullableComboboxInGrid.zip

Have a grid for a model with a nullable int (representing a FK relationship)
public class NullableFkModel
{
    [ScaffoldColumn(false)]
    public int Id { get; set; }
    public string Name { get; set; }
    [UIHint("Fk")]
    public int? FkId { get; set; }
}
Editor template for the nullable FK property is:
@model int?
 
@(Html.Kendo()
      .ComboBoxFor(m => m)
      .DataValueField("Value")
      .DataTextField("Text")
      .BindTo(new [] { new SelectListItem() { Text = "Joe Blow", Value = "1"}, new SelectListItem() { Text = "Jane Doe", Value = "2"}, new SelectListItem() { Text = "Batman", Value = "3"}})
      .Filter(FilterType.Contains))

Grid is pretty basic:
@(Html.Kendo()
    .Grid<NullableFkModel>()
    .Name("Grid")
    .Columns(columns =>
        {
            columns.Bound(item => item.Name);
            columns.Bound(item => item.FkId);
            columns.Command(command => command.Edit());
        })
    .DataSource(ds => ds.Ajax()
                        .Model(model => model.Id(m => m.Id))
                            .Read(read => read.Action("Nullable_Read", "Demo"))
                            .Create(create => create.Action("Nullable_Create", "Demo"))
                            .Update(update => update.Action("Nullable_Update", "Demo"))
    )
    .ToolBar(commands => commands.Create())
    .Editable(edit => edit.Mode(GridEditMode.PopUp)))

When editing, everything works fine. But when adding, the FkId is not bound to the combobox and the value is not update when the combobox is changed. You can see that it is not updated in the grid and it is not posted back to the controller.

When using the exact same setup with a non-nullable property it works as expected. I have a demo of both in the uploaded project.
Adam
Top achievements
Rank 1
 answered on 19 Jun 2013
1 answer
443 views
When creating a new item (using popup editing) I would like to save the data but prevent the popup from closing.  Instead I would like to show additional options that aren't shown until the initial object is created.  Can anyone tell me how to accomplish this?  I tried adding a "Close" event to the window but that never fires for some reason.


Thanks,
Derek
Derek Kepler
Top achievements
Rank 1
 answered on 18 Jun 2013
1 answer
146 views
Maybe anybody can help me out! I am confused.
I am failing to localize a date column in a grid.
The column is bound the following way in .csthml file:
  
"columns.Bound(o => o.IssueDate).Title(Strings.IssueDate).Format("{0:d}");"

- Session["culture"] is "de-DE"
-.Thread.CurrentCulture/CurrentUICulture is de-DE

But the date ist always displayed in british format. With the old asp.net MVC controls this works fine!

I am using asp.net mvc 4.

What am I doing wrong?

brgds
Malcolm Howlett
Malcolm
Top achievements
Rank 1
 answered on 18 Jun 2013
2 answers
544 views
Hello,

I have few text box, drop down list controls and grid entry also. I would like to hit the save button once which should save the grid entries and other control values as well. I would disable the grid save button and I will use the main save. I have model which has the sub-collection binds the value to the grid. For example,

Model
-------------
Name,  -> textbox
Age, -> textbox
Qualifications (collections) - user can add n number of entries -> grid

Qualification collection will have
Degree,
Year of completion,
Grade.
 
I am able to display the values when I bind with the sub-collection. When I hit the save button, the model sub-collection does not get update with the entered / modified values in the server-side. I have tried the below link also which could not solve my issue.
http://www.kendoui.com/forums/mvc/grid/grid-toolbar-functioality-outside-grid.aspx

Is there any other ways to solve this issue?

Regards,
Murugan
Petur Subev
Telerik team
 answered on 18 Jun 2013
1 answer
180 views
I have the kendo licence, but I am now working on a old project useing the old MVC telerik extensions, I just upgraded the jquery to 2.02 before thinking about the MVC extensions. will the MVC telerik intentions (not kendo) work with jquery 2.0.2?
Thanks
Sebastian
Telerik team
 answered on 17 Jun 2013
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
ColorPicker
DateRangePicker
Security
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?