Telerik Forums
UI for ASP.NET MVC Forum
3 answers
181 views
Hi.  I would like to know if there is any way to delay a clicked tab from displaying until my corresponding MVC controller action is completed?  The following code below calls an MVC controller "Controller" with the ActionResult "ControllerAction" and "message" is the name of the tab I am displaying for validation.
Currently, I have a function called within the if statement if(a_tabPageSelected == "MyTab") which takes a while to complete and would prefer if the tab section didn't appear until the function completes.

Controller.cs
public ActionResult ControllerAction(string a_tabPageSelected)
{
   if(a_tabPageSelected == "MyTab")
   {
        /// do stuff before tab page appears
   }
 
/// now display tab page using some command and return View
return View("Tabsection");




View.cshtml
 
function onSelect(e) {
   var message = $(e.item).find("> .k-link").text();
   $.get('/Controller/ControllerAction/?a_tabPageSelected=' + message, function (data) {
   $("#TabDiv").html(data);
   });
}
Kiril Nikolov
Telerik team
 answered on 30 Oct 2014
3 answers
202 views
i have a Kendo grid that uses an edit Popup. The culture in the client is de-DE, when an user tries to edit a decimal number i.e. 8,5 Kendo sends a null to the server for that value and returns validation message "The value 8.5 is not valid for 'PropertyName'". Any help will be greatly appreciated.

@{
var culture = System.Globalization.CultureInfo.CurrentCulture.ToString();
}

<script src="@Url.Content("~/Scripts/Kendo/cultures/kendo.culture." + culture + ".min.js")"></script>

<script type="text/javascript">
kendo.culture("@culture");
</script>

jQuery.extend(jQuery.validator.methods, {
date: function (value, element) {
return this.optional(element) || kendo.parseDate(value) != null;
},
number: function (value, element) {
return this.optional(element) || kendo.parseFloat(value) != null;
}
});
@(Html.Kendo().Grid<SalesToolkit.ViewModels.AdminEquipDimViewModel.Equipment>()
.Name("grdEquipDim")
.Columns(columns =>
{
columns.Bound(dim => dim.EquipmentID).Width(50).Title("ID").Hidden(true);
columns.Bound(dim => dim.EquipmentName).Width(140).Title("Equipment Name");
columns.ForeignKey(dim => dim.EquipmentTypeID, (System.Collections.IEnumerable)ViewData["EquipTypes"], "EquipmentTypeID", "EquipmentName").Width(60).Title("Type");

columns.Bound(dim => dim.Metric).Width(55);
columns.Bound(dim => dim.ModelVerified).Width(65);
columns.Bound(dim => dim.LastModifiedBy).Width(130);
columns.Bound(dim => dim.TimeStamp).Format("{0:MM/dd/yyyy hh:mm:ss}").Width(120);

columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Scrollable()
.HtmlAttributes(new { @class = "dimGrid" })
.Sortable()
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Field(dim => dim.EquipmentID).Editable(false);
model.Field(dim => dim.TimeStamp).Editable(false);
model.Field(dim => dim.LastModifiedBy).Editable(false);
})
.Events(events => events.Error("error"))
.Model(model => model.Id(dim => dim.EquipmentID))
.Create(update => update.Action("EquipDim_Create", "AdminEquipDim", new { mID = Model.ManufacturerID }))
.Read(read => read.Action("EquipDim_Read", "AdminEquipDim", new { mID = Model.ManufacturerID }))
.Update(update => update.Action("EquipDim_Update", "AdminEquipDim"))
.Destroy(update => update.Action("EquipDim_Delete", "AdminEquipDim"))
)
)

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult EquipDim_Update([DataSourceRequest] DataSourceRequest request, AdminEquipDimViewModel.Equipment equipMfg)
{
if (equipMfg != null && ModelState.IsValid)
{
AdminEquipDim oEquipMfg = new AdminEquipDim();
oEquipMfg.UpdateEquipDim(equipMfg);
}

return Json(ModelState.ToDataSourceResult());
}



Petur Subev
Telerik team
 answered on 29 Oct 2014
1 answer
108 views
I was told that this new release will contain a new Export to Excel Widget from the MVC Grid.

Is that true?
If so where can I find documentation about it.
Thanks
Robert
Kiril Nikolov
Telerik team
 answered on 29 Oct 2014
3 answers
186 views
I haven't been able to figure out how to set the series with a data source returned from a controller (see below). What do I need to pass to series.Line()?

The controller method returns a list of long integers.

        @(Html.Kendo().Chart()
            .Name("jobHistoryChart")
            .Title("Batch Job History")
            .Theme("Bootstrap")
            .Legend(legend => legend.Visible(true).Position(ChartLegendPosition.Bottom))
            .HtmlAttributes(new
            {
                style = "margin-top:15px; border:thin solid steelblue; padding:10px; padding-bottom:20px;"
            })
            .DataSource(dataSource => dataSource.Read(read => read.Action("GetBatchJobHistory", "Home",
                new { histJobCaption = "Load Inventory Usage Summary Data" })))
            //.Series(series =>
            //{
            //    series.Line().Name("Batch Job");
            //})

        )

