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

Hi 

I dont know , what i am doing wrong while trying to clear all multiselect header filters, as after clearing all columns, somehow a null filter get set on a random header column. Below is my code

01.function clearFilter(filter,grid) {
02.       if (filter.filters) {
03.           for (var i = 0; i < filter.filters.length; i++) {
04.               clearFilter(filter.filters[i],grid);
05.           }
06.       }
07.       else {
08.           grid.dataSource.filter({
09.               field: filter.field,
10.               operator: filter.operator,
11.               value: ""
12.           });
13.       }
14.   }


Boyan Dimitrov
Telerik team
 answered on 26 Jun 2018
4 answers
173 views

Hello All,

I have attached my html code and output generated by this html code(Image.jpeg).
My requirement is the charts should be resized when the window resizes and it should come down in one straight line should not overlap on each other.

Kindly help me how can i achieve the requirement.It would be helpful/thankful if you can guide at earliest.

I would be very much thankful if anybody can create the charts with dummy data and display should be same as the .jpeg file which i attached in the zip file.

Current status of the html file is resizing is happening but it is overlapped on each other.
Thanks & Regards,
Sampath

Stamo Gochev
Telerik team
 answered on 26 Jun 2018
3 answers
624 views

Hello,

I have an issue about excel export with dates (only with chrome). I send 05/02/2018 (dd/MM/yyyy) 00:00:00 to the grid and this is the result in the excel file :

 

05/02/2018 00:00:21 (UTC+1)

05/02/2018 00:00:33 (UTC+5)

04/02/2018 23:59:22 (UTC-10)

 

My Workbook object is correct and it looks like the problem with seconds comes from the toDataURL function. It returns a different result between Firefox/Internet Explorer and Chrome.

 

Any Idea ?

Jef

Alex Hajigeorgieva
Telerik team
 answered on 25 Jun 2018
10 answers
726 views

Hi,

this is my grid

