Telerik Forums
UI for ASP.NET MVC Forum
1 answer
1.0K+ views

We have AutoComplete working in MVC with this in the view:

@(Html.Kendo().AutoComplete()
.Name("ContentTagsAddt")
.DataTextField("TagName")
.HtmlAttributes(new { style = "width:700px" })
.Placeholder("Begin Typeing Additional Tags...")
.MinLength(3)
.Filter("startswith")
.Separator(", ")
.Value(Model.AdditionalContentTags)
.DataSource(source => source
    .Custom()
    .Group(g => g.Add("TagGroup", typeof(string)))
    .Type("aspnetmvc-ajax")
    .ServerFiltering(true)
    .ServerPaging(true)
    .PageSize(20)
    .Transport(transport => transport
        .Read("GetContentTag", "Article")
    )
    .Schema(schema =>
    {
        schema.Data("Data")
            .Total("Total");
    })
)
)

And it's datasource looks like:

public JsonResult GetContentTag([DataSourceRequest] DataSourceRequest request)
{
    var tags = oandpService.GetContentTags();
 
    return Json(tags.ToDataSourceResult(request));
}

The table it's using to populate is pretty small (37 rows). We'd really like to have the ability to show all items on focus. Would that be possible? An added bonus is if the AutoComplete stays open the entire time and as the person types it highlights the suggestions.

Veselin Tsvetanov
Telerik team
 answered on 05 Oct 2016
1 answer
406 views

I'm trying to bind a MultiSelect to a list of strings. How do I write an data-binding expression for DataTextField and DataValueField?

@model List<string>

@Html.Kendo().MultiSelect().BindTo(Model).DataTextField("?").DataValueField("?")

Nikita
Top achievements
Rank 2
Iron
Iron
 answered on 03 Oct 2016
1 answer
281 views

I have a Spreadsheet which already Bind to an object (see below code). I want to open a file (import) and Bind it with my existing binding.

@(Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheetsbar(false)
.Toolbar(x => x.Data(false).Insert(false))
.HtmlAttributes(new { style = "width:100%;" })
.Rows(5000)
.Events(e => e.ExcelImport("ImportProduct"))
.Sheets(sheets =>
{
sheets.Add()
.Name("Product")
.DataSource<MyCompany.DTO.Logistics.Planning.ProductSearchResultDTO>(ds => ds
.Ajax()
.Batch(true)
.Read(r => r.Action("ProductBulkSearchResults", "Logistics").Data("getCriteria"))
.Update(u => u.Action("ProductBulkUpdate", "Logistics").Data("getCriteria"))
.Events(e => e.Change("onChange"))
.Model(m =>
{
m.Id(p => new { p.ProductID, p.ORGID });
})
)
.Columns(columns =>
{
columns.Add().Width(100);
columns.Add().Width(415);
columns.Add().Width(0);
columns.Add().Width(0);
columns.Add().Width(145);
})
;
})
)

Ivan Danchev
Telerik team
 answered on 03 Oct 2016
3 answers
410 views

I am using a Grid having a date picker in one of the column, when the date picker is displayed in the edit mode, the date is in "dd/MM/YYYY" format so when i select a date in it displays in "dd/MM/YYYY" format but when i update with a date say 29/09/2016 i get invalid date validation error from the control, and if i change it to say 09/209/2016 it works, so the validation it does is for "MM/dd/YYYY" format.  I have not added any custom validation for this, is there there any place that i need to handle this that i am doing it wrong?

 

columns.Bound(p => p.MyDate).Title("Date").EditorTemplateName("Date").Format("{0:dddd dd MMMM yyyy}").Filterable(false).Width(160);
Viktor Tachev
Telerik team
 answered on 03 Oct 2016
7 answers
376 views

Hello,

I have the next problem.I have a grid that has some columns. One of them is called 'ConfirmedValue'. I know that you use '#' to access a parent grid column in a column's clienttemplate in its subgrid-childgrid (detail template). In a clienttemplate in that subgrid I try to format that column value using:

columns.Template(e => { }).ClientTemplate("# if(ConfirmedValue) { # #= kendo.toString(ConfirmedValue, 'c3') # # } #");

But it is not working. In my browsers dev tool console I get the error "Uncaught Error: Invalid template". I assume the sintax I use is OK. When I use it in my parent grid (main grid) it works well without any problems.

I am not sure if this is a bug or if kendo does not support this kind of behaviour. 

Can you please help me out? What did I do wrong?

