Telerik Forums
UI for ASP.NET MVC Forum
1 answer
135 views
The sample source code does not show, What is the Kendo Mobile Type we need to use to create such a form?

http://demos.telerik.com/aspnet-mvc/mobile-forms/index

Sebastian
Telerik team
 answered on 17 Oct 2014
1 answer
135 views
Hi,

I'm trying to use KendoGrid server-side logic for grouping grid data with the help of ToDataSourceResult extension.

public class User
{
        public int UserID;
        public string UserName;
        public int UserType;
        public ComplexID complexID;
}

public class ComplexID
{
       public string cID;
       public string Description;
}

I have a list of users:

var userLst = new List<User>{usr1, usr2, usr3};

I'm trying to group the users to be displayed in the KendoGrid:

var kendoData = userLst.AsQueryable().ToDataSourceResult(kendoRequest);

If I group by UserType, everything works fine. My question is how can I group the data by complexID.cID? What should I specify in kendoRequest?

Thank you.
Alexander Popov
Telerik team
 answered on 17 Oct 2014
1 answer
181 views
Hi,

We have a specific situation which is not so uncommon. We are using Kendo controls for ASP.NET MVC and binding them to ASP.NET Sitemap which works ok.

We would need to setup on the top of the page Kendo Menu (or any other Kendo control?) which will show only the top level menu options without their children. Besides that, on the left side there should be another menu which does not show the top level items, but only their children.

For example:
- Users
       - Create
       - Manage
       - List
- Payments
       - Create
       - Due
       - List

Top menu should show only Users and Payments items. Left menu should show depending on which page you are either children of Users or children of Payments.


How can this be achieved?



Thank you!






Dimo
Telerik team
 answered on 16 Oct 2014
1 answer
111 views
I'm trying to perform editing like in the example :
http://demos.telerik.com/aspnet-mvc/mobile-listview/editing

I have an error on .Events(events => events.Init("listViewInit"))

Error 2 'Kendo.Mvc.UI.Fluent.MobileListViewEventBuilder' does not contain a definition for 'Init' and no extension method 'Init' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.MobileListViewEventBuilder' could be found (are you missing a using directive or an assembly

Thank you
Eric
Top achievements
Rank 1
 answered on 16 Oct 2014
1 answer
981 views
Hi,

Do you have sample code for selecting, then copying and pasting the selected rows to other rows in the kendo ui asp.net mvc grid

Thanks,
Annie
Dimo
Telerik team
 answered on 14 Oct 2014
2 answers
226 views
I have the following Grid:

@(Html.Kendo()
    .Grid<IncidentBreakdownViewModel>()
    .Name("Grid")
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .ServerOperation(true)
        .Read(x => x.Route("PostReadJson", new { incidentId = Model.IncidentId }))
        .Create(x => x.Route("PostCreateJson", new { incidentId = Model.IncidentId }))
        .Destroy(x => x.Route("PostDeleteJson", new { incidentId = Model.IncidentId }))
        .Update(x => x.Route("PostUpdateJson", new { incidentId = Model.IncidentId }))
        .Model(model => model.Id(x => x.IncidentBreakdownId)))
    .Columns(columns =>
        {
            columns
                .ForeignKey<int?>(
                         x => x.IncidentBreakdownTypeId,
                         (SelectList)ViewBag.IncidentBreakdownTypes)
                .Width(50);
            columns.Bound(x => x.PortfolioId).Width(150);
            columns.Bound(x => x.Currency).Width(100);
            columns.Bound(x => x.ErrorAmount).Width(50);
            columns
                .Bound(x => x.PaymentRequired)
                .ClientTemplate("#= PaymentRequired ? 'Yes' : 'No' #")
                .Width(50);
            columns.Command(command => { command.Edit(); command.Destroy(); }).Width(60);
        })
    .ToolBar(toolbar => toolbar.Create().Text("Add new breakdown"))
    .Editable(x => x.Mode(GridEditMode.InLine))
    .Resizable(resize => resize.Columns(true))
    .Reorderable(reorder => reorder.Columns(true))
    .Sortable(x => x.SortMode(GridSortMode.MultipleColumn))
    .Navigatable())

The first column (IncidentBreakdownTypeId) is a drop down with two columns. I want the second column (PortfolioId) to be a different drop down depending on the selected value of the first column (IncidentBreakdownTypeId) and I want to use an AJAX Kendo ComboBoxFor for the second column like so:

<script>
    function onGetClientData() {
        return {
            text: $("#PortfolioId").data("kendoComboBox").text()
        };
    }
</script>
 
@(Html.Kendo()
    .ComboBoxFor(x => x)
    .Name("PortfolioId")
    .DataTextField("Text")
    .DataValueField("Value")
    .Filter(FilterType.Contains)
    .DataSource(dataSource => dataSource
        .Read(x => x
            .Route("GetClientsJson")
            .Data("onGetClientData"))
        .ServerFiltering(true)))