@(Html.Kendo().Grid<ProjectViewModel>()
      .Name("GridManagementProjects")
      .Columns(columns =>
      {
          columns.Bound(c => c.ProductID).Title("Product Id").Hidden();
          columns.Bound(c => c.ProductName).Title("Product Name").Hidden();
          columns.Bound(c => c.Name).Title("Name").Width(120)
                  .Filterable(f => f.UI("NamesProjectFilter")
                  .Mode(GridFilterMode.Row)
                  .Extra(false).Messages(m => m.Info("Show items with this name"))
                  .Operators(operators => operators
                  .ForString(str => str.Clear()
                  .IsEqualTo("Is equal to"))));
          columns.Bound(c => c.Leader.Name).EditorTemplateName("LeaderEditor").Title("Leader").Width(150)
                 .Filterable(f => f.UI("developersFilter")
                 .Mode(GridFilterMode.Row)
                 .Extra(false).Messages(m => m.Info("Show items with this leader"))
                 .Operators(operators => operators
                 .ForString(str => str.Clear()
                 .IsEqualTo("Is equal to"))));
          columns.Bound(c => c.CodeReviewer.Name).EditorTemplateName("CodeReviewerEditor").Title("Code Reviewer").Width(150)
                 .Filterable(f => f.UI("developersFilter")
                 .Mode(GridFilterMode.Row)
                 .Extra(false).Messages(m => m.Info("Show items with this code reviewer"))
                 .Operators(operators => operators
                 .ForString(str => str.Clear()
                 .IsEqualTo("Is equal to"))));
          columns.Bound(c => c.DevelopersDataSource).Width(200).ClientTemplate("#=DevelopersTemplate(DevelopersDataSource)#").EditorTemplateName("DevelopersEditor").Title("Developers")
                 .Filterable(f => f.UI("developersMultiFilter")
                 .Extra(false)
                 .Messages(m => m.Info("Show items contain these developers")))
                 .Sortable(false);
          columns.Bound(c => c.PercentCompleted).Title("Percent Completed").Width(130).ClientTemplate("<div style='width:94px; height:94px;'><canvas id='projectManagementChart_#=ID #' width='94' height='94' style='display: block; width: 94px; height: 94px;'></canvas></div>");
          columns.Bound(c => c.ActualStartDate).Title("Actual Start Date").Format("{0: MM/dd/yyyy}").Width(130);
          columns.Bound(c => c.ActualEndDate).Title("Actual End Date").Format("{0: MM/dd/yyyy}").Width(130);
          columns.Bound(c => c.EstimatedStartDate).Title("Estimated Start Date").EditorTemplateName("EstimatedStartDateEditor").Width(130).Format("{0: MM/dd/yyyy}");
          columns.Bound(c => c.EstimatedEndDate).Title("Estimated End Date").EditorTemplateName("EstimatedEndDateEditor").Width(130).Format("{0: MM/dd/yyyy}");
          columns.Bound(c => c.GitUrl).Title("Git Url").ClientTemplate("<a href='#= GitUrl #'>#= GitUrl #</a>").Width(120);
          columns.Bound(c => c.StageId).Title("Stage").EditorTemplateName("StageEditor")
                 .Filterable(f => f.Extra(false)
                 .Operators(operators => operators
                 .ForString(str => str.Clear()
                 .IsEqualTo("Is equal to"))))
                 .Width(110);
          columns.Bound(c => c.Description).Title("Description").Width(250).HtmlAttributes(new { @class = "customCell" });

          if (User.IsInRole("secSftwrProjMgmtDepl"))
          {
              columns.Bound(c => c.VstsBuildName).Title("Build Name").Width(120);
              columns.Bound(c => c.VstsRepository).Title("Repository").Width(120);
              columns.Bound(c => c.OctoProject).Title("Octopus Project").Width(120);
          }
          columns.Command(command =>
          {
              command.Custom("ADDTASK").Text("Add Task").Click("addTask");
              command.Custom("DeployProject").Click("DeployProject").Text("Deploy");
              if (User.IsInRole("secSftwrProjMgmtAdmn"))
              {
                  command.Custom("CompleteProject").Click("CompleteProject").Text("Complete");
              }
              command.Custom("ProjectRequirements").Text("Requirements").Click("addProjectConditions");
          }).Width(160).HtmlAttributes(new { id = "addTaskButton" });
          columns.Command(command => { command.Edit().UpdateText(" ").Text(" ").CancelText(" "); if (User.IsInRole("secSftwrProjMgmtAdmn")) { command.Destroy().Text(" "); } }).Width(150);

      })
      .Groupable(g => g.Enabled(false))
                      .Filterable()
                      .ToolBar(toolbar =>
                      {
                          if (User.IsInRole("secSftwrProjMgmtAdmn"))
                          {
                              toolbar.Template(@<text>
        <div class="toolbar" style="float:left">
            <a class="k-button k-button-icontext" onclick='addProjectAjax()' href="#">
                <span class="k-icon k-i-add"></span> ADD PROJECT
            </a>

            <a class="k-button k-grid-excel k-button-icontext" href="#">
                <span class="k-icon k-i-excel"></span>Export to Excel
            </a>
        </div>
                            </text>);
                          }
                          else
                              toolbar.Excel();
                      })
                            .Resizable(resize => resize.Columns(true))
                            .Editable(editable => editable.Mode(GridEditMode.InLine))
                            .Excel(excel => excel
                            .AllPages(true)
                            .FileName("Projects.xlsx")
                            .Filterable(true)
                            .ForceProxy(true)
                            .ProxyURL(Url.Action("FileExportSave", "Home")))
                            .Pageable(pager => pager
                            .Refresh(true)
                            .PageSizes(true)
                            .PageSizes(new int[] { 6, 15, 20 })
                            .ButtonCount(5))
                            .Sortable(sortable =>
                            {
                                sortable.SortMode(GridSortMode.MultipleColumn)
                                .Enabled(true);
                            })
                            .Scrollable()
                            .Events(events => events.FilterMenuOpen("onFilterMenuOpen").FilterMenuInit("FilterMenuInitProject").DataBound("onDataBoundSavedProjects").Cancel("createPieAfterCancellation").Edit("onProjectEdit").Save("onProjectSave").ExcelExport("exportProjects"))
                            .DataSource(dataSource => dataSource
                            .Ajax()
                            .Group(group => group.Add(p => p.ProductName))
                            .PageSize(20)
                            .Events(events => events.Error("errorHandlerProject"))
                            .Read(read => read.Action("GetSavedManagementProjects", "Project").Data("additionalData"))
                            .Model(model =>
                            {
                                model.Id(item => item.ID);
                                model.Field(a => a.ActualStartDate).Editable(false);
                                model.Field(a => a.ActualEndDate).Editable(false);
                                model.Field(a => a.PercentCompleted).Editable(false);
                            })
                            .Update(update => update.Action("UpdateProject", "Project").Data("serialize"))
                            .Destroy(update => update.Action("DeleteProject", "Project").Data("serialize"))))

 

 

 

 

 

 

I want filter by the group ("ProductName"), I don't want to present like a regular column, but I want that the user can use filter on this to find his group.

how can I do it?

thanks!

 

Tsvetina
Telerik team
 answered on 25 Jun 2018
4 answers
308 views

Hi All,

I am using 6-10 kendo charts in my project to display data,now i am stuck with the minimize and maximize of the window.How can we acheive chart size should be resized with the window resizes.Kindly help me in achieving.

Please revert back if you any questions.

 

Thanks & Regards,

Sampath

.

 

 

 

Stefan
Telerik team
 answered on 25 Jun 2018
3 answers
177 views
I'm having a lot of difficulty getting the cascading comboboxes functionality to work. These work as expected when they are independent, but the Child box remains disabled when set up as a cascade (uncommenting the CascadeFrom line). Any help would be appreciated!
 
@(Html.Kendo().ComboBox()
             .Name("Parent")
             .DataTextField("Text")
             .DataValueField("Value")
             .DataSource(source =>
             {
                 source.Read(read =>
                 {
                     read.Action("Cascading_Get_Parents", "Home");
                 })
                     .ServerFiltering(true);
             })
)
 
