Telerik Forums
UI for ASP.NET MVC Forum
3 answers
198 views
Hi there

I understand localization is now available for Kendo Ui Complete for ASP.NET MVC.
I know where to find the DLLs for the resources, but how do I implement them? I'm using Razor.

*UPDATE*
The resource DLLs are located in the "bin\language" folder and my globalization settings are set to "Auto". I can make use of my own resources and everything translates automatically. However, the Kendo Grid (like update/edit/cancel) does not change.
What am I missing here?

Kind regards,

Jesse
Daniel
Telerik team
 answered on 06 Nov 2012
3 answers
247 views
Hi,

Can I use the Kendo MVC framework with a MVC3/razor project on visual studio 2010 Sp1? Also what database needs to be on SQL Server to make the localhost Kendo demos work.  It keeps failing out trying to connect. Is it looking for an advetureworks database?  where can I get one?

I'm presently avoiding upgrading to Visual Studio 2012 cause I don't like the look of it and MS are still deciding if they;re going to skin all the icons.

thanks

Jonathan
Vladimir Iliev
Telerik team
 answered on 06 Nov 2012
3 answers
196 views

I'm simply trying to fire an event, and it doesn't work. (I'm starting to feel like Kendo is a beta that we pay to test.)

Markup:

@(Html.Kendo().AutoCompleteFor(m => m.EditName)
.Events(e => e.Select("alert('test')"))
.DataSource(source =>
          source.Read(read => read.Action("GetUsers", "Administration"))
              .ServerFiltering(true)))

Here's what happens. It fires the alert box upon page load, and never again. Also, it doesn't matter what the event is. I can make the event "Select", "Change", "Open", "Close".... it always fires once upon page load, and never again.

I tried using the Latest Internal build... did not fix it. I just want to fire an event upon Select, not upon page load. Please advise what I'm doing wrong. Thanks.
Atanas Korchev
Telerik team
 answered on 06 Nov 2012
2 answers
212 views
Hey, I know there has to be a simple way to do this but haven't found it yet.

We have a currency text box that is disabled. When the value in it is less than zero we would like for the text to be red.

I have found ways to change the text color  but not on a disabled one. May be best to change background color but still has to be done on disabled object.

Is there a way to do this and if so how?


Any help is appreciated.

Paul
PAUL
Top achievements
Rank 1
 answered on 06 Nov 2012
0 answers
209 views
In this case, I've got a 'vendor' dropdown that cascades off of a 'companies' dropdown. Within the datasource, it is possible for the vendor query to return no results for a selected company.

If I select a company that is associated with vendors, the vendor dropdown gets populated with the applicable values. If I then click on the vendor dropdown i can select values. This behavior is perfect.

If I select a company that has no vendors, I would expect the vendors dropdown to have no choices (or a default choice). However in this case, the vendor dropdown request it's data (/Vendors/Get?companyCode=33), gets no records and then posts a second time to the endpoint. Also the vendor dropdown remains stale, containing any items from a previous cascade operation. Furthermore, if I click on the Vendors dropdown, it initializes two more requests to the data (causing the spinning indicator to appear twice quickly) and stops.

Has anyone run into this double posting on no records issue? See source code below.

<input id="CompanyCode"
       data-textfield="ItemText"
       data-valuefield="ItemValue"
       data-endpoint="http://localhost:8888/Customers/Get"
       data-selected="40"/>
        
<input id="VendorId"
       data-textfield="ItemText"
       data-valuefield="ItemValue"
       data-endpoint="http://localhost:8888/Vendors/Get"
       data-cascade="CompanyCode"/>
        
<script src="Content/js/jquery.min.js"></script>
<script src="Content/js/kendo.all.min.js"></script>
<script>
    $(function(){
        $('#CompanyCode').each(function(){
            var target = $(this);
             
            var options = {
                dataTextField: target.data('textfield'),
                dataValueField: target.data('valuefield'),
                dataSource: {
                    transport: {
                        read: target.data('endpoint')
                    }
                }
            }
 
            target.kendoDropDownList(options);
        });
 
        $('#VendorId').each(function(){
            var target = $(this);
            target.kendoDropDownList( {
                dataTextField: target.data('textfield'),
                dataValueField: target.data('valuefield'),
                dataSource: {
                    transport: {
                        read: target.data('endpoint'),
                        parameterMap: function(options, operation) {
                            return {
                                companyCode: options.filter.filters[0].value
                            }
                        }
                    },
                    serverFiltering: true
                },
                cascadeFrom: target.data('cascade'),
                autoBind: false
            });
        });
    });
</script>
Wayne
Top achievements
Rank 1
 asked on 05 Nov 2012
1 answer
243 views
I have a single-page-application that uses url hashes to set state for the UI. When generating a grid custom command, the button link is generated as <a href="#"></a>. This causes the hash monitor (jquery-bbq) to load an unintended statefor the UI.

Is it possible to either a) remove the hash from the link or b) set the link to the current hash?

