Telerik Forums
UI for ASP.NET MVC Forum
7 answers
2.5K+ views

So I have a dropdown list that initially populates with 10 values (the most common values for race) However, when the user starts typing, it searches the entire list of values(around 900) for a match.  I didn't want load 900 values into a dropdown list so it uses server filtering and goes back to the server and searches for a match.  I can select  a race and this populates the dropdown list appropriately.  However, if i reselect the dropdownlist, it loses the value, and only shows the initial 10.  Is there a way where i can set the filter for the dropdown list to populate on click, so it will go to the server and bring back the match so it'll show that in the list and not lose its value?

@(Html.Kendo().DropDownListFor(m => m.Race.Id)
.OptionLabel("--Select--")
 .DataTextField("Description")
.Value(Model.Race.Id.ToString())
.Text(Model.Race.Description)
.DataValueField("Id")
.HtmlAttributes(new { style = "width: 100%;", tabindex = "31" })
.Filter("contains")
.DataSource(source =>
{
    source.Read(read =>
  {
     read.Action("GetRaceValueSet", "Person");
 
  }).ServerFiltering(true);
 })
 .AutoBind(false))
Veselin Tsvetanov
Telerik team
 answered on 01 Jul 2016
1 answer
123 views
I'm wondering if there is some way to have the grid look different than it normally does.
Right now, it presents all the data in a single row.
What I would like is to split up the row, so that even though it is still one row, the data is laid out in 2 (or more) rows within that row.
The attached image shows what I mean, since the description is kind of confusing.

TIA,
Bob Mathis
Danail Vasilev
Telerik team
 answered on 01 Jul 2016
1 answer
164 views

Hi there,

I have encountered this problem and can not fix the filter for these two columns. 

If I use filter for these two columns: EnrolledNumber and WaitListNumber, I will get

Internet Server Error

Invalid Property or Field - 'EnrolledNumber' for type: Class

If I disabled both sortable and filter for these two columns, everything else will work fine.

How can I make the filter work and at the same time the program will not lag or become ridiculously slow?

 

The following is my code.

 

Model

EnrolledNumber = model.ClientClasses.Where(i => i.IsActive == true).Count();
WaitListNumber = model.ClientClasses.Where(i => i.IsActive == false).Count();

[Display(Name = "Enrolled")]
public int EnrolledNumber { get; set; }
[Display(Name = "WaitList")]
public int WaitListNumber { get; set; }

View

columns.Bound(i => i.EnrolledNumber).Width(90).Title("Enrolled");
columns.Bound(i => i.WaitListNumber).Width(90).Title("WaitList");

Controller

public ActionResult Read_Classes([DataSourceRequest] DataSourceRequest request, bool isCurrent, bool isPending, bool isFinished)
{
    IQueryable<Class> items = DbContext.Classes.Where(i => i.IsActive);
    if (!isPending)
        items = items.Where(i => !i.Pending);
    if (!isFinished)
        items = items.Where(i => !i.Finished);
    if (!isCurrent)
        items = items.Where(i => i.Finished || i.Pending);
    return Json(items.ToDataSourceResult(request, i => new ClassListViewModel(i)));
}

I also get

An exception of type 'System.ArgumentException' occurred in Kendo.Mvc.dll but was not handled in user code

in Visual Studio for first time

 

Thank you

Danail Vasilev
Telerik team
 answered on 30 Jun 2016
1 answer
197 views
I've dug through every readily available example (that I can find) of the UI for MVC Diagram, and can't find any way to show or display the "Text" attribute of a Connection. I'm seeing that the "Text" member is correctly being passed from controller to view (and is editable to boot), but don't see any way to display it on the view. Is this at all possible with the Diagram control for MVC?
Bozhidar
Telerik team
 answered on 30 Jun 2016
3 answers
304 views

The RTM for ASP.NET Core is out.

 

There seem to be issues with the integration when calling the following method in the ConfigureServices method of the Startup class

 

services.AddKendo()

 

System.TypeLoadException
Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

Marin Bratanov
Telerik team
 answered on 30 Jun 2016
1 answer
122 views

Hi,

I've a problem with filtering and sorting my grid. The Grid does not sort and filter my ViewModel-Properties.

View:

@(Html.Kendo().Grid<DepositModel>()
   .Name("gridClosedDeposits")
   .Columns(col =>
   {
     col.Bound(p => p.Id)
        .Title(Resources.Resource.ID);
     col.Bound(p => p.DateTime)
        .Format("{0:dd.MM.yyyy hh:mm}")
        .Title(Resources.Resource.Date);
     col.Bound(p => p.User_Id)
        .Title(Resources.Resource.CustomerId);
     col.Bound(p => p.User.FirstName)
        .Title(Resources.Resource.FirstName);
     col.Bound(p => p.User.LastName)
   })
   .Filterable()
   .Sortable()
   .Groupable()
   .Resizable(r =>
     r.Columns(true)
   )
   .Pageable(pageable => pageable
      .Refresh(true)
      .PageSizes(true)
      .ButtonCount(5))
   .DataSource(dataSource => dataSource
      .Ajax()
      .Sort(sort => sort.Add("DateTime").Descending())
   .Read(read => read.Action("GetClosedDeposits", "Grid"))
   .PageSize(10)
)

GetClosedDeposits-Function:

public ActionResult GetOpenDeposits([DataSourceRequest]DataSourceRequest request)
{
   using (var dbContext = new dbEntities())
   {
      IQueryable<Deposit> deposits =
         dbContext
            .Deposit
               .Where(w =>
                  w.CanceledSmallDateTime == null &&
                  w.AccomplishedSmallDateTime == null);
 
      DataSourceResult result = deposits.ToDataSourceResult(request,
         s => new DepositModel
              {
                 DateTime = s.DateTime,
                 Id = s.Id,
                 User_Id = s.User_Id,
                 User = new UserModel
                 {
                    Id = s.User1.Id,
                    FirstName = s.User1.FirstName.Split(' ')[0],
                    LastName = s.User1.LastName,
                    UserName = s.User1.UserName
                  }
               }
      );
 
      return Json(result);
   }
}

Henning
Top achievements
Rank 1
 answered on 30 Jun 2016
2 answers
254 views

With the release version of Core, I am now getting this error on Kendo Grid Read Action.

TypeLoadException: Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

Here is the top part of the Stack Trace:

System.TypeLoadException: Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
   at Kendo.Mvc.UrlGenerator.GetUrlHelper(ActionContext context)
   at Kendo.Mvc.UrlGenerator.Generate(ActionContext context, INavigatable navigationItem, RouteValueDictionary routeValues)
   at Kendo.Mvc.UrlGenerator.Generate(ActionContext context, INavigatable navigationItem)
   at Kendo.Mvc.UI.NavigatableExtensions.GenerateUrl(INavigatable navigatable, ViewContext viewContext, IUrlGenerator urlGenerator)
   at Kendo.Mvc.UI.Fluent.CrudOperationBuilderBase`1.SetUrl()
   at Kendo.Mvc.UI.Fluent.CrudOperationBuilderBase`1.Action(String actionName, String controllerName, Object routeValues)
   at Kendo.Mvc.UI.Fluent.CrudOperationBuilderBase`1.Action(String actionName, String controllerName)
   at AspNetCore._Views_Organisations_Details_cshtml.<>c.<ExecuteAsync>b__27_3(CrudOperationBuilder read) in /Views/Organisations/Details.cshtml:line 61

Marin Bratanov
Telerik team
 answered on 30 Jun 2016
1 answer
225 views

I use UI for ASP.NET MVC Q2 2016.

I cannot figure out how to localize the edit and destroy button in the column command of my grid.

My app is using asp.net core rc2

I have include the localization feature using resource.

The default culture is en-US as stated in startup.cs

    options.DefaultRequestCulture = new RequestCulture(culture: "en-US", uiCulture: "en-US");

In the Model I manage the localization with resources file "...en-US.resx"

    public class TA_ACCESSORY_ACC
    {

    [MaxLength(ApplicationDbOperation.DM_SHORTTEXT, ErrorMessage = "idsMaxError")]
    [Display(ResourceType = typeof(ApplicationResources),Name = "idsName")]
    public string NAME_ACC { get; set; }

   }

The column of the grid are well translated from french to English but the button command still remain in french.

Any help will be very appreciated.

 

Michel
Top achievements
Rank 1
 answered on 29 Jun 2016
2 answers
493 views

Is there an easy way to use the toolbar.Create() and toolbar.Save() builders in the toolbar template.

I want to add a dropdown for filtering while maintaining the default buttons.

I see no way to get toolbar.Create() to send me it's rendered text to add to the template??

Basically I want to duplicate something like this demo http://demos.telerik.com/kendo-ui/grid/toolbar-template but still have the standard add/save buttons in the toolbar as well.

 

 

 

Bob
Top achievements
Rank 1
 answered on 29 Jun 2016
3 answers
488 views

Hi,

I am new to Kendo and are trying to add a custom command to a grid.
I have been going over examples and this forum and found multiple examples that has the following:

columns.Command(command =>
{
     command.Custom("Details").Text("Show Details").Action("Details", "Billing");
});

 

When I try to use this, I get the following error:
'GridCustomActionCommandBuilder<myModel>' does not contain a definition for 'Action' and the best extension method overload 'UrlHelperExtensions.Action(IUrlHelper, string, object)' requires a receiver of type 'IUrlHelper'

 

I then tried this example from http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/configuration:

columns.Template(@<text>@Html.ActionLink("Edit", "Home", new { id = item.ProductID })</text>);

But get this error:
Cannot convert lambda expression to type 'string' because it is not a delegate type

 

Please can someone please help me with this.

I am using existing samples but don't know what is wrong.

Thank you

Eyup
Telerik team
 answered on 29 Jun 2016
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?