@(Html.Kendo().ComboBox()
                  .Name("Child")
                  .DataTextField("Text")
                  .DataValueField("Value")
                  //.CascadeFrom("Parent")
                  .DataSource(source =>
                  {
                      source.Read(read =>
                      {
                          read.Action("Cascading_Get_Children", "Home");
                      })
                      .ServerFiltering(true);
                  })
)
Neli
Telerik team
 answered on 22 Jun 2018
3 answers
105 views

I found a related question and answer, 
https://www.telerik.com/forums/kendo-date-picker-selection-by-class-name-with-jquery

 

That solution indeed works for datepickers, put the nesting of the drop down is different and I am unable to figure out what class references are required.

 

-Corey

Eyup
Telerik team
 answered on 22 Jun 2018
1 answer
200 views

On this site:

https://demos.telerik.com/aspnet-mvc/map/remote-marker

...you get us a nice example of using remote data in a map.

In this provided method you return a json file. How is this structured? I connot find any example.

public ActionResult _StoreLocations()
        {
            return Json(MapDataRepository.StoreLocations());
        } 
Georgi
Telerik team
 answered on 22 Jun 2018
3 answers
2.0K+ views

Hi,

I'm experimenting with the following grid and want to know if its possible to change the editor assosiated with the UserInputString column when the Field column value changes.

 

That is the Field column consists of a drop down list for example containing "Job Number", "Client", "Product" and other items. When the user selects, for example, Job Number the UserInputString editor is to be a TextBox. If Product is selected, the input will be a product auto complete text box, if 'Is Invoiced' is selected it will be a check box etc.

 

Is this possbile?

 

 

 @(Html.Kendo().Grid<S3Web.Models.AdvancedSearchModel>()
        .Name("grid")
        .Columns(columns =>
        {
          columns.Bound(p => p.AndOrString);
          columns.Bound(p => p.StartBracketString);
          columns.Bound(p => p.Field).Width(180);
          columns.Bound(p => p.OperatorString);
          columns.Bound(p => p.UserInputString);
          columns.Bound(p => p.EndBrackerString);
          columns.Command(command => command.Destroy()).Width(150);
        })
          .ToolBar(toolBar =>
          {
            toolBar.Create();
            toolBar.Save();
          })
        .Editable(editable => editable.Mode(GridEditMode.InCell))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Batch(true)
            .ServerOperation(false)
            .Events(events => events.Error("error_handler"))
            .PageSize(20)
            .Read(read => read.Action("AdvancedSearch_Read", "Jobs"))
            .Create(create => create.Action("AdvancedSearch_Create", "Jobs"))
            .Update(update => update.Action("AdvancedSearch_Update", "Jobs"))
            .Model(model =>
            {
              model.Id(p => p.Field);
            })
        )
  )

 

Preslav
Telerik team
 answered on 21 Jun 2018
15 answers
4.5K+ views
Hello. I am hoping to get some help here, I'm stuck. I am trying to get the value from my dropdown list to my controller to save back to the db but the value doesn't seem to come back with the post. 

My Model
namespace MDT.Models
{
    public class Vehicle
    {
        [Key]
        public int VehicleID { get; set; }
 
        public int UserID { get; set; }
 
        [Required]
        [StringLength(50)]
        public string Name { get; set; }
 
        public int MakeID { get; set; }
        public int ModelID { get; set; }
 
        [DisplayName("Color")]
        public int ColorID { get; set; }
 
        [Required]
        [StringLength(4)]
        public string StickerKey { get; set; }
 
        [DefaultValue(true)]
        public Boolean IsActive { get; set; }
 
        public virtual CarColor CarColor { get; set; }
    }
 
}

My Controller action for the udpate
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit(Vehicle vehicle)
{
    if (ModelState.IsValid)
    {
        db.Entry(vehicle).State = EntityState.Modified;
        db.SaveChanges();
        return RedirectToAction("Index");
    }
    return View(vehicle);
}
My Kendo drop down list definition in the cshtml
<div class="editor-label">
    @Html.LabelFor(model => model.ColorID)
</div>
<div class="editor-field">
    @*@Html.EditorFor(model => model.ColorID)*@
    @Html.ValidationMessageFor(model => model.ColorID)
 
    @(Html.Kendo().DropDownListFor(model => model.ColorID)
        .BindTo(ViewData["CarColors"] as SelectList)
        .Name("kendocarcolor")
        .Value(Model.ColorID.ToString()) 
        .OptionLabel("Select a Color")             
    )
</div>

When I perform the save for the above, the ColorID comes back at zero. Shouldn't it be getting passed back with the updated model for the post? I also have noticed that my validator for the ColorID is not working for the Kendo Dropdown list but if I uncomment the EditorFor, it does work on that control.

If you could please help me with the following it would be greatly appreciated:

1) Why doesn't the dropdownlist come back with my updated model value to my controller?
2) Any ideas why the validator doesn't work?
3) Did I populate the dropdownlist the most efficent way using ViewData? How would you do it?

THANK YOU very much in advance.

Ivan Danchev
Telerik team
 answered on 21 Jun 2018
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
DropDownButton
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
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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?