Hristo Germanov
Telerik team
 answered on 28 Oct 2014
9 answers
535 views
This is a very weird behaviour but for some reason we can initialize Grids using Kendo's MVC HTML style helpers but DropDownList, DropDownListFor and other widgets just don't work.

Here's the code: 
@(Html.Kendo().DropDownListFor(model => model.Gender) .OptionLabel("Select Gender").BindTo(Model.GenderList).Deferred(true))
@Html.ValidationMessageFor(m => m.Gender)

There are no JS errors but the resulting HTML looks like this: 
<input type="text" value="-1" name="Gender" id="Gender" data-val-required="The Gender field is required." data-val-range-min="0" data-val-range-max="1" data-val-range="Gender is required" data-val="true" class="input-validation-error">
 
<span data-valmsg-replace="true" data-valmsg-for="Gender" class="field-validation-error"><span for="Gender" class="">Gender is required</span></span>

If I instantiate this via javascript using a normal MVC drop down list:
<h3>Test Drop Down list</h3>
@Html.DropDownListFor(m => m.Gender, Model.GenderList, new { @class = "dropdown-list form-control"})
<script>
//instantiate drop down lists
$(".dropdown-list").kendoDropDownList();
</script>

It works! 

So I assume the Kendo libs are loading fine, but for some reason the MVC side of things are only partially working. 

Grids work: 
@(Html.Kendo().Grid<DependantModel>(Model.Dependants)
        .Name("Dependants")
        .Columns(columns =>
        {
              ... left out for brevity
        }) .DataSource(dataSource => dataSource
                        .Server()
                        .Model(model => model.Id(p => p.Id))
                        .Destroy(update => update.Action("EditingInline_Destroy", "Grid"))
                    )
                    .Deferred(true)
                    )

Charts work but the code is too long to paste here. 

Any ideas why other widgets won't work? 





Jacques
Top achievements
Rank 2
 answered on 28 Oct 2014
1 answer
125 views
Hello:
Is there a PersistenceManager for asp.net MVC applications specifically for the Grid?
Thanks
Robert
Petur Subev
Telerik team
 answered on 28 Oct 2014
1 answer
153 views
I have seen some examples of using server side Kendo extensions to access Web API calls in the same project.  But what about if the Web API is a different project and URL?  We are doing this as an N-Tier where the Web API is the data access for multiple client applications.  Do you have a same using the server side KendoGrid to access a Web API call that is located on a different server/URL?  I can't figure this out.

Here is what I have tried.  Both projects have a reference to the data classes so I hope to send a known type back and forth.  But this doesn't work:

@(Html.Kendo().Grid<CustomerOrderModel>()
    .Name("Grid")    
        .Columns(columns =>
                     {
                         columns.Bound(o => o.OrderNumber);

                         columns.Bound(p => p.Description);

                         columns.Bound(p => p.Description2);

                         columns.Bound(p => p.Notes);

                     })
    .DataSource(dataSource => dataSource
        .WebApi()        
        .Read(read => read.Url("http://localhost:52559/api/CustomerOrder").Type(HttpVerbs.Get))

    )
)
Petur Subev
Telerik team
 answered on 28 Oct 2014
1 answer
447 views
I'm currently looking at Filters on the ASP MVC grid. 

I have this line on my grid:

.Filterable(filterable => filterable.UI("$.fn.kendogrid().userDropdownFilter"))

which works fine, and I can access the original filter element in the userDropdownFilter(element) function in my JavaScript.

I was wondering if it was possible to send additional parameters to this function though, and still pass the original element variable?

Thanks
Alexander Popov
Telerik team
 answered on 28 Oct 2014
1 answer
204 views
Hi:
I'm trying to run the Grid Popup editing example and get an error on return Json(productService.Read().ToDataSourceResult(request));
It cant can't find productService.
I'm assuming I'm missing the productService class?
thanks
Robert
Alexander Popov
Telerik team
 answered on 27 Oct 2014
1 answer
115 views
Hi,

I'm working on a use case where the user is requires to enter a text before he is allowed to edit the content of a row. I want to use a jQuery UI Dialog to prompt a small form that the use need to fill before the row go to edit mode. Using jQuery I was able to bind a handler to the "click" event of the edit button, so I can open the dialog. However I can't find a way to prevent the grid from switch into edit mode before I get the response from the dialog.The result is that if the user close the dialog he can edit the row without fill out the form. Any ideas on how to prevent the default row edit?
Rosen
Telerik team
 answered on 27 Oct 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
+? 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?