Telerik Forums
UI for ASP.NET MVC Forum
0 answers
650 views
There is a breaking change with the new version of jQuery which affects the Kendo Q1 2013 version 2013.1.319

Since the empty result returned from the server in case everything is executed properly on the server side for the update and destroy requests, the error event of the dataSource is triggered because the empty result is not valid JSON.

The suggested resolutions when using the MVC Extensions are:
  • Use the Latest Internal Build version 2013.1.327
  • Change the response of the Update/Destroy actions from just serializing the ModelState to:
    return Json(ModelState.IsValid ? new object(): ModelState.ToDataSourceResult());


Kendo UI
Top achievements
Rank 1
 asked on 27 Mar 2013
1 answer
101 views
Hi Guys,

I'm using VS2010 with MVC 3 before. The grouping of the grid before is working as expected using this codes.

@(Html.Telerik().Grid<MyModelHere>()
        .Name("MyGridNameHere")
        .Columns(columns =>
                 {
                     columns.Bound(o => o.DueDateShortString).Width(75).Title(Html.Talent().GlobalTextResource("DueDate").ToString());               
                     columns.Bound(o => o.LearningCurriculumLabel).Hidden().ClientGroupHeaderTemplate("<div class='gridHeaderLabelGroup headerStandardGroup'><#= Key #></div>");
                 })
    .EnableCustomBinding(true)
    .DataBinding(dataBinding => dataBinding.Ajax().Select("RequiredTrainingGrid", "LearningManagement", new {id = Model.PersonID}).Enabled(true))
    .Sortable(sorting => sorting.SortMode(GridSortMode.SingleColumn).OrderBy(x => x.Add("DueDateShortString")))
    .Groupable(grouping => grouping.Groups(groups =>
           {
                groups.Add(o => o.LearningCurriculumLabel);
            }).Visible(false))
    .Pageable(paging => paging.Enabled(true).PageSize(5))
     )



But after migrating to VS2012 MVC 2012. This code is not working anymore.

Need your help on this guys.



Alvin
Daniel
Telerik team
 answered on 27 Mar 2013
1 answer
507 views
Hi Guys,

I have a Kendo grid which contain Detail ClientTemplate where
I have Save and cancel button inside Ajax.BeginForm.

When i save data in page 50 it is redirecting me to page 1 after saving but i need to stay in same
page 50 and do refresh.

Is there any solution????

Thanks in advance
Daniel
Telerik team
 answered on 27 Mar 2013
1 answer
395 views
Hi,

We intend to use Kendo UI for our new project. I am in the process of evaluating it's capabilities, we intend to use it with ASP.NET MVC.

Is there a way I can put a wrapper on top of the Kendo Grid? The wrapper will constitute certain properties (existing + new); or may be inherit it and use the inherited version all across?

Following are the few of the functionalities that we want to achieve:
1) Set certain properties with default values; say editing mode needs to be popup all across by default and I don't want that the developers do this individually, rather it should be driven by the base class.
 2) Add certain code in all the grid's pre load (any even actually, preload just an example) , so who so ever uses the grid a certain code executes. 

Thanks,
Avi
Petur Subev
Telerik team
 answered on 27 Mar 2013
17 answers
387 views
Help me please! :)

Hi,

I am using Grid popup editing to edit or add entries,

I have many issues:
1) I want to center the window after adding an additional grid (now i use specific css:
  .k-edit-form-container {
        width: 700px;
        height: 730px;
    })
2) Grid editable(Mode.PopUp) Window fails with Combobox in subGrid (if i remove combobox then all works)
3) When i use EditorTemplates for custom editable popUp Window, @Model.Id is always = 0 and i can't filter
subGrid in this Window by @Model.Id.

I have objects: Press,Plywood,PressPlywood  (Pmasc.Mes.PlywoodMillWeb.Business\Entities\Catalogues)
"View Press" has EditorTemplates
Object Plywood has attribute Uihint["PlywoodList"] for Combobox
PlywoodList and Press are in Views\Catalogues\EditorTemplates

I attached my project
Gusev
Top achievements
Rank 1
 answered on 27 Mar 2013
1 answer
84 views
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding gives an example:

public ActionResult Products_Read([DataSourceRequest]DataSourceRequest request)
{
var products = new NorthwindDataContext().Products;
DataSourceResult result = products.ToDataSourceResult(request);
return Json(result);
}

The setting up of the Grid works fine using a direct read of the db.  So now I have built my project as KendoUIMVCApplicaition1 and have connected to my database via EntityModel.cs in the EntityModel.rling directory within the application.  Its all there and I can see all the tables and the diagram.

I just cannot get the code in my controller to connect to the model.  So the questions:

