Telerik Forums
UI for ASP.NET MVC Forum
1 answer
263 views
Hi,

I have successfully implemented two multiselect list. List1 contains states and List2 contains counties. What I want to achieve is when I click on List2, it populate only with counties exist in selected states from List1.

Here is what I did;

1. Attached to open even on List2.
2. Wrote a JS function that cause datasource to update for List2 sending data. data is selected from List1.

    function open() {
        console.log("event: open");
        var values = {
            selectedStates: $("#stateMultiSelect").val()
        };

        var stateItem = $('#countyMultiSelect').data('kendoMultiSelect');
        stateItem.dataSource.read(values);
    };
The problem seems to be in model binding, I can see the request contains the data but at controller action it does not map to the model.

Controller Action:

        public JsonResult GetCounties(StateMultiSelectModel seletedStates)
        {
// seletedStates is alway null when breakpoint hits here.

            if (selectedStates == null)
            {
...
            }
...
}
Model
    public class StateMultiSelectModel
    {
        public List<string> SelectedStates { get; set; }
    }
Following is the request sent to controller.


Request URL:
http://localhost:61135/Dashboard/GetCounties?text=&SelectedStates%5B%5D=NC


In the same JS file I have chart controls that are getting updated on a button click using similar mechanism.
Please suggest changes. For your reference attached cshtml file that contain UI control code and JS.
Shailendra
Top achievements
Rank 1
 answered on 18 Feb 2014
2 answers
221 views
Hi,

I've been using Kendo UI with ASP.NET MVC and am very happy with it.
Still, I'm stuck with an issue:

I have an EditorTemplate which ouputs a Kendo UI DropDownList. As a best practice, I call .Deferred() on every widget I'm using to get all the JS initialization at the bottom of the page.
The issue I'm facing is that this EditorTemplate is used by the grid to build insert and edit popup forms, and in this case the .Deferred() does not work because the intialization script is executed before the grid actually builds the form.

What I'd like to achieve to avoid duplicating the EditorTemplates is to know, at runtime, whether the template is executed from a "normal" page or from a Kendo form builder.
I saw that you create your own HtmlHelper, passing along a GridViewDataContainer, but at runtime I'm always faced with the Html.ViewDataContainer being an instance of WebViewPage.

Do you know if there's a possibility of figuring this out so I can defer the JS scripts when appropriate?

Thanks in advance.
Mickaël Derriey
D.
Top achievements
Rank 1
 answered on 18 Feb 2014
2 answers
184 views
I am an experienced asp.net web forms developer, new to the Kendo UI.  I have a reasonable grasp on things, but sometimes feel I am I groping around in the dark!  :-)

So here is my issue...

I have a panel bar with eight root level items, each of these containing 1-5 child items.  All of these items, both parent and child contain both an image and text.  I have added a toggle button to my view that will grow or shrink the width of the panel bar, depending on the button state when clicked.  That much I was able to glean from various forum post.  What I need to know now is how to modify the root and/or child item text when growing (restore text) or shrinking (remove text) the panel bar.

Thanks in advance for any help you can give!

Barry

Barry Burton
Top achievements
Rank 1
 answered on 18 Feb 2014
11 answers
1.4K+ views
Hi,

We are observing the following issue related to the time differences between our MVC app and a Kendo DatePicker. The web server is running in UTC+0. The web clients are running in different time zones (UTC+1, UTC+3, UTC-5, etc.)

The web page contains a Kendo date picker (no time portion) where user selects a single day or a month. Behind the scenes The date is sent in an AJAX request using full Date objects which contain the time and timezone information. 

We are only interested in the date portion irrespective of the time zone that client is in. When a user selects a date/month we want to receive a C#
DateTime object in the local server time.

For example:

User is in UTC+1 and selects ‘01/07/2013’ 
The actual C# DateTime object is instantiated as ‘30/06/2013 23:00’
We expect to get â€˜01/07/2013 00:00:00’

We are currently using the following setting in Global.asax :

GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.DateTimeZoneHandliig = Newtonsoft.Json.DateTimeZoneHandling.Local;

Could you please advise?
Douglas
Top achievements
Rank 1
 answered on 17 Feb 2014
1 answer
59 views
Hi,
Today we updated our web application with the latest internal release of Kendo Web UI components version 2013.3.1414.
Immediately we notice that the Drag & Drop of file on File Upload component no longer work in IE-11, instead the browser just open and show the content of the file!
This problem was not exist in the previous Kendo Web UI internal build release version!!!
Please look into this problem/bug and revert as we need to use the new internal release because of the rest of its bug fixes.

Thank you. 
Dimiter Madjarov
Telerik team
 answered on 17 Feb 2014
1 answer
143 views
I have the following code:
<section>
    @(Html.Kendo().Window()
        .Modal(true)
        .Name("window")
        .Height(200)
        .Width(400)
        .Title("Case Documents")
        .Visible(false)
        .LoadContentFrom("Index", "Home")  
        .Pinned(true)
        )
 
    <a id="openButton">Open Window</a>


Then after it, I have:
// this works when the page is loaded
 $(function () {
      $("#window").data("kendoWindow").center().open();
  });
 
// this does not work, even if I remove the above code, it says $(...).data(...) is undefined
  $($("#openButton").click(function () {
      $("#window").data("kendoWindow").center().open();
  }));
Basically, once the page is loaded, I can no longer open the window, regardless of whether it was opened on document ready event or not.  I do not understand why the $("#window").data("kendoWindow") object is undefined.  
kirelet
Top achievements
Rank 2
 answered on 15 Feb 2014
1 answer
98 views
I am using mvc telerik grid on my project and i have checbox inside this gridI just want to filter my checkbox like check or non checked in filter boxIs it possible?Is there any experience for this situation to help me? @( Html.Telerik().Grid<Orpac.Models.Time>()
.Name("timecmb")
.NoRecordsTemplate("No users to display")
.DataKeys(keys => keys.Add(k => k.Ident))
.DataBinding(d => d.Ajax().Select("GridTimeBinding", "Rule"))
.Columns(c =>{c.Bound(e => e.Ident).Width(90).ClientTemplate("<input type='checkbox' id='123' value='<#= Code #>' <#=bit? checked='checked' : '' #> />").Title((string)ViewData["Select"]);c.Bound(e=>e.Code).Width(150).Title((string)ViewData["TimeCode"]);c.Bound(e=>e.Desc).Width(300).Title((string)ViewData["Description"]); })
.ClientEvents(events => events.OnRowDataBound("onrowDataBoundtimepopup").OnDataBound("onDataBoundTimeRule"))
.Selectable()
.Footer(true)
.Sortable()
.Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"]))
.Scrollable(scrolling => scrolling.Height(190))
.Pageable(p=>p.PageSize(10))
)This is the example of my gridThnx
Dimiter Madjarov
Telerik team
 answered on 14 Feb 2014
5 answers
1.0K+ views
See code example below....  I currently have two dropdown lists that are linked together as cascading dropdowns.  In the case where the second dropdown (that is dependant ont he first dropdown) only gets one value populated to it I would like it to be autoselected instead of making the user select the single value that gets placed in that dropdown.

However, if the second dropdown gets populated with more than one value, then I would like the placeholder text to show as it does today.

Any ideas on how to best go about achieving this?  FYI, this is currently set up so that the second dropdown list is disabled until a value is selected from the first.  I figured this out but can't figure out the autoselecting of the second dropdown if only one value.

Thanks,
Jason





