Telerik Forums
UI for ASP.NET MVC Forum
3 answers
113 views
Hi Kendo team,

I noticed in my project that there seemed to be two sets of page number controls at the bottom of my grid after upgrading to the Q2 Beta.  I thought maybe it was something I was doing wrong, so I tried running the Kendo examples locally and I get the same behavior.  Attached is a screen capture of what I'm seeing in the grid demo, with the extra set of numbers highlighted.  Is this something related to the new paging controls that needs to be updated in the MVC wrapper?  Thanks for your help.



Regards,
Brian
Patrick
Top achievements
Rank 2
 answered on 04 Aug 2012
3 answers
273 views
When I run the Kendo examples, I see the input fields on popup dialogs for Edit and Create are using Kendo UI extensions. For example, kendoDatePicker is used for DateTime field, kendoNumericTextBox is used for numeric field, etc. However, on the popup dialogs of my application, this is not happening. The plain html input tags are used. Can anyone tell me what I am missing?
Victor
Top achievements
Rank 1
 answered on 02 Aug 2012
5 answers
303 views
Hi!

We have a few very narrow bool columns (representing for example "Is favorite"). We have been discussing how to do sorting/filtering in a good way here and would like to get some input as to what is possible.

For us the funnel icon (to filter) takes too much space, and is also the popup is too verbose. Rather we would like to click to filter, similair to how sorting works. Would this be possible? Or is there another preferred way?

What we think we would like is:
  1. Sorting turned off for the bool column, filtering turned on, but without the funnel icon (or exchange it for a custom icon?) - all items shown
  2. User clicks header - only favorite items are shown
  3. User clicks header again - only non-favorite items are shown
  4. User clicks header once more - all items are shown
  5. During step 1-4 the selected grid sort order is maintained.

We got a demo working by doing something like (after setting .Filterable(false).Sortable(true) on the column):

public ActionResult _Items([DataSourceRequest]DataSourceRequest request)
{
    var favSort = request.Sorts.FirstOrDefault(s => s.Member == "IsFavorite");
    if (favSort != null)
    {
        request.Sorts.RemoveAt(request.Sorts.IndexOf(favSort));
        request.Filters.Add(new FilterDescriptor("IsFavorite", FilterOperator.IsEqualTo, favSort.SortDirection == ListSortDirection.Ascending));
    }
    //...
}

It works quite well but has two drawbacks:

  1. The previously selected sort order is lost
  2. The visual clue that only favorites / non-favorites are shown is the "up/down" arrow normally showing sort order, which is a little bit confusing. For specifically the favorite column something like "All results => dimmed star", "Only favorites => filled star", Only non-favorites => hollow star" would probably be best, but we dont know how to achieve this.

Any thoughts on how to implement any of this?


Thanks!
/Victor

Rosen
Telerik team
 answered on 02 Aug 2012
1 answer
166 views
I have a kendo grid using the MVC Extensions.  I have set the grid to Sortable and the columns i don't want sorting on to false. However, once rendered to the page all columns headers are still clickable but only the ones marked sortable get the 'hand' icon.  For instance, i have a 'select all column'  and a 'group list' column that i don't want sorted.

