Telerik Forums
UI for ASP.NET MVC Forum
4 answers
211 views
Hi.

I'm having a problem with the filter on a ForeignKey column.

The first time I select a status in the dropdown in the filter menu and click the "Filter" button,  nothing happens, but if I change the status and click filter again, it filters as it is supposed to.

Also if I select one status without clicking the "Filter" button, then selects a new status and then clicks the "Filter" button, it filters works.

Got any tip that can help me with this? I have updated to the lates build.

The code:

<div class="col-lg-12">
    @(Html.Kendo().Grid<Order>()
          .Name("orderGrid")
          .Columns(columns =>
          {
              columns.Bound(order => order.OrderNo).Title("Order no.");
              columns.ForeignKey(order => order.Status.Description, Model.StatusList, "Description", "Description").Title("Status");
          }
          )
          .Filterable(filter => filter.Enabled(true).Mode(GridFilterMode.Menu))
          .AutoBind(true)
          .DataSource(dataSource => dataSource
              .Ajax()
              .Read(read => read.Action("GetOrders", "OrderSurface"))
              )
          )
</div>
Wolfgang
Top achievements
Rank 1
 answered on 27 Mar 2015
3 answers
424 views
Hi, 
I have a model like below:

public class SysUnit : BaseModel
    {
        public string Name { get; set; }
        public string Prefix { get; set; }
 
        public SysUnitGroup SysUnitGroup { get; set; }
 
    }
public enum SysUnitGroup
    {
        Money,
        Length,
        Weigh,
    }


When i used scaffold template of Telerik, it is not generating dropdown for Enum at insert and edit actions. 

I searched and try lots of things to bind enum in Grid Editview.. Is there any tutorial ? 



Alexander Popov
Telerik team
 answered on 27 Mar 2015
3 answers
538 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
204 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
89 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.7K+ 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
384 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
131 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
184 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
192 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
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?