Telerik Forums
UI for ASP.NET MVC Forum
1 answer
146 views

Hi,

because my dropdown has over 1.000 possible values I've implemented ServersSide filtering

according to this example.

https://demos.telerik.com/aspnet-mvc/dropdownlist/serverfiltering

the only issue is that with a 1000 records servers side filtering still is slow when expanding the dropdownlist. because it the text is empty, all data is retrieved.

To avoid this issue I only select top 100 ".Take(100)" and the performance is way better.

the only issue is, when I open the dropdown for the 2nd time the selected item gets reset to the default one, if the selected item is not in the first 100 records.
In my oppinion, the current selected item should stay.

so My question, is there a way to make the current value stay,
or can I send the current selected value as a parameter?
for the edit Form, I already use the current value, so at least that one is always in the selection

read.Action("FilteredDDL", "some Controller", new { selectedValue = @Model.selectedvalue });

but this only helps if the value is already in the model.

 

Does someone know a good solution?

sjarl
Top achievements
Rank 1
 answered on 09 Mar 2018
2 answers
326 views
     My company just purchased the licenses for Telerik UI for ASP.NET MVC and I am trying to convert and our current project into a Telerik project, but I dont see the option to convert.  I only see the create new Telerik project option.  I have looked all over the website and the documentation site, but I dont see anything regarding this issue.  Am I missing something or is the option not there to convert an MVC 4 web app?
Justin
Top achievements
Rank 1
 answered on 09 Mar 2018
1 answer
562 views

Hi, i'm working with Telerik MVC controls (not Kendo controls) as this is an old application and it's been very difficult trying to get any documentation for it as everythings for Kendo now.

 

I'm trying to get partial views working with this window and using the .refresh() accompanied with the .open() method but i can't get the correct behaviour for this to work.

The URL has been set to one of the methods in the controller and it's not being hit at all and the window is just rendering blank with no items inside it.

 

Initially this screen was made dynamically using jquery as an iframe - which is why i've updated it to use a static Telerik window (not iframe) and using the .refresh() method but to no avail.

 

The window looks like the below:

 

01.@(Html.Telerik().Window()
02.    .Name("detailWindow")
03.    .Title("Edit Window")
04.    .Modal(true)
05.    .Draggable(true)
06.    .Width(200)
07.    .Height(100)
08.    .Visible(false)
09.)

 

And the jquery to perform the refresh looks as follows:

01.    var abc= $("#detailWindow").data("tWindow");
02.    abc.refresh({
03.        url: url, ==> this is a valid URL but controller isn't being hit
04.        title: "wat",
05.        data: {
06.            id: 1,
07.            id2: 2
08.        },
09.    });
10.     abc.center().open();

 

 

Is there some file that i'm missing or an issue with the above code?

 

 

Thanks

Nencho
Telerik team
 answered on 08 Mar 2018
4 answers
1.1K+ views

I have defined external template and trying to use it in kendo as mentioned here

Howevere when page rendered i get error in kendo.all.min.js "0x800a138f - JavaScript runtime error: Unable to get property 'replace' of undefined or null reference". not sure what im doing wrong. 

Also i'm passing ID's to javascript functions, i had to use single quote around ID's so cshtml wont show error, is that correct?

<div>
    @(Html.Kendo().Grid<Detail>()
    .Name("assetImportDetail")
    .Columns(col =>
    {
        col.Bound(p => p.Cost);
        col.Bound(p => p.Status);
        col.Bound(p => p.FileName);
        col.Bound(p => p.FileID).ClientTemplate("#=myTemplate(data)#").Title("Action");
    })
    .AutoBind(true)
    .Pageable()
    .Sortable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read
            .Action("GetDetails", "MyDetail", new { ID = Model.ID })))
    )
</div>

 

<script>   
    var myTemplate = kendo.template($('#actionTemplate').html());
</script>
 
 
 
