Telerik Forums
UI for ASP.NET MVC Forum
6 answers
860 views
Using the MVC3 wrappers for Kendo UI, my grids are wired up to Controllers for their various CRUD operations.  

In one of my models, I have a series of boolean values (that in turn handle values for checkboxes) where at least one has to be checked before being considered "valid".  As I have not found a good way to handle that kind of validation directly in the model, I am manually checking those 3 booleans in the ActionResult and where all are false, I return an error on the ModelState.  

What I would like to be able to do is when the grid receives the error in its respective event, to keep the row that was being edited in edit mode.  My attempts to put the row in edit mode manually have not worked, as it appears a sync is firing, which triggers DataBound, which tromps all over my row that I just put into edit mode.  

Is there a way to:
1.  Instruct a grid to keep edit mode open (with the original values) when an Error event is triggered from a DataSource save?
or
2. Define a custom client-side validation step to perform the check against those booleans before the DataSource Save?
Samer
Top achievements
Rank 1
 answered on 21 Jul 2014
3 answers
153 views
Trying to implement the popup editor as per http://demos.telerik.com/aspnet-mvc/grid/editing-popup

I already have grid displaying data (index.cshtml) but now not sure how to incorporate the .cshtml and .cs "files" displayed on this page.

First question is, why is there only one .cshtml page but multiple controllers on the .cs page?  Is there supposed to be just one .cshtml page and I should place everything in it (in this case index.cshtml)?

Thanks,
Dimiter Madjarov
Telerik team
 answered on 21 Jul 2014
7 answers
283 views
I added ClientTemplate() to my column so that I can display the value as "Yes" and "No" rather than the default "True" and "False".
columns.Bound(p => p.IsActive).ClientTemplate("#= IsActive ? 'Yes': 'No'
#").Title("Is Active").Width(100);<BR>

However, the grid is still displaying True and False.

What am I missing?

Thanks,
Dimiter Madjarov
Telerik team
 answered on 21 Jul 2014
1 answer
330 views
Hi,
I have this code in my page

@(Html.Kendo().Grid<LibroDinamico.Models.LibroViewModel>()
        .Name("gridLibros")
        .Columns(columns =>
        {
            columns.Bound(c => c.Titulo);
            columns.Command(command => { command.Edit(); command.Destroy(); });
        })
        .Scrollable()
        .ToolBar(toolbar => toolbar.Create())
        .Editable(editable =>
        {
            editable.Mode(GridEditMode.PopUp);
        })
        .ColumnMenu(p => p.Columns(false))
        .Filterable().Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
        .Sortable(sortable => sortable.AllowUnsort(false))
        .Pageable(pageable => pageable
        .Refresh(true)
        .PageSizes(true)
        .PageSizes(new[] { 5, 10, 25, 50 }))
        .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(10)
                .Model(model =>
                {
                    model.Id(p => p.Id);
                    model.Field(p => p.Id).Editable(false);
                })
                .Create(create => create.Action(MVC.Libro.ActionNames.Create, MVC.Libro.Name))
                .Read(read => read.Action(MVC.Libro.ActionNames.GetLibros, MVC.Libro.Name))
                .Update(update => update.Action(MVC.Libro.ActionNames.Edit, MVC.Libro.Name))
                .Destroy(destroy => destroy.Action(MVC.Libro.ActionNames.Delete, MVC.Libro.Name))
        )
      )  
With this ViewModel    

public class LibroViewModelwith 
    {
        public int Id { get; set; }
        public string Titulo { get; set; }
        public DateTime Creado { get; set; }
        public DateTime Modificado { get; set; }
    }

When I click in Add a new row the popup appears with all the properties of the view model, but I dont want to show all this properties, I want only to present the Titulo. How I can do this. 
Thanks



















Dimiter Madjarov
Telerik team
 answered on 21 Jul 2014
1 answer
184 views
Are are evaluation your product for a new project we are just evaluating.   We would like to use the UI for ASP.NET MVC without using Entity Framework.   Can you tell me if this is possible?
Sebastian
Telerik team
 answered on 21 Jul 2014
