Telerik Forums
UI for ASP.NET MVC Forum
3 answers
501 views
The below Url's requests work and return data.

http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+eq+11)
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+gt+11)
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+lt+11)

The below Url requests do not work and return an exception. This is Greater than or Equal to, Less that or Equal To and Not Equal to

http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+ge+11)
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+le+11)
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+ne+11)

I am using a kendo grid with server filtering turned on and the grid calls a data source which is a web API controller that accepts a custom Model binder (by implementing IModelBinder) and on that model binder, it does the below which fails. 

var filter = "(TransportProviderId eq 1 and PaymentRequestId ge 5)"
request.Filters = FilterDescriptorFactory.Create(string.Join("~", filter.Split(' ')));


{"Message":"An error has occurred.","ExceptionMessage":"Expected RightParenthesis","ExceptionType":"Kendo.Mvc.Infrastructure.Implementation.FilterParserException","StackTrace":" at Kendo.Mvc.Infrastructure.Implementation.FilterParser.Expect(FilterTokenType tokenType)\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.ParseNestedExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.PrimaryExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.ComparisonExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.AndExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.OrExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.Expression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.Parse()\r\n<br>at Kendo.Mvc.Infrastructure.FilterDescriptorFactory.Create(String input)\r\n at RequestModelBinder.BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
Petur Subev
Telerik team
 answered on 27 Mar 2015
1 answer
191 views
I am looking at the new filtering feature of the grid - Multi Checkboxes (http://demos.telerik.com/aspnet-mvc/grid/filter-multi-checkboxes)

I can't work out how I can dynamically change the filter list based on the contents of the grid.

I currently have a drop down list in the toolbar of the grid, that users can select various pre-defined filtered datasets. I'd like the checkbox list in the filter menu to only display the available values in the grid. I don't mind doing this via an AJAX call and manually populating the data but I can't work out to get a reference to the filter menu. (I will have multiple filter menus on the grid)

Any pointers?

Thanks
Petur Subev
Telerik team
 answered on 27 Mar 2015
2 answers
81 views
Hi,

Since we've updated to the 2015 Q1 update a number of our DropDownLists have stopped selecting the top item on page load.  This is the issue we're having, seems to be consistent with the following criteria:

-DropDownListFor a default int property (so value is 0 by default)
-DataSource is a small collection contained in the ViewBag with no item of ID 0

eg
@(Html.Kendo().DropDownListFor(x => x.ClientID)
                            .DataTextField("name")
                            .DataValueField("id")
                            .BindTo((System.Collections.IEnumerable)ViewBag.Clients)
                        )

These were working before the update, and just defaulting to an index of 1, but even trying to set the SelectedIndex property fails to alleviate the problem.   Any advice you might have would be much appreciated.

Thanks,
Kevin











Georgi Krustev
Telerik team
 answered on 27 Mar 2015
4 answers
1.6K+ views
Hello,
I have a context menu displayed on right clicking kendo grid like this.
@(Html.Kendo().ContextMenu()
        .Name("menuGrid")
        .Target("#Grid_ObjActivity")
        .Orientation(ContextMenuOrientation.Vertical)
        .Animation(animation =>
        {
            animation.Open(open =>
            {
                open.Fade(FadeDirection.In);
                open.Duration(500);
            });
        })
        .Items(items =>
        {

            items.Add()
               .Text("Herunterladen")
               .ImageUrl(Url.Content("~/Images/Download.png"));
            items.Add()
              .Text("Löschen")
              .ImageUrl(Url.Content("~/Images/Delete.png"));

        })
        .Events(e => e.Select("ContextClick"))

    )

This is ok but i would like to have the items added dynamically depending on type of row clicked on grid. Each row in grid has a different type and right clicking show a different context menu with different action.

How can i achieve this in my razor view.

Thanks

Anamika
Daniel
Telerik team
 answered on 27 Mar 2015
1 answer
368 views
Hello,

I have a grid that I'm grouping by the Value of a KeyValuePair property in my Model. I'm able to access the GroupedBy value (using "#= value#") in the ClientGroupHeaderTemplate, but I also need access to the Key (represented in the code below as "#= key#". Is it possible to do this?

@(grid.Name(Model.GridId)
.HtmlAttributes(new { @class = "kendo-grid", data_get_url = Url.Action("GetStaticPermissions", "PermissionSetRecord", new { permissionSetId = Model.PermissionSetId }) }) 
.DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action(Model.ReadAction, "PermissionSetRecord", new { category = Model.Category, permissionSetId = Model.PermissionSetId }))
        .Group(groups => groups.Add(permission => permission.PermissionGroupInfo.Value)))
    .Columns(columns =>
    {
        columns.Bound(d => d.PermissionGroupInfo.Value)
            .Hidden(true)
            .ClientTemplate("")
            .ClientGroupHeaderTemplate(GetTemplateTitle().ToHtmlString());
        columns.Bound(d => d.DisplayName)
            .Title(Saturn.Resources.Admin.Security.Permission);
        columns.Template(@<text></text>)
            .Title(Saturn.Resources.Admin.Security.AllowQuestion)
            .Width(100)
            .ClientTemplate(Html.Partial("Permissions/_Toggle", Model).ToHtmlString());
    }))

@helper GetTemplateTitle()
{
    <span>
          #= value# 
         
         
// I want access to the key of my property here
          #= key#
    </span>    
}

Thanks.








Petur Subev
Telerik team
 answered on 27 Mar 2015
1 answer
113 views
Latest version comes with many bugs in this widget:
1. Error on delete item using remove icon:
Scenario : Select 1 item from list then typing name and select another item, now delete previous item with click on remove icon
2. Duplicate on delete item using backspace key
Scenario : Select 1 item from list then typing name and select another item, now perform delete item using backspace keyboard
3. Select values contains empty string for previous item
Scenario : Select 1 item from list then typing name and select another item, now select it using js in developer console see its value

you can see my test video on attachment..
Any workaround for this? 
Georgi Krustev
Telerik team
 answered on 26 Mar 2015
2 answers
167 views
Hi,

I have a requirement of kendo editable Grid  where Simply I click on each cell and it goes to editable mode and once I came out of text box it should commit the change. So its actual In Cell edit but no batch updates required. It will be In Cell editing and once you loos focus of the cell changes needs to be committed.
(Dont want to Use toolbar as its not batch update.)
Can you please provide some example ASAP?

Thanks,
Aarti
Aarti
Top achievements
Rank 1
 answered on 26 Mar 2015
3 answers
173 views
Hello

I have a grid containing product registrations, fetched from a table(registration) in a DB. One of the columns in the registration table is for countryName, country is stored as a FK countryID (int) in the registration table. But in the grid i'm showing the corresponding countryname. I have a popup editor for rows in the grid with a dropdowlist for chosing country, this dropdownlist fetches data from the country table with id as datavaluefield and name as datatextfield. 

The code for the country column in the grid:
columns.Bound(c => c.countryName).Width(120).Locked(true);

The code for the dropdownlist:
@(Html.Kendo().DropDownListFor(model => model.countryId)
              .HtmlAttributes(new { style = "width: 183px", required = "required" })
              .DataTextField("name")
              .DataValueField("id")
              .OptionLabel("Select country...")
              .DataSource(source =>
              {
                  source.Read(read =>
                  {
                      read.Action("GetCountries", "Home");
                  });
              })
            )

As you can see the column in the grid is mapped to countryName and the dropdownlist is mapped to countryId. This means changes made in the dropdownlist doesn't get updated in the grid. How can I update the countryName cell in the grid with the selectedTextvalue from the dropdownlist?

/Jonas
Boyan Dimitrov
Telerik team
 answered on 26 Mar 2015
1 answer
118 views
Hi Telerik,

I am currently working with the trial version of UI for ASP.NET MVC and noticed that at this link no source code can be found. Could you please update it or, at least, provide some code samples in this thread as I really prefer/expect to use Html Helpers for input fields with an icon either left or right rather than straightforward Html which is superfluous in my case, that is:

@(Html.Kendo().TextBoxFor(m => m.Property).Icon("some css class or whatever").Left())

I am looking forward to hearing from you soon. Thanks in advance!

Kind regards,
Mor
Dimo
Telerik team
 answered on 26 Mar 2015
1 answer
77 views
Is there a way to define your own EndCap Definition. There are now three type 'none', 'FilledCircle' and 'ArrowEnd'. I'd like to have my own rectangular end.
Daniel
Telerik team
 answered on 26 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?