Telerik Forums
UI for ASP.NET MVC Forum
1 answer
371 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
360 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
70 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
79 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
313 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
135 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
143 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
0 answers
100 views
If you have just updated your project to version 2013.1.319 which is the official Q1 of 2013 and the widgets are no longer localized then you need to replace the satellite assemblies with new ones.
The actual reason is the satellite assemblies inside the folder which contains the main Kendo DLL that you refer :

C:\Program Files (x86)\Telerik\Kendo UI for ASP.NET MVC Q1 2013\wrappers\aspnetmvc\Binaries\Mvc3
are generated with different version and they need to be replaced with new ones that are the same version as the main Kendo.Mvc.dll.

The resolutions:
  • Update to the latest internal build  kendoui.complete.2013.1.325.commercial (if  you have the Visual Studio Extension installed then a notification about an available update should have popped)
  • Create your own build like explained here 
  • Copy/replace the DLLs manually inside the folder mentioned above with the ones attached to this thread.
Kendo UI
Top achievements
Rank 1
 asked on 26 Mar 2013
1 answer
430 views
How do you apply filters (via javascript) and specify that it should be OR logic.

forexample.  I have a grid with baseball players and a dropdown that contains values to filter by.  There are some vanity names for logical groupings.  Batters, Pitchers, etc.  There are only 4 types of pitchers so it would be easier to issue position=='P' or position='PS' or position='SP' or position='RP'

j
Dimiter Madjarov
Telerik team
 answered on 25 Mar 2013
1 answer
106 views
Hello,
i noticed in the grid,when i have multiple pages,for example if i put pagesize(5) the it remains some space until the bottom of the grid.If i put 10,then i have use the scroll in the alocated dimension for the grid.Is there a height of the grid,especially the detail zone,where are the rows?or how can i adjust to perfectly match the detail's height of the grid,with the number of rows?

Regards,
Daniel
Dimo
Telerik team
 answered on 25 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?