Telerik Forums
UI for ASP.NET MVC Forum
1 answer
1.1K+ views
Hello.
Ive got two comboboxes:
-first one:
@(Html.Kendo().ComboBox()
    .Name("Dim1")
    .DataTextField("Barcode")
    .DataValueField("Barcode")
    .Filter(FilterType.StartsWith)
    .DataSource(action => action.Read(read => read.Action("GetStockLocationsForComboBoxAjax", "StockLocation")).ServerFiltering(true))
    .MinLength(3)
    )
-second one:
<script type="text/javascript">
    function onAdditionalData() {
        return { Barcode: $("#Dim1").val() };
    }
</script>
 
@(Html.Kendo().ComboBox()
    .Name("Dim2")
    .DataTextField("Barcode")
    .DataValueField("Barcode")
    .Filter(FilterType.StartsWith)
    .DataSource(action => action.Read(read => read.Action("GetStockLocationsForComboBoxAjax", "StockLocation").Data("onAdditionalData")).ServerFiltering(true))
    .MinLength(3)
    .CascadeFrom("Dim1")
    )
Here is my read action signature:
[HttpGet]
public JsonResult GetStockLocationsForComboBoxAjax([DataSourceRequest] DataSourceRequest request, string text, string Barcode)

How can I achieve the following:
Im putting some data to Div1 and get it under text parameter. When I put something in Div2 I will get that data under text plus data from Div1 under Barcode parameter.

I hope ive described it  enough clearly.

Thanks!
Radosław
Top achievements
Rank 1
 answered on 08 Nov 2012
0 answers
131 views
I downloaded a trial for Kendo UI.  It has a grid demo which is accessed via this url.

http://localhost:8301/razor/web/grid/index

It shows you the source for the view and the controller on page.

If a developer uses the code for the controller as a guide (which I did) you run into several issues.

The Products_Read action is called from the view for Ajax calls.  However, since its not the same name as the action that displayed the view the grid is on it will instead throw an exception stating you need to use JsonRequestBehavior.AllowGet (which is highly misleading as the developer will now start going down the wrong path).  Changing this behavior will get you a page full of JSON data and no grid.

The issue is that there is no view called Products_Read... the original view with the grid is called from Index action.  The controller action for the ajax call should probably be renamed to Index and, for clarity, should also be decorated with an HttpPost attribute.

This "demo" cost me about 4 hours of time.

Dan A
Top achievements
Rank 1
 asked on 07 Nov 2012
0 answers
168 views
Is it possible to do everything using the Grid and Datasource wrappers that can be done in javascript/html? I made the decision, perhaps unwisely, to use the MVC Wrappers for ASP.Net MVC development. But it is far from obvious what the mapping is from JS to the wrapper and if it is complete.

The examples don't help much. I am trying to put together a grid where some columns are foreign keys on another record. For example, Instead of displaying "Mr.", or "Mrs." or "Ms." etc I would prefer to use key values and then retrieve the value from another table. That is simple. But I want to edit inline and I want that field to be a dropdown list of valid titles.I see an example using javascript but I can't see how to replicate that code in a Wrapper. Also, the example uses local data instead of accessing a database but I can figure out how to get the date from a database.

I don't want to continue trying to get the Wrapper to work if the wrapper only supports a subset of the native functionality.The particular area I am having trouble with is in the definition of Fields.
Martin
Top achievements
Rank 1
 asked on 07 Nov 2012
1 answer
303 views
When refresh() is called, the listview will not postback to server to rebind the data Which function should I call if i want to rebind the data from server? Thanks
Warren
Top achievements
Rank 2
 answered on 06 Nov 2012
3 answers
213 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
264 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
208 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
227 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
228 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
269 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
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
Simon
Top achievements
Rank 2
Iron
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
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?