Telerik Forums
UI for ASP.NET MVC Forum
3 answers
436 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
456 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
118 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
101 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
169 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.5K+ 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
283 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
589 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
0 answers
79 views
1.  can we add  a  Combobox to datagrid  in Kendo MVC /If  yes  can you  please  provide a  example.                                              
2.  when  using the  both  grouping and  inline  bulk edit  create event  is  getting fired  when we change the values and  click on save  button but  actually  Edit event  needs  to fired  can  you  please  let  us  if  it  know  issuse 
3. can we  hide the  toolbar  and  call this  methods  from  other custom HTML  buttons  in the  code  . 


Please give detials  as  we  need to  evaluate  the  Controls  .
Rajesh
Top achievements
Rank 1
 asked on 18 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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?