Best regards,

 

 

 

 

 

Shoeb
Top achievements
Rank 1
 answered on 30 Sep 2016
1 answer
232 views
     When I'm implementing custom binding on the server side for a grid using and ajax data source, is there a way to only implement custom logic for grouping, but allow paging and sorting to be handled automatically the way they normally are when you call ToDataSourceResult on an IQueryable?
Viktor Tachev
Telerik team
 answered on 30 Sep 2016
2 answers
508 views
Is there a way to display the Telerik ASP.Net MediaPlayer control in an MVC page or any other ideas to play a sound clip (.mp3) or video clip?

Thanks
Eyup
Telerik team
 answered on 30 Sep 2016
3 answers
377 views

I am trying to create extension method for GridBoundColumnBuilder for setting aggregate cell for column and format it. The attempt is in following style (grid_ext_1.png).

My intent is to set dataSource.Aggregates for column to count sum of all items, and ClientFooterTemplate to perform formatting of aggregate cell.

Another intent is to reduce the whole code -  as I have already bound property of class to column (in the GridColumnFactory), I do not want to write another method for setting aggregate item (in the DataSourceAggregateDescriptorFactory). I have ~40 columns in one grid and it is really hurts to write method for every column 2 times.

In the case of the attached code I have an exception "Ambigous Match Found". Due to head of stack trace:

   in System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
   in System.Type.GetProperty(String name)
   in Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.<>c__DisplayClassc.<CreateProjectionMemberBindings>b__b(AggregateFunction f, Expression e)
   in Kendo.Mvc.Extensions.EnumerableExtensions.<ZipIterator>d__7`3.MoveNext()
   in System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   in System.Dynamic.Utils.CollectionExtensions.ToReadOnly[T](IEnumerable`1 enumerable)
   in System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable`1 bindings)
   in Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionInitExpression()
   in Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateAggregateFunctionsProjectionMemberBinding()
   in Kendo.Mvc.Infrastructure.Implementation.Expressions.QueryableAggregatesExpressionBuilder.<CreateMemberBindings>d__0.MoveNext()
   in System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   in System.Dynamic.Utils.CollectionExtensions.ToReadOnly[T](IEnumerable`1 enumerable)
   in System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable`1 bindings)
   in Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateSelectBodyExpression()
   in Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateSelectExpression()
   in Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilderBase.CreateQuery()
   in Kendo.Mvc.Extensions.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions)
   in Kendo.Mvc.Extensions.QueryableExtensions.CreateDataSourceResult[TModel,TResult](IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState, Func`2 selector)
   in Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState)
   in Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable enumerable, DataSourceRequest request)
   in Kendo.Mvc.UI.DataSource.Process(DataSourceRequest request, Boolean processData)
   in Kendo.Mvc.UI.Grid`1.ProcessDataSource()

it seems that aggregates builder fails to get a property of class. But if I had an duplicate property name - I would find it at compilation time.

So, I have no idea what Kendo finds ambiguous.

Can you point out what I'm doing wrong? How to write an extension method which will satisfy my objectives correctly?

Angel Petrov
Telerik team
 answered on 29 Sep 2016
4 answers
109 views

Hi,

When there is one diagram in the page like:

@(Html.Kendo().Diagram()
            .Name("diagram1")
            .Layout(l => l
                .Type(DiagramLayoutType.Tree)
                .Subtype(DiagramLayoutSubtype.Right)
                .HorizontalSeparation(30)
                .VerticalSeparation(20)
            )
            ...........
)
it renders correct (tree right).

But when there is another diagram:

@(Html.Kendo().Diagram()
            .Name("diagram2")
            )
            .Layout(l => l
                .Type(DiagramLayoutType.Tree)
                .Subtype(DiagramLayoutSubtype.Down)
                .HorizontalSeparation(30)
                .VerticalSeparation(20)
            )

first diagram renders also "tree down"...

So, what should I do?

 

Kaan
Top achievements
Rank 1
 answered on 29 Sep 2016
3 answers
380 views

Hi,

I have a view with a standalone datepicker (controller/index(DateTime? date))

@(Html.Kendo().DatePicker()
      .Name("datePicker")
      .Events(e => e.Change("change"))
      )

Now I want to have a change event to go to the same page (controller/index(date = result of the datepicker)

function change() {
//something
}

Eduardo Serra
Telerik team
 answered on 28 Sep 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
MultiColumnComboBox
Dialog
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?