i.e. <a href="#nav=admin&sub=1"></a> where 'nav=admin&sub=1' is already set for the current page state url hash.

TIA
Christophla
Top achievements
Rank 1
 answered on 05 Nov 2012
5 answers
1.2K+ views
I have a Kendo grid with inline editing. It works great. An issue I have right now is that after an inline update of a record, if certain conditions of the update exist I need to redirect to another Page i.e. RedirectToAction. So the code looks like:

public ActionResult EditingInline_Update([DataSourceRequest] DataSourceRequest request, OrderViewModel order)
{           
   if (order != null && ModelState.IsValid)
   {
       order = UpdateOrder(order);
       repository.UpdateOrder(order);
  
}
   if (order.orderStatus == "HD")
         return RedirectToAction("Info");           
    return Json(ModelState.ToDataSourceResult());
 }

This code works as designed but will not display the page. This of course is due to the AJAX call which is returning to the datasource.

Several things happen on the line order = UpdateOrder(order);  This method is in the Controller and sets several fields in the record that was updated including the orderStatus. The repository.UpdateOrder(order) happens in the SessionOrderRepository class.

Since the fields in the UpdateOrder method of the Controller are not set by the user, the information is not updated in the grid either (grid updates immediately). And if for some reason the orderStatus is placed in the "HD" (hold) state we want to redirect the user to a page that displays the reason(s) that the order is on hold. Clicking Ok on that page would redirect them to the grid and all of the fields would be updated since it has to reload.

Technically this is probably not a Kendo issue but if anyone has a work around on this your help would be greatly appreciated.

Regards,

Paul

Mikul
Top achievements
Rank 1
 answered on 03 Nov 2012
0 answers
178 views
Hello!
First of all I'd like to congratulate you on your work.
One small suggestion is that it would be better if you expanded your documentation and examples, especially for mvc.

My question is stated in the title. I have a vs project and I use mvc. I also have some javascript functions that I'd like to fire whenever someone clicks on a button. I can make this happen but I don't know how to pass arguments.

The way I've implemented is by using htmlattributes on custom command and passing new {onclick = "MyFunction()"}.
This works but I need parameters as well. And I need a parameter from the same row's element.

Can you please help me?
Thank you very much in advance!
Romanos
Top achievements
Rank 1
 asked on 02 Nov 2012
20 answers
1.2K+ views
Hi,

Using a simple ClientTemplate for a details url in a grid which worked in Telerik.MVC product the same cannot be said for Kendo UI.

@(Html.Kendo().Grid<VehicleGroupGridRow>()
    .Name("VehicleGroupGrid")
    .Columns(column =>
    {
        column.Bound(p => p.Title).ClientTemplate("<a href='/VehicleGroup/Details/#= Id #'>#= Title #</a>");
        column.Command(command => { command.Edit(); command.Destroy(); });
    })
    .ToolBar(commands => commands.Create())
    .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
    .Sortable()
    .DataSource(dataSource => dataSource
            .Ajax()
            .Events(events => events.Error("error_handler"))
            .Model(model => model.Id(p => p.Id))
            .Create(create => create.Action("CreateVehicleGroup", "VehicleGroup"))
            .Read(read => read.Action("GetVehicleGroups", "VehicleGroup"))
            .Update(update => update.Action("UpdateVehicleGroup", "VehicleGroup"))
            .Destroy(destroy => destroy.Action("DestroyVehicleGroup", "VehicleGroup"))
    )
     
)

When I attempt to add a new item I get a Microsoft JScript runtime error 'Id' is undefined.

If I don't use a ClientTemplate then the grid works fine.

Thanks in advance
Philip
Top achievements
Rank 1
 answered on 02 Nov 2012
2 answers
572 views
If you add the class k-textbox to a TextArea, in firefox the text wraps as it should. However, in chrome it thinks its a TextBox and does not wrap.
nathan
Top achievements
Rank 1
 answered on 02 Nov 2012
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?