<!-- START ACTIVITY TYPE -->
<div class="span3">
    <span class="activity-label">Activity Type</span>
    <div class="row-fluid">
        @(Html.Kendo().DropDownList()
            .Name(String.Format("MCActivityTypeId{0}", i))
            .OptionLabel("Select Activity Type...")
            .HtmlAttributes(new { @class = "span12 case_mc_activityTypeId" })
            .DataValueField("WorkflowQueueActivityMapId")
            .DataTextField("ActivityName")
            .DataSource(ds =>
            {
                ds.Read(r => r.Action("ActivityTypeData", "Workdriver", new { Id = act.WorkflowQueueId }));
            }
            )
            .Enable(showChargeIntegrityEditAddNew && act.IsDataEntry)
        )
    </div>
</div>
<!-- END ACTIVITY TYPE -->

<!-- START ACTIVITY STATUS -->
<div class="span3">
    <span class="activity-label">Activity Status</span>
    <div class="row-fluid">
        @(Html.Kendo().DropDownList()
            .Name(String.Format("MCActivityStatus{0}", i))
            .OptionLabel("Select Activity Status...")
            .HtmlAttributes(new { @class = "span12 case_mc_activityStatusId" })
            .DataValueField("WorkflowQueueActivityStatusMapId")
            .DataTextField("ActivityStatusName")
            .DataSource(ds =>
            {
                ds.Read(r =>
                {
                    r.Action("ActivityStatusData", "Workdriver")
                        .Data(@<text>function() { return { id: $('#MCActivityTypeId@(i)').val() }; }</text>);
                }).ServerFiltering(true);
            }
            )
            .Enable(false)
            .AutoBind(false)
            .CascadeFrom(String.Format("MCActivityTypeId{0}", i))
        )
    </div>
</div>
<!-- END ACTIVITY STATUS -->
Dimiter Madjarov
Telerik team
 answered on 14 Feb 2014
7 answers
1.2K+ views

Hi, I need to send in a bunch of form values to the create method (add new button) on the grid.
For edit, I used like this and it works fine.
grid call:
.Read(read => read.Action("Read_FinesByMLS", "FinesHistoryByMLS").Data("ParameterData"))

js function:
function ParameterData() {
         alert("para=" + $("#MLSNumber").val());
        return {
              MLSNumber: $("#MLSNumber").val()
        }
}

controller function:
public ActionResult Read_FinesByMLS([DataSourceRequest] DataSourceRequest request, string MLSNumber)
{
              using (var context = new MATRIXEntities_Connection ())
              {
                       IQueryable<FineHistory> finebymls = context.FineHistories;
                       if (MLSNumber != null)
                       {
                                  finebymls = finebymls.Where(f => f.MLSNumber == MLSNumber); }                       
                               DataSourceResult result = finebymls.ToDataSourceResult(request, f => new                    FineHistoryViewModel
                         {
                                   FineHistoryId = f.FineHistoryId ,
                                   FineCode = f.FineCode,
                             });
                            return Json(result);
                     }
}


When I tried to do same for create, I am not getting any value for the parameter in the controller function. MLSNumber param is coming null. Any help is appreciated. Thanks

here is my create action call.
.Create(create => create.Action("Create_FinesByMLS", "FinesHistoryByMLS").Data("ParameterData"))

Its the same function call as above for edit function.

Controller function.

public ActionResult Create_FinesByMLS([DataSourceRequest] DataSourceRequest request,  string MLSNumber)
      {
 
          using (var objFines_Context = new MATRIXEntities_Connection())
          {
 
              */
              //objFines_Context.usp_InsertFineHistory("211131297", "479", 4790, "713779DAF4844A", "239024", "281530", "kmantrip", "M");
              //objFines_Context.SaveChanges();
          }
          return View();
      }

the parameter is

Dimiter Madjarov
Telerik team
 answered on 14 Feb 2014
2 answers
367 views
Hi All,

Could someone please tell me what I'm doing wrong here.
All I want to do is display a checkbox if Resend is true?

columns.Bound(p => p.Id).ClientTemplate("#=Resend ? '' : '<input id=\"resend\" value='#=Id#' class=\"chkbxq\" type=\"checkbox\" />' #").Title("test");


Tim
Top achievements
Rank 1
 answered on 13 Feb 2014
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
Wizard
Security
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?