Telerik Forums
UI for ASP.NET MVC Forum
0 answers
227 views
I've been using the Telerik MVC extensions and want to be able to use an Autocomplete (but with the user able to enter something not in the dropdown list if he/she wants to) in a Create view.

Can I do this using the MVC extensions? If not can I do it using the Kendo UI MVC beta controls?

At the moment I have code like this in my view, but this doesn't allow the user to enter a value which is not in the dropdown list:

  <div class="editor-label">
            @Html.Label(model => model.PremiumPaymentFrequency)
        </div>
     <div class="editor-field">
            @Html.DropDownList("PremiumPaymentFrequency", String.Empty)
            @Html.ValidationMessageFor(model => model.PremiumPaymentFrequency)
        </div> 

The reason I ask for how to do this both using the Rad MVC extensions and the Kendo UI MVC controls is that although I want to start using Kendo UI MVC in new code, I would also like to know how to do it using the Rad MVC Telerik extensions in case I need to.
I need to be able to obtain the value entered by the user in the code.  With the RadMBC extensions, this is simply model.PremiumPaymentFrequency (which I can use in the controller code on the server), but how do I obtain the value entered by the user if a Kendo UI MVC control is used? (Is the value then only usable on the client, or can I use it in the server's controller code, and if so, how?).

Apologies if some of this seems basic, but I am obviously new to using the Kendo controls, particularly with MVC.

Thanks 
Patrick
Top achievements
Rank 2
 asked on 21 Jun 2012
3 answers
447 views
How do we go about selecting the value of a server-bound DropDownListFor() in an edit form? Example:

@(Html.Kendo().DropDownListFor(m => m.Country)
		.BindTo(ViewBag.Countries)
		.DataValueField("CountryCode")
		.DataTextField("CountryName")
		.OptionLabel("Select Country"))

ViewBag.Countries contains a List<Country>. Country object has a CountryCode and CountryName (strings). The model I'm passing in has a Country field that holds the exact value that's bound to DataValueField("CountryCode"). Nothing gets pre-selected when I open the form (but the list of countries is there). The SelectedIndex() property is useless to me in this instance. Digging through the DropDownListBuilder class the only thing I saw was a Value() method that I'm not sure what it does but giving it the value I want selected doesn't do anything either.

I can't give BindTo() a SelectList() like I used to with the Telerik extensions (unless I'm doing something wrong).

Thanks for any help
Georgi Krustev
Telerik team
 answered on 21 Jun 2012
1 answer
460 views
I managed to get a dropdown in a grid column. But I have no clue on how to set the selected value, and when I save it doesn't save my selected value.

The grid

@using Perseus.Areas.Communication.Models
@using Perseus.Common.BusinessEntities;


<div class="gridWrapper">
    @(Html.Kendo().Grid<CommunicationModel>()
        .Name("grid")
        .Columns(colums =>
        {
            colums.Bound(o => o.communication_type_id)
                .EditorTemplateName("_communicationDropDown")
                .ClientTemplate("#: communication_type #")
                .Title("Type")
                .Width(180);
            colums.Bound(o => o.sequence).Width(180);
            colums.Bound(o => o.remarks);
            colums.Command(command => command.Edit()).Width(50);
        })
        .Pageable()
        .Sortable()
        .Filterable()
        .Groupable()
        .Editable(edit => edit.Mode(GridEditMode.InLine))
        .DataSource(dataSource => dataSource
            .Ajax()
            .ServerOperation(false)
            .Model(model => model.Id(o => o.communication_id))
                .Read(read => read.Action("AjaxBinding", "Communication", new { id = @ViewBag.addressId }))
                .Update(update => update.Action("Update", "Communication"))
            .Sort(sort => { sort.Add(o => o.sequence).Ascending(); })
            .PageSize(20)
        )
    )
</div>


The EditorTemplate "_communicationDropDown