How can I achieve this?
Daniel
Telerik team
 answered on 14 Oct 2014
2 answers
804 views
Hi,

I'm a longtime user of the UI for ASP.NET AJAX. I recently grabbed the demo of the UI for ASP.NET MVC and started playing around with it as I have a need for using MVC.

I have a toolbar on a page defined as follows:
@(Html.Kendo().ToolBar()
    .Name("toolbar")
)

I have a script that is calling a controller to load information on what toolbar items should be made available:
<script>
    $(document).ready(function() {
        $.post("/FileReview/DisplayToolbar/" + @ViewBag.FileReviewID + "/", function(buttonsToAdd) {
            var toolbar = $("#toolbar").data("kendoToolBar");
 
            for (var i = 0; i < buttonsToAdd.length; i++) {
                toolbar.add({
                    type: "button",
                    text: buttonsToAdd[i].Text,
                    imageUrl: buttonsToAdd[i].ImageUrl,
                    url: buttonsToAdd[i].NavigateUrl,
                    click: buttonsToAdd[i].ClickAction
                });
            }
        });
    });
</script>

The controller builds an array of ToolBarButtonModel:
public class ToolBarButtonModel
{
    public string Text { get; set; }
 
    public string ImageUrl { get; set; }
 
    public string ClickAction { get; set; }
 
    public string NavigateUrl { get; set; }
}

This works great for buttons that use the NavigateUrl. Buttons that use the click action are not working. I am guessing it is because I am passing a string of the function name to be called when adding the button on client side (the function to be called exists on the view already). It seems I must add a direct reference to a function here. Is there a way I can do this? Or perhaps there is a better approach for dynamically adding toolbar buttons?

Alexander Valchev
Telerik team
 answered on 13 Oct 2014
7 answers
237 views
I have no idea what I am missing here, but no matter what I try, I cannot get the count to be accessible using #=count#  I have this working with JavaScript by using a function to return the count but this count should be accessible according to the demo examples which I have been over many times, and cannot see my mistake. Calling the "#=ClockInStatusString(data)#" and  #=groupHeaderString(data)# works fine, the proper data is returned.

<div>
            @(Html.Kendo().Grid<viewmodel>()
          .Name("CampaignGrid")
          .Columns(columns =>
          {
              columns.Bound(c => c.FirstName).Sortable(true);
              columns.Bound(c => c.LastName);
              columns.Bound(c => c.ClockInDate);
              columns.Bound(c => c.ClockInTime);
              columns.Bound(c => c.ClockInStatus).ClientTemplate("#=ClockIStatusString(data)#").ClientGroupHeaderTemplate("#=groupHeaderString(data)# #=count#");
              columns.Bound(c => c.Campaign).ClientGroupHeaderTemplate("(Agents Count: #=count# )"); ;
              columns.Bound(c => c.UserName).ClientTemplate("<a href='/User/GetUserHistory/#= UserName#'>Activity</a>");
          })
          .Sortable(sort => sort.Enabled(true))
          .DataSource(datasource => datasource
              .SignalR()
              .Aggregates(aggregates =>
              {
                  aggregates.Add(c => c.ClockInStatus).Count();
                  aggregates.Add(c => c.Campaign).Count();
              })
              .Group(groups =>
              {
                  groups.Add(model => model.ClockInStatus);
                  groups.Add(model => model.Campaign);
              })
              .Transport(tr => tr.Promise("hubPromise")
                  .Hub("hub")
                  .Server(server => server
                      .Read("getClockedInUsers")
                      .Update("update")
                      .Destroy("desstroy")
                      .Create("create")))
              .Schema(scheme => scheme
                  .Model(model =>
                  {
                      model.Id(c => c.UserId);
                      model.Field(c => c.FirstName);
                      model.Field(c => c.LastName);
                      model.Field(c => c.ClockInDate);
                      model.Field(c => c.ClockInTime);
                      model.Field(c => c.Campaign);
                      model.Field(c => c.ClockInStatus);
                      model.Field(c => c.UserId);
                  }))
              )
            )
        </div>

Any help would be appreciated!
Thanks!

Vladimir Iliev
Telerik team
 answered on 13 Oct 2014
4 answers
1.7K+ views
has anyone had any success with the following?? the function does not get called. Thank you!

      .Editable(editing => editing.Mode(GridEditMode.PopUp).Window(w => w.Events(e => e.Close("OnClose"))))
Vladimir Iliev
Telerik team
 answered on 13 Oct 2014
1 answer
208 views
Hi:
Is there any way to export to Excel from the Kendo Grid without using open source tools like NPOI?
Thanks.
Atanas Korchev
Telerik team
 answered on 13 Oct 2014
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?