@(Html.Kendo().Grid<MyViewModel>()
    .Name("my-list")
    .HtmlAttributes(new { @class = "grid" })
    .DataSource(d =>
    {
        var dsStep = d.Ajax();
        dsStep.Read(read => read.Action("_Index", "Matter"))
            .PageSize(Model.InitialPageSize);
    })
    .Columns(columns =>
    {
        columns.Bound(p => p.Selected).Sortable(false).ClientTemplate(
            "<input type='hidden' name='list.Index' value='#=ID#'/>" +
            "<input type='checkbox' id='list_#=ID#__Selected' name='list[#=ID#].Selected' value='true'/>").Width(50);
        columns.Bound(p => p.Name).Template(t =>
        {
            Html.ActionLink(t.Name, "Index", "Detail", new { id = t.ID });
        })
            .ClientTemplate("<a href='" + @Url.Content("~/Detail/Index") + "/#=ID#'>#=Name#</a>");
        columns.Bound(p => p.Number).Width(50);
        columns.Bound(p => p.Clients).Sortable(false);
        columns.Bound(p => p.Area.Name).Width(100);
        columns.Bound(p => p.Staff).Sortable(false);
        columns.Bound(p => p.DateOpenedFormatted).Sortable(true);;
 
    })
    .Resizable(r => r.Columns(true))
    .Events(events => events.DataBound("wow"))
     
    .Pageable()
    .Sortable(sort => sort.SortMode(GridSortMode.SingleColumn))
    .Selectable(a => a.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
)

Any help would be great.  I am going to try the same on jsfiddle (using the js version) to see if i can reproduce.

Rosen
Telerik team
 answered on 02 Aug 2012
2 answers
212 views
I have started a project using Kendo UI for MVC BETA and now I would like to upgrade the project to the new non Beta release. What steps do I follow to perform the upgrade? My understanding is that I copy the new js and css files in but do I do this from within VS? Do I delete the old files first? Thanks for any help on this.

AkAlan
Top achievements
Rank 2
 answered on 01 Aug 2012
2 answers
195 views
good morning everyone,

i am currently trying to setup a menu using the MVC wrapper for KendoUI menu and having some difficulty trying to setup the Animation part.

The animation method is overloaded.  I know one of them i pass in a boolean but the other one, not sure how to use that one.  Right now, I have:

@(Html.Kendo().Menu()
                .Name("mainMenu")
                .Animation(true) ) 


But i want to be able to customize the setup of the animation of the menu like how the regular KendoUI Menu can, using the 2nd overloaded Animation method:

var $mainMenu = $('#mainMenu');

        $mainMenu.kendoMenu({
            animation: 
            { 
                open: 
                { 
                    effects: "fadeIn slideIn:down"
                } 
            },
        });


There isn't any documentation or example of how to use the 2nd overloaded Animation method of the KendoUI MVC wrapper.  I am currently using the latest trial version of the Kendo UI Complete for ASP.NET MVC.

Thank you very much for you help.

Sam
Top achievements
Rank 1
 answered on 01 Aug 2012
1 answer
205 views
Hello,

There is a really nice example of DropDownLists in InCell-Grids in the MVC-examples which come with KendoUI ("Editing Custom Editor"). It works really nice and I need exactly the same thing, with one exception: I need to be able to add new rows to a grid. This is where the example totally fails.

If I add the toolbar.Create() functionality and try to add a new line it always says "Microsoft JScript runtime error: 'Employee' is undefined"

Here is how I changed the toolbar:
.ToolBar(toolBar => { toolBar.Save(); toolBar.Create().Text("Add row!"); })

Is there any solution how this example works using a Create()-Button?

Thanks,
Mathias
Jason
Top achievements
Rank 1
 answered on 01 Aug 2012
1 answer
319 views
I am using a Kendo grid in Batch Edit Mode.  When I add rows to the grid and click Save Changes, the added rows correctly get passed to the Create method that I have hooked up, and I am able to add the rows to the database.  The problem I have is that when I then edit one of those newly-added rows and click Save Changes, these rows get passed to the Create method (again) instead of being passed to the Update method.
Please advise asap as to what I am doing wrong.  Here is my Create Method that is hooked up to the grid.
[HttpPost]
public ActionResult Create( [DataSourceRequest]DataSourceRequest request, [Bind(Prefix = "models")]FormCollection addedRoles) {
        try { // code here to update the database from the addedRoles FormCollection. This part works fine. ModelState.Clear() // I added this in to see if it makes a difference...it does not. }
	catch (Exception ex) {
                ModelState.AddModelError("", ex.Message);
            }
        return Json(ModelState.ToDataSourceResult());
}
Shawn
Top achievements
Rank 2
 answered on 01 Aug 2012
0 answers
237 views
Using MVC and Entity Framework I have a model that looks like this:

 public class AddressType
    {
        [ScaffoldColumn(false)]
        public int AddressTypeId { get; set; }
        [Display(Name = "Address Type", Prompt = "Select an Address Type")]
        [Required(ErrorMessage = "Please Select an Address Type.")]
        public string AddressTypeName { get; set; }
        [Display(Name = "Order", Prompt = "Select a display order")]
        [Required(ErrorMessage = "Please Select a display order.")]
        [Range(0, 10000)]
        public int DisplayOrder { get; set; }
        public DateTime? DateCreated { get; set; }
        public string CreatedBy { get; set; }
        public DateTime? DateModified { get; set; }
        public string ModifiedBy { get; set; }
        public byte[] RowVersion { get; set; }
        [Display(Name = "Address")]
        public virtual ICollection<Address> Addresses { get; set; }
    }

Normally in MVC I can do the following
<td>
@(item.Addresses == null ? "None" : item.Addresses.Count.ToString())
</td>


Currently my Grid code looks like this, so far I am having no luck getting the count to display for Addresses

@(Html.Kendo().Grid(Model)    
    .Name("Grid")
    .Columns(columns => {
        columns.Bound(p => p.AddressTypeName);
        columns.Bound(p => p.DisplayOrder);
        columns.Bound(p => p.Addresses);
        columns.Command(command => { command.Edit(); command.Destroy(); });
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource
        .Server()
        .PageSize(5)
        .Model(model => {
            model.Id(p => p.AddressTypeId);
            model.Field(p => p.Addresses).Editable(false);
        })
        .Aggregates(aggregates =>
    {
        aggregates.Add(p => p.Addresses).Count().ToString();
    })
        .Read("Index", "AddressType")
        .Update("Edit", "AddressType")
        .Create("Create", "AddressType")
        .Destroy("Delete", "AddressType")
    )
)
Chad England
Top achievements
Rank 1
 asked on 01 Aug 2012
1 answer
157 views
With my current code, whenever I click "Add" on the grid, the model's ID fields still show up! I can get the functionality I want if I use just the plain old Kendo Web, but I'd really like to get this working using the MVC wrapper. I've spent hours trying to! Could somebody please tell me what I'm doing wrong here? 
Chad England
Top achievements
Rank 1
 answered on 01 Aug 2012
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
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?