3 answers
190 views
Hi,

I'm using a grid to edit a model with a Required attribute on string property. The problems is that the validation is always false which prevent the user from saving. I have attach the relevant files and would appreciate any help you could provide. 

Thanks,







Alexander Popov
Telerik team
 answered on 21 Jul 2014
1 answer
256 views
Hello,

Using the MVC helper to create a kendo grid.  When I enable both filtering and sorting the filter icon is left aligned rather than right aligned.  Examining the rendered HTML reveals that an extra anchor tag is being rendered around the filter icon markup, thus preventing it from picking up the appropriate CSS styles.  See attached screenshots for examples.  I do not see this behavior when building the grid via javascript/jquery.  I'll open a support ticket for this as well.

Thanks,
Lee
Iliana Dyankova
Telerik team
 answered on 21 Jul 2014
3 answers
79 views
I want to report two bugs in Q1 2014 SP2 release. I write demo to repro the scenario . The code is  attached.
(1) stockchart.  When I set missingValue = 'gap', and the chart data contain isolated point (a single point whose proceeding and succeeding points are both missing), when user mouse hover its legend, the chart throw exception. In my demo, when you click 'Microsoft' legend, exception occurs.
In the very early release version, this bug does not exist. I notice the bug happen since you add this new feature to chart: highlight data points when user mouse hover its legend.

(2) window. Just try my example. First close the window. Then click the button to open the window again. You will find that the text within the window can not be selected. This bug does not exist in the earlier release version. Now it exists in Chrome, Safari, although it works wells with IE.




T. Tsonev
Telerik team
 answered on 21 Jul 2014
3 answers
335 views
Hi, 

I have a Kendo tree view with three levels. Please see the attached file MyTree.jpg.

I have a leaf node's with text value "CHINA".  I am not able to get the leaf node's parent node text. Please see the attached file ChromeOutput.jpg. 

Please advise why undefined is returned for below -

treeview.text(treeview.parent(treeview.findByText("CHINA")))

Regards, 
Manoj



Alex Gyoshev
Telerik team
 answered on 21 Jul 2014
1 answer
393 views
My company is considering purchasing several licenses of Kendo UI Professional and UI for ASP.NET MVC.  I am using MVC 5 and the latest version of UI for ASP.NET MVC.  I am working with hierarchical data.   I am attempting to create the TreeView in the _Layout view and populate it with urls or action links.

My current code:

In the _Layout View:

@Html.Partial("_ProductTree")

"_ProductTree" Partial View

@(Html.Kendo().TreeView().Name("ProductTree")
    .DataSource(d => d
        .Model(m => m
            .Id("ProductId")
            .HasChildren("Categories"))
    .Read(r => r.Action("_ProductTree", "Home")))
    .DataTextField("ProductName"))

Action Method:

        [ActionName("_ProductTree")]
        public JsonResult GetProductTree()
        {
            var products = _productBusinessService.GetProducts();

            var result = products.Select(c => new
            {
                c.ProductID,
                c.ProductName,
                Categories= c.Categories.Any()
            }).OrderBy(t => t.ProductName);

            return Json(result, JsonRequestBehavior.AllowGet);
        }

I am having a number of issues:

1.  When I expand a parent node that has children, the TreeView is hitting the action method and appending the entire tree to the child, instead of just displaying the children.
2.  I need to be able to nest the TreeView two-deep, for example Product > Category > Type.
3.  I am trying to figure out how to aggregate or project the data using LINQ to do a two-deep higherarchy.
4.  I tried turning off LoadOnDemand but that made the TreeView call the action method once for each record in the Product list.

I have tried inserting the TreeView Razor code directly into the _Layout view (not using a partial view).   I realize that I may need to move the action method into a base controller class and inherit it in every controller to stop it from appending the list to the parent node. If I cant get this working soon, I may have to either use Kendo UI Professional or an open source alternative.

Thank you in advance for your help!
















Wayne
Top achievements
Rank 1
 answered on 19 Jul 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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
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
DropDownButton
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
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
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?