@model Perseus.Areas.Communication.Models.CommunicationModel


@(Html.Kendo().DropDownListFor(c => c.communication_type_id)
        .Name("DropDownListCommunication")
            .DataTextField("description1")
            .DataValueField("communication_type_id")
            .BindTo(ViewBag.CommunicationTypes))

Pechka
Top achievements
Rank 1
 answered on 21 Jun 2012
0 answers
122 views
Can you point me to the link for the kendoui mvc q2 beta release?  
Thanks
Congero
Top achievements
Rank 1
 asked on 21 Jun 2012
0 answers
108 views
I seem to be initializing the TabStrip twice but not meaning too. Once happens on the MVC helper call
@(Html.Kendo().TabStrip()...

And the other I do on the Jquery document ready to set the configuration options. I am doing this because I can’t seem to find another way to do this in the html helper. Where should I be setting the configurations options(For instance collapsible and animation)? Example code would be great as I don't see examples for this on your site.

Nathan
Top achievements
Rank 1
 asked on 20 Jun 2012
12 answers
1.0K+ views
How do you set the width on the client-side via javascript for the NumericTextBox....?
Dimo
Telerik team
 answered on 20 Jun 2012
1 answer
178 views
Hi,
Is there a way to set the animation and collapsible object properties using the Kendo MVC TabStrip helper method? The default behaviour of the generated tabstrip seems to collapse/expand tabs when you move between tabs. I'd like to disable that if possible.

Best regards, IP
Georgi Krustev
Telerik team
 answered on 20 Jun 2012
9 answers
3.6K+ views
How do I hide the NumericTextBox on the client side via javascript?
Scott
Top achievements
Rank 2
 answered on 20 Jun 2012
1 answer
292 views
Dear all,

I have a problem with a server binding (I also try a ajax() binding without success).

Here is my model:
public class PlaceModel
{
    public Guid Id { get; set; }
    public string Name { get; set; }
 
    public PlaceModel()
    {
    }
}
Here is mycontroller
namespace Noolibee.Presentation.Web.SandBox.Controllers
{
    public class InventoryController : Controller
    {
        //
        // GET: /Inventory/
 
        public ActionResult Inventory()
        {
            //Get all places in the database
            IInventoryService serviceRepo = ServiceBusinessFactory.Create<IInventoryService>();
            List<INV_Place> places = serviceRepo.GetAllPlaces();
 
            //Convert the places to a placeModel (for testing purpose)
            List<PlaceModel> placesModel = new List<PlaceModel>();
            foreach (INV_Place item in places)
            {
                placesModel.Add(new PlaceModel() { Id = item.Id, Name = item.Name });
            }
 
            //Return the view with the list of placeModel for the combobox
            return View(placesModel.AsEnumerable<PlaceModel>());
        }
    }
}
End finally, my webpage:
@model IEnumerable<Noolibee.Presentation.Web.SandBox.Models.PlaceModel>
@{
    ViewBag.Title = "Inventory";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
 
<h2>Inventory (size = @Model.Count())</h2>
 
<div>
        @(Html.Kendo().ComboBox()
            .Name("placesDropDownList")
            .DataTextField("Name")
            .DataValueField("Id")
            .BindTo(Model)
            .SelectedIndex(0)
        )
 
         
</div>
So, the value @Model.Count tells me that there's 1 item, but the combobox is empty.
I should have miss something, but what ?

Thanks for your help
Sylvain
Sylvain
Top achievements
Rank 1
 answered on 20 Jun 2012
3 answers
604 views
Hi,

I have a grid with columns Qty, Price and Total.  When the user changes the Qty and clicks on Update, I want to recalculate the total and update the Total cell.  How would you do that?  The grid is setup with GridEditMode.InLine.

And while were adding things up, how do you do a grand total and display it in the footer?

Thx,

PT
Pierre
Top achievements
Rank 1
 answered on 19 Jun 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
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?