Telerik Forums
UI for ASP.NET MVC Forum
3 answers
2.6K+ views

Hi,

I've almost over 200+ grids in my app. I am trying to add a external search area to search in all columns

 

$('.k-grid').each(function () {
            var $gridElement = $(this);
            var $grid = $gridElement.data('kendoGrid');

            var toolbar = $grid.table.prev('.k-grid-toolbar');
            if (toolbar.length > 0)
            {
                var searchContainer = $('<div style="width: 200px; float:right;"></div>').appendTo(toolbar);
                var searchBox = $('<input type="text" class="form-control"/>')
                    .appendTo(searchContainer)
                    .on('keyup', function () {
                        var val = $(this).val();

                        var filters = [];
                        $.each($grid.columns, function (i, item) {
                            if(item.field && item.field.length > 0)
                            {
                                filters.push({ field: item.field, operator: 'contains', value: val })
                            }
                        });
                        $grid.dataSource.filter({
                            logic: "or",
                            filters: filters
                        });
                    });
            }

....................

 

But I've two problems:

    1) It does filtering in server-side, I want to make it in client-side.

    2) Because I'm binding some columns with SelectLists, I cannot search amoung them. 

 

Do you have any suggestions?

Regards.

Danail Vasilev
Telerik team
 answered on 29 Nov 2016
5 answers
1.7K+ views