<script id="actionTemplate" type="text/x-kendo-template">
    # if (Status == "Error") { #
    <button class="resolve-button" onclick="Download('#= ID1#','#= ID2#');">Resolve</button>
    # } else if (Status == "Ready") { #
    <button class="approve-button" onclick="Approve('#= lID1 #');">Approve</button>
    # } else if (Status == "Imported") { #
    <button class="remove-button" onclick="Remove('#= ID1 #','#= ID2#');">Remove</button>
    #}#
</script>

Stefan
Telerik team
 answered on 08 Mar 2018
3 answers
365 views

I am trying to use the Grid / Checkbox selection feature in nested grids, inside client detail templates.

I am in face of a disturbing issue because the "select all" operation (by using the checkbox in the header) is always done in the first row having details.

 

To be clearer, suppose having a master grid with only 2 rows. Each row has a detail template containing a nested grid. Expand the 2 detail templates and try to select all the rows of the 2nd nested grid => That selects all the rows of the 1st one.

 

Have you an idea to help me ?

Thank you in advance.

 

Hereafter my shortened code of  the view (the full version is attached):

@(Html.Kendo().Grid<SellerViewModel>()

      .Name("SellersGrid")
      .Columns(columns =>
      {
          columns.Bound(p => p.SellerId).Hidden();
          columns.Bound(p => p.IsSelected);
          columns.Bound(e => e.Name);
          columns.Bound(e => e.IsActive);
      })
      .Events(e =>
      {
          e.DataBound("onHostSellersDataBound");
      })
      .Filterable()
      .Pageable(pager => pager.ButtonCount(3))
      .Editable(editable => editable.Mode(GridEditMode.InCell))
      .Sortable(sortable => sortable
          .AllowUnsort(true)
          .SortMode(GridSortMode.MultipleColumn))
      .ClientDetailTemplateId("marketplaces_template")
      .DataSource(dataSource => dataSource
          .Ajax()
          .Read(read => read.Action("GetHostSellers", "CompetitorGroup", new { competitorGroupId = Model.CompetitorGroupId }))
          .Sort(sort => sort.Add("IsSelected").Descending())
          .PageSize(25)
          .Model(model =>
          {
              model.Id(p => p.UniqueId);
              model.Field(p => p.SellerId).Editable(false);
              model.Field(p => p.IsSelected).Editable(true);
              model.Field(p => p.Name).Editable(false);
              model.Field(p => p.IsActive).Editable(false);
          })
          .ServerOperation(false))
)

<script id="marketplaces_template" type="text/kendo-tmpl">
    @(Html.Kendo().TabStrip()
          .Name("MarketplacesTabStrip_#=SellerId#")
          .SelectedIndex(0)
          .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
          .Items(items =>
          {
              items.Add().Text("Marketplaces")
                  .Content(@<text>
                        @(Html.Kendo().Grid<SellerViewModel>()
                              .Name("MarketplacesGrid_#=SellerId#")
                              .HtmlAttributes(new {style = "height: 543px;"})
                              .Columns(columns =>
                              {
                                  columns.Select().Width(50);
                                  columns.Bound(p => p.SellerId).Hidden();
                                  columns.Bound(p => p.HostSellerId).Hidden();
                                  columns.Bound(p => p.IsSelected).Title("Inclus");
                                  columns.Bound(e => e.Name);
                                  columns.Bound(e => e.IsActive);
                              })
                              .Events(e =>
                              {
                                  e.DataBound("onMarketplacesDataBound");
                              })
                              .Filterable()
                              .Editable(editable => editable.Mode(GridEditMode.InCell))
                              .Scrollable(scrollable => scrollable.Virtual(true))
                              .Sortable(sortable => sortable
                                  .AllowUnsort(true)
                                  .SortMode(GridSortMode.SingleColumn))
                              .PersistSelection()
                              .Pageable(pager =>
                              {
                                  pager.ButtonCount(3);
                                  pager.Messages(msg => msg.Display("Marketplaces {0} à {1} - sur {2}"));
                              })
                              .DataSource(dataSource => dataSource
                                  .Ajax()
                                  .PageSize(500)
                                  .ServerOperation(false)
                                  .Read(read => read.Action("GetMarketplaces", "CompetitorGroup", new {competitorGroupId = Model.CompetitorGroupId, hostSellerId = "#=SellerId#"}))
                                  .Sort(sort => sort.Add("IsSelected").Descending())
                                  .Model(model =>
                                  {
                                      model.Id(p => p.UniqueId);
                                      model.Field(p => p.SellerId).Editable(false);
                                      model.Field(p => p.HostSellerId).Editable(false);
                                      model.Field(p => p.IsSelected).Editable(true);
                                      model.Field(p => p.Name).Editable(false);
                                      model.Field(p => p.IsActive).Editable(false);
                                  })
                              )
                              .ToClientTemplate())
                    </text>);

          })
          .ToClientTemplate())