1.  How is "NorthwindDataContext()" established and how do I know its name in my solution?  If I change it to var contacts = new TblNAsContact; I get no errors.  But...
2.  When I try to return contacts.ToDataSourceResult(request); it gives me errors that TblNAsContact does not contain a method called ToDataSourceResult.  In looking at the EntityModel.cs I can see it doesn't.

So the question is really beginner basic.  How do I use KendoUI MVC Complete with wrappers to access a model built using ORM?  Is there a current blog or sample application?  Most of what I have found seems to predate the use of KendoUI Complete for ASP.NET with wrappers and is code intensive while the new solution appears to be a huge productivity improvement.

Thanks,
Larry

Larry
Top achievements
Rank 1
 answered on 26 Mar 2013
2 answers
99 views
Over the last few days, i've been fighting an issue with editable cell focus as it relates to a grid that is loaded into a window. Here is an example of the code I am working with:
@{
    Html.Kendo().Window()
        .Name("popupwindow")
        .Title("Title Of Window")
        .Draggable()
        .LoadContentFrom("MyAction","MyController")
        .Draggable(true)
        .Width(800)
        .Modal(true)
        .Scrollable(true)
        .Visible(false)
        .Render();
}
@( Html.Kendo().Grid<MyProject.ViewModels.MyObject>()
    .Name("MyGrid")
    .Columns(col =>
    {
        col.Bound(p => p.ID);
        col.Bound(p => p.SomeField);
        col.ForeignKey(p => p.SomeOtherID,(System.Collections.IEnumerable)ViewBag.ListOptions, "Value", "Text");
    })
    .Editable(edit => edit.Mode(GridEditMode.InCell))
    .Scrollable()
    .DataSource(ds =>
            ds.Ajax()
            .ServerOperation(false)
            .Model(model =>
            {
                model.Id(p => p.ID);
                model.Field(p => p.SomeOtherID).DefaultValue(0);
            })
            .Read("_Read", "MyController")
            .Update("_Update", "MyController")
    )
    .ToolBar(tool =>
    {
          // Removed for this post
    })
)

When the window is loaded, it will render a view that results from LoadContentFrom(). The grid shows up and has all the correct data as expected. When a click is made into one of the editable fields, it toggles over into the editor view as expected; however, any subsequent click in the cell will cause it to lose focus and return to its viewer template. As a test case, I took the grid code and moved it into my index view and the issue is then resolved; as such, I find that it only occurs when the grid is loaded within a window.

I am experiencing this issue only in IE (all versions). Firefox and Chrome both appear to be operating as expected.
Justis
Top achievements
Rank 1
 answered on 26 Mar 2013
1 answer
338 views
Hi

I would like to populate the grid data based on a text field and only once a user clicks the search button.

            <div class="row-fluid">
                <div class="span3">
                    CID            
                    <input class="input-small" type="text" id="cid">
                </div>
                <div class="span3">
                    <button type="button" id="Search" class="btn btn-primary btn-small">Search</button>
                    <button type="button" id="Reset" class="btn btn-small">Reset</button>
 
                </div>
            </div>
 
   <div class="span12">
        @(Html.Kendo().Grid(Model).Name("grid").Columns(columns =>
    {
        columns.Bound(p => p.CopyComment)
                   .Title("Copy")
                   .ClientTemplate("<input type='checkbox' #= CopyComment ? checked='checked': '' # class='chkbx' />")
                   .HtmlAttributes(new { style = "text-align: center" })
                   .Width(50);
        columns.Bound(p => p.CID);
        columns.Bound(p => p.Surname);
        columns.Bound(p => p.Suburb);
        columns.Bound(p => p.FID);
        columns.Bound(p => p.CommentDate);
        columns.Bound(p => p.SalesClerk);
        columns.Bound(p => p.Comments);
        columns.Bound(p => p.Village);
        columns.Bound(p => p.CommentClass);
        columns.Bound(p => p.UnitNo);
        columns.Bound(p => p.ActivityTypeName);
        columns.Bound(p => p.ActivityMethodName);
        columns.Bound(p => p.HeardAbout);
        columns.Bound(p => p.NewspaperName);
        columns.Bound(p => p.CampaignName);
    }).Sortable()
      .Scrollable(scr => scr.Height(400))
      .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("GetSalesComments", "CopySalesComments")
        
 
      )
   )
)
    </div>
public ActionResult GetSalesComments(int? cid)
        {
//Do search here  and return result
            return Json(...);
        }

Dimiter Madjarov
Telerik team
 answered on 26 Mar 2013
3 answers
164 views
Is there way of using new Router functionality to use it with pager of grid?
I would like to change URL when user changes the page and also change grid page when ULR changes so the button back and links to page works as expected.

Thank you for reply.
Petur Subev
Telerik team
 answered on 26 Mar 2013
3 answers
164 views
I have some tooltips working, but when targets are loaded via ajax they no longer work.
How can I re-attach events after ajax load?

Thanks
Rosen
Telerik team
 answered on 26 Mar 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?