Telerik Forums
UI for ASP.NET MVC Forum
1 answer
644 views

Hi! 

I ve been checking out the new DateRangePicker control, and i had some doubts about its usage

 

1) Is there a chance to make the end date optional? the demo published always focuses on the end date input after selecting a start date, and i want it to be optional, by that i mean to be able to select a start date and end date, o only one of them and the remaining date field to remain empty. Is that possible?

 

2) I havent seen any binding method like there is for the date picker control. In the latest, there is a DatePickerFor method, to bind the control to the viewmodel field. In the daterangepicker control i expected to be the same method (configuring the start date field and the end date field)... where my assumptions wrong? If thats the case i dont see too much use to this control :/

 

thanks!

Viktor Tachev
Telerik team
 answered on 21 Feb 2019
11 answers
792 views

Hello, I am currently evaluating the Telerik control sets for use in a large project to start soon.  I have a requirement where we will be building a treeview in our ASP.NET MVC controller code using TreeViewItemModel list and passing to the view.  In the view razor code and/or javascript, is there a way to access the TreeViewItemModel as a user is selecting different nodes in the tree?  Specifically, when building the TreeViewItemModel, I populate the .Text and .Id properties and I need to access these values to post back to my controller code to handle the selection changes.  Is this possible? I need to quickly mock something up to demonstrate this.

Controller code to build the treeview contents is here:

public List<TreeViewItemModel> BuildTreeContents()
{
List<TreeViewItemModel> tree = new List<TreeViewItemModel>();
IQueryable<SupplierModel> suppliers = GetSuppliers();
IQueryable<ManagedOrgModel> managedOrgs = null;
IQueryable<ManagedLocationModel> locations = null;
TreeViewItemModel node = null;
List<TreeViewItemModel> orgs = null;
List<TreeViewItemModel> locs = null;
foreach (SupplierModel supplier in suppliers)
{
node = new TreeViewItemModel();
node.Text = supplier.SupplierName;
node.Id = supplier.SupplierID;
managedOrgs = GetManagedOrgs(supplier.ClientID, supplier.SupplierID);
orgs = new List<TreeViewItemModel>();
foreach (ManagedOrgModel managedOrg in managedOrgs)
{
TreeViewItemModel orgNode = new TreeViewItemModel();
orgNode.Text = managedOrg.ManagedOrgName;
orgNode.Id = managedOrg.ManagedOrgID;
locations = GetLocations(managedOrg.ClientID, managedOrg.SupplierID, managedOrg.ManagedOrgID);
locs = new List<TreeViewItemModel>();
foreach (ManagedLocationModel location in locations)
{
TreeViewItemModel locationNode = new TreeViewItemModel();
locationNode.Text = location.ManagedLocationName;
locationNode.Id = location.ManagedLocationID;
locs.Add(locationNode);
}
orgNode.Items = locs;
orgNode.HasChildren = true;
orgs.Add(orgNode);
}
node.Items = orgs;
node.HasChildren = true;
tree.Add(node);
}
return tree;

 

Thanks,

Doug Matulis

Dimitar
Telerik team
 answered on 21 Feb 2019
1 answer
906 views

Hello support,

I am using a MultiColumnComboBox widget in this way

 

01.@(Html.Kendo().MultiColumnComboBoxFor(x => x.PostBack.Expediente.IdCliente)
02.    .DataValueField("ID")
03.    .DataTextField("Nombre")
04.    .Columns(columns =>
05.    {
06.        columns.Add().Field("Nombre").Title("Cliente").Width("200px");
07.        columns.Add().Field("Mercado").Width("200px");
08.        columns.Add().Field("Subgrupo").Width("200px");
09.    })
10.    .Filter(FilterType.StartsWith)
11.    .BindTo(Model.Clientes)
12.    .HtmlAttributes(new { data_bind = "value: Expediente.Cliente" })
13.)

 

So far so good.

The question is: How can I specify the width of the whole dropdown list and in case the sum of the width of each column is greater than the width of the whole dropdown list then show a horizontal scroll bar (like the grid widget does) ?

Attached is a screenshot of the current widget rendered and below it the scrollbar I want to show (if necessary)

Thank you.

PD: I’ve tried with this post but it didn’t work https://www.telerik.com/forums/dropdownlist-should-take-size-of-biggest-option

Marin Bratanov
Telerik team
 answered on 20 Feb 2019
3 answers
438 views

I need to display a confirmation dialog on the screen using kendo.confirm. Everything work as expected until I resized the browser to see if the message displays correctly on the mobile. However the confirmation dialog text did not wrap on the screen. I tried to reproduce this in a dojo but can not. After further investigation I found that my site is missing the "display: block" or "display: inline-block" from the window wrapper.

Could you tell me who adds this so I can try to debug and see why the "display" property is not added.

Dimitar
Telerik team
 answered on 18 Feb 2019
4 answers
5.9K+ views

Would someone be able to provide a code snippet of how to programmatically select a row in the Kendo MVC Grid? 

We have the value for the ID (a column in the Grid) in a javascript variable.  We want to display the matching row in our grid and mark it as selected.  I saw the Kendo demos on how to select the row using grid.select(n), where n is the index into the row on the page.  But the demo example doesn't solve this problem.

Note, my data contains several thousand rows and my pageSize is limited to 10 rows per page.

@(Html.Kendo().Grid<ReportViewer.Models.EntityModels.tblTreeView>()
   .Name("grid")
   .Columns(columns =>
   {
     columns.Bound(c => c.Name).Title("Report Name");
     columns.Bound(c => c.Path).Title("Path");
     columns.Bound(c => c.Id).Title(string.Empty).Width("200px");
   })
   .Pageable(pageable => pageable.Refresh(true).PageSizes(true).ButtonCount(3))
   .Selectable()
   .Events(e => e.Change("showInTree"))
   .Sortable(sortable => { sortable.SortMode(GridSortMode.SingleColumn); })
   .DataSource(dataSource => dataSource
   .Ajax()
   .Model(model => model.Id(p => p.Id))
   .Sort(sort => sort.Add("Name").Ascending())
   .PageSize(10)
   .Read(read => read.Action("ReportsGridRead", "Home"))
)
)

 

Any help is greatly appreciated.

Viktor Tachev
Telerik team
 answered on 18 Feb 2019
1 answer
2.2K+ views

As the title states, is it possible to submit multiple partial views with a single button? Open to using javascript, jquery, ajax. 

I have them coming from the same model, but there are two partial views with separate forms, I am wondering if there is anyway to submit it with just using a single click?

Thanks

Marin Bratanov
Telerik team
 answered on 18 Feb 2019
2 answers
2.3K+ views

Hi All,

I have a grid inside a partialview of index view in a MVC project. I add a context menu to the grid. This menu has 4 items.  Which item(s) will show up depends on how many rows of grid are selected. I assign id to each menu item and tried to use hide() and show() to show certain menu item(s) but it doesn't work.  Anyone know how to do that?

Thanks.

Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 15 Feb 2019
3 answers
1.1K+ views

 

I use a gridview with inline editing, when i Update a double value with 

This is the grid :

@(Html.Kendo().Grid<Ubaldi.BoB2B.Web.Models.FraisDePort.FraisDePortViewModel>()
         .Name("FraisGrid")
         .Columns(columns =>
         {
             columns.Bound(e => e.Id).Hidden(true);
             columns.Bound(e => e.Article);
             columns.Bound(e => e.PoidsMin).ClientTemplate("#= PoidsMin # kg");
             columns.Bound(e => e.PoidsMax).ClientTemplate("#= PoidsMax # kg");
             columns.Bound(e => e.MontantHT).ClientTemplate("#= MontantHT # €");
             columns.Command(command => { command.Edit().UpdateText("Enregistrer").CancelText("Annuler").Text(" ");}).Width(100);
             columns.Command(command =>
             {
                 command.Custom("Logs").Click("FraisLogs")
                     .Text("<span class='fa fa-list-alt'></span>")
                     .HtmlAttributes(new { @class = "btn btn-info", title = "Voir les modifications effectuées sur l'Article de Transport" });
             }).Width(50);
         })
         .Editable(editable => editable.Mode(GridEditMode.InLine))
         .DataSource(dataSource => dataSource
             .Ajax()
             .Events(events => events.Error("error_handler"))
             .Read(read => read.Action("GetAll", "FraisDePort"))
             .Update(update => update.Action("Update", "FraisDePort").Data("addUser"))
             .Model(model =>
             {
                 model.Id(p => p.Id);
             })
             .PageSize(20)
         )
         .Pageable(pageable => pageable.ButtonCount(5)))

 

This is my View Model:

public class FraisDePortViewModel : IValidatableObject
   {
 
       public int Id { get; set; }
 
       [Required, StringLength(100, MinimumLength = 3, ErrorMessage = "Le Nom de l'Article de Transport doit faire entre 3 et 100 charactères")]
       [DisplayName("Article de Transport")]
       public string Article { get; set; }
 
       [Required]
       [UIHint("Poids")]
       public double? PoidsMin { get; set; }
 
       [Required]
       [UIHint("Poids")]
       public double? PoidsMax { get; set; }
 
       [UIHint("Currency")]
       [Required, Range(1, 9999, ErrorMessage = "Le Montant HT doit être supérieur à 0 €")]
       public decimal? MontantHT { get; set; }
 
       [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy HH:mm}", ApplyFormatInEditMode = true)]
       [DisplayName("Créé le")]
       public DateTime? DateCreation { get; set; }
 
       [DisplayName("Créé par")]
       public string UserCreation { get; set; }
 
       [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy HH:mm}", ApplyFormatInEditMode = true)]
       [DisplayName("Modifié le")]
       public DateTime? DateModification { get; set; }
 
       [DisplayName("Modifié par")]
       public string UserModification { get; set; }
 
       public List<FraisDePortLog> Modifications { get; set; }
 
       public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
       {
           if (PoidsMin > PoidsMax)
           {
               yield return new ValidationResult("Le Poids Minimum doit être supérieur au Poids Maximum ", new List<string> { "Poids" });
           }
       }
   }

 

This is my EditorTemplate "Poids"

@model double?
 
@(Html.Kendo().NumericTextBoxFor(m => m)
      .Culture("fr-FR")
      .Min(0)
      .Max(15)
      .Step(0.50))
      

 

This is what i receive when I post modification with decimals (see Attachement).

Additionnals info :

  • Kendo 2018.3.911.545 
  • Culture is set to fr-FR in web.config solution

Do you have an idea to fix this issue of null value ?

Thank you, 

Julien

 

UBALDI SI
Top achievements
Rank 1
 answered on 15 Feb 2019
8 answers
1.1K+ views
Since all the new web project templates in VS 2013 seem to use Bootstrap it would seem Microsoft have adopted this as their "default" layout template. As such I'd expect the Kendo UI libraries to work seamlessly with Bootstrap.

I have seen some documentation on this but the only guidance I can find on using the Kendo UI menu control with Bootstrap was this unanswered post on StackOverflow:
http://stackoverflow.com/questions/17729394/how-do-i-modify-the-kendo-ui-menus-default-html

So, to restate the question, what is the right way to use the Keno Menu control to put a drop down menu into the Bootstrap nav bar?
Dimitar
Telerik team
 answered on 14 Feb 2019
1 answer
294 views

I have been trying for several days to bend the menu to my will, and nothing has worked.

I'm using MVC5, Bootstrap 3, and Telerik UI for MVC (2019.1).

I have a div that is 28px tall, and I'm trying to get the menu to be constrained within that div's height. The problem is that the menu appears to be padded/margined and is 50px tall, regardless of the class styles I've tried to set. There doesn't appear to be any documentation (that I've found) that describes how to re-style the components.

For instance, it would be real nice if I could find a description regarding what to do to change the colors, the sizes, and the positioning. What css classes affect each widget?

 

Dimitar
Telerik team
 answered on 14 Feb 2019
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
Window
ListView
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
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?