</script>

Preslav
Telerik team
 answered on 08 Mar 2018
1 answer
305 views

I have two questions regarding using the Grid with touchscreen devices such as an iPad. I see that I can press and drag to select multiple consecutive rows of the Grid, but how can I select multiple, non-consecutive rows (i.e. the equivalent of holding Control + clicking rows)? 

Second, if a grid is taking up a large portion of the view port and I want to scroll down the page, when I drag my finger, it wants to do the multi-selection of grid rows instead of scrolling. I tried dragging two fingers instead but that didn't work. Is there a way to scroll down the page when the grid must be touched on to begin scrolling?

Stefan
Telerik team
 answered on 08 Mar 2018
1 answer
385 views

HI

I have found that the HtmlAttributes() settings of ResponsivePanel are lost unexpectedly (not keeped) : 

  @(Html.Kendo().ResponsivePanel()
    ...
    .HtmlAttributes(new { @class = "my-class1", @my_attr1 = "my-attr1" }))

ResponsivePanel is not allow to set custom html attributes (css classes, element attributes) ? 
Is this problem will fixed in future release ?

Best regards

Chris

 

 

 

Dimitar
Telerik team
 answered on 07 Mar 2018
1 answer
155 views

HI

In Desktop environment, User can resize the window of the browser,

But I found that the Close event not fired while user maximize the window (ex. 1024 x 768) : 

Reintroduce steps : 
1.minimize the browser window (ex. width: 400px or smaller, height: any) then the ResponsivePanel's ToggleButton appears;
2.maximize the browser window (ex. 1024 x 768), the Close event not fired.

How can I detect the Close event while user maximize the browser window ? 
Is the functionality will be fixed in the future release ? 

*click the ToggleButton will fire the Close event normally.

Best regards

Chris

 

 

 

Ivan Danchev
Telerik team
 answered on 07 Mar 2018
9 answers
1.1K+ views
Hi All,


I have created partial view which contain multiple dropdown list and I am rendering this partial view on different Window. 

When I opened this partial view on "xyz" window it will work as expected, but when I opened same partial view on another window (abc) all dropdownlist converted into textbox control.

Any thoughts?

Thanks-
Atul K
Dimo
Telerik team
 answered on 07 Mar 2018
1 answer
151 views

I'm trying to write a custom filter function because the field I want to filter on is an object, rather than a primitive value, and the filter value I'm using is a primitive that I'm comparing to a field on the object (based on a selection in a DropDownList). Here's the code I'm using:

ds.filter({
                field: "Platform",
                operator: function (item, filterValue) {
                    return item.DisplayName == filterValue;
                },
                value: e.sender.dataItem(e.sender.select()).Platform.DisplayName
            });

 

However, the "item" argument is *not* an individual item from the datasource that needs to be filtered - it's an array/collection of some sort. What's the correct way to write this function so that I can correctly filter the datasource?

Harper
Top achievements
Rank 1
 answered on 06 Mar 2018
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
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?