Hi,
I configured the Kendo MultiSelect for ajax binding, I send parameters to the server, All as described in
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/multiselect/overview#sending-parameters-to-the-server
Everything works fine except my call to the refresh method (http://docs.kendoui.com/api/web/multiselect).
The thing is that a new ajax request does not occur when I call refresh (is it by design? should I use another API?),
I need the List Of Values to be updated by a new Ajax call on change of another control.
The parameters I send to the server are

1. the text typed
2. a value of another control

Thanks in advanced,

Lauri

 

 

Georgi Krustev
Telerik team
 answered on 29 Nov 2016
8 answers
326 views

Reading the docs on the scaffolder (http://docs.telerik.com/kendo-ui/aspnet-mvc/scaffolding) shows the dialog appearing when Add | New Scaffolded Item is selected, which is fine.

Unfortunately when I pick Add | Controller I still get the Kendo UI Scaffolder dialog when all I want is a plain MVC controller.

How can I fix this behaviour?

Matt
Top achievements
Rank 1
 answered on 29 Nov 2016
1 answer
440 views

Dear,

We have tried to add autocomplete dynamically from partial view with Ajax.ActionLink, but they do not initialize, and not working.
We also managed to use different id-s on the inputs, but we standardize the name for achive out goal:

Dynamic load of partial view:
  @Html.Partial("_Teszt", Model)
        <div id="tobbSpecEszkoDiv">
        </div>
        @Ajax.ActionLink(
            "Új",
            "_Teszt",
            "Home",
            new AjaxOptions
            {
                UpdateTargetId = "tobbSpecEszkoDiv",
                InsertionMode = InsertionMode.InsertAfter,
                OnSuccess = "korteLo"
            })

<script language="javascript">
    function korteLo(e) {
        $("input[id^='countries']").attr('name', 'countries');;
    }
</script>

 

PartialView:

@using Kendo.Mvc.UI
@(Html.Kendo().AutoComplete()
          .Name("countries"+DateTime.Now.Millisecond)
          .Filter("startswith")
          .Placeholder("Select country...")
          .BindTo(new string[] {
                "Albania",
                "Andorra",
                "Armenia",
                "Austria",
                "Azerbaijan",
                "Belarus",
                "Belgium",
          })
          .Separator(", ")
      )

 

For further details we attached the project files.

 

Best regards.

Anton
Telerik team
 answered on 28 Nov 2016
4 answers
439 views

Hi,

I'm trying to implement a custom command on my grid, which is using server binding, but the button just leads to a 'resource not found' error. My routing looks as it should and I can't see anything else wrong. I should also say that the MVC stuff is actually implemented in an 'area'. All my code is below, could anyone help?

Routing

1.context.MapRoute(
2.   "ControlPanel_default",
3.   "ControlPanel/{controller}/{action}/{id}",
4.   new { action = "Index", id = UrlParameter.Optional }
5.);

Index.cshtml

01.@(Html.Kendo().Grid(Model)
02.    .Name("Grid")
03.    .Columns(col =>
04.    {
05.        col.Bound(p => p.CustomerId);
06.        col.Bound(p => p.aspNetUserID);
07.        col.Command(cmd =>
08.        {
09.            cmd.Edit();
10.            cmd.Custom("Test").Action("Lockout", "Index");
11.        });
12.    })
13.    .Editable(edt => edt.Mode(GridEditMode.PopUp))
14.    .Pageable()
15.    .Sortable()
16.    .Scrollable()
17.    .DataSource(ds => ds
18.    .Server()
19.    .Model(mdl => mdl.Id(p => p.CustomerId))
20.    .Read("Index","Index")
21.    .Update("Update","Index")
22.    .Create("Create","Index")
23.    .Destroy("Destroy","Index"))
24.    )

 

IndexController.cs

01.public class IndexController : Controller
02.{
03.   public ActionResult Index()
04.   {
05.      ViewBag.Title = "Home";
06.      return View(GetCustomers());
07.   }
08.   public ActionResult Lockout(int CustomerId)
09.   {
10.      if (ModelState.IsValid)
11.      {
12.         //var result = CustomerId;
13.         RouteValueDictionary routeValues = this.GridRouteValues();
14.         return RedirectToAction("Index", routeValues);
15.      }
16.      return View("Index");
17.   }
18.}
Steve
Top achievements
Rank 1
 answered on 28 Nov 2016
3 answers
708 views

Hi,

I'm using a AutoComplete in my form (Grid Popup Editor template) and all the Validation works except that on the AutoComplete...(see Picture)

here is the Code for the AutoCompleteFor:

<div class="form-group m-xs">
                    <label class="col-sm-2 control-label">Postleitzahl:</label>
                    <div class="col-sm-2">
                        @(Html.Kendo().AutoCompleteFor(m => m.Postleitzahl)
                            .DataTextField("Postleitzahl_ID")
                            .Filter(FilterType.StartsWith).MinLength(1)
                            .NoDataTemplate("Keine Postleitzahl gefunden")
                            .Suggest(true)
                            .Height(300)
                            
                            .DataSource(source =>
                            {
                                source.Read(read =>
                                {
                                    read.Action("Postleitzahl_Read", "Standorte")
                                        .Data("onAdditionalData");
                                })
                                    .ServerFiltering(true);
                            })
                            .Events(e => e
                                .Select("onPostleitzahlSelect")
                            ))
                        @Html.ValidationMessageFor(model => model.Postleitzahl)
                </div>

 

here the part of the model class:

[Required]
[StringLength(8)]
public string Postleitzahl { get; set; }
[Required]
[StringLength(65)]
public string Ort { get; set; }
[Required]
[StringLength(255)]
Peter Milchev
Telerik team
 answered on 25 Nov 2016
7 answers
283 views

Hi,

We allow users to change the the value in each cells. However, the user doesn't like to see the width changes from displaying text to a textbox mode. Is there any way we can stop it so we keep the same width for the displaying text and textbox?

 

thanks!

Eyup
Telerik team
 answered on 25 Nov 2016
5 answers
517 views

Hello,

After spending a couple of hours trying to figure out why my custom popup editor template was failing with this javascript error in the kendo.all.min.js file: "0x800a03f1 - JavaScript runtime error: Expected '}' "

it turned out to be an inline javascript comment that was causing the error.  I have a script tag at the top of my template with a couple of javascript functions and in them are some single-line comments using the '//' syntax.  When I remove those the popup editor works just fine and when I put them back in it throws the error. Why is this happening? Is this a known issue? Is it documented anywhere?

 

Thanks,

Mike

 

 

Kostadin
Telerik team
 answered on 25 Nov 2016
4 answers
693 views

I have a grid which looks good on until 1400 screen resolution but if i try to go less than that, i don't see right most columns. I don't want to use vertical scroll bar, so I have used this 

 

.Scrollable(s => s.Height("auto"))

 

But even this, slight changed my grid look. column width changed. I have attached some screen shots so that you can see the difference

Desenvolvimento
Top achievements
Rank 2
 answered on 24 Nov 2016
3 answers
123 views

Hi,

  • Where to find the new AutoWidth configuration Option?

robert

Nencho
Telerik team
 answered on 24 Nov 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
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?