Telerik Forums
UI for ASP.NET MVC Forum
0 answers
142 views
I have a grid, I have enabled the InCell editing, I want to edit the multiple cells and on a Save button click, I want to validate all the grid data and show the error messages as tooltip (which is shown on validation error) for the respective cells. It should only allow to Save data if all the validations are passed.
Vivek
Top achievements
Rank 1
Iron
 asked on 12 Aug 2021
1 answer
219 views

I have a case where i need to dynamically clone the switch control and use it.
 Im able to clone the switch but the script still refers to the original control .

Tried changing  the id and name properties but still not able to achieve it .

Can anyone let me know how to do it .(FYI im not using mobileswitch)

Thanks in advance.

Anton Mironov
Telerik team
 answered on 12 Aug 2021
1 answer
203 views

Hi,

I have a business requirement to be displayed 100+ bar charts with lines on one page itself while hitting the page. 

Can you please help to do that dynamically?  I'm very much new to this Kendo UI control. 

 

--

Thanks

Ramesh

 

Anton Mironov
Telerik team
 answered on 11 Aug 2021
1 answer
522 views

I want the sum of two columns to be added to another column in the kendo grid. Now it is showing that NaN when I use ClientTemplate whereas in the case of ClientGroupColumnTemplate shows the correct result. In my case, I want the result in another column instead of a group column any help?

.Columns(c =>

    {  c.Bound(p => p.field1).Title("F1");
       c.Bound(p => p.field2).Title("F2");
       c.Bound(p => p.Total).Title("Total").ClientTemplate("#=calculate(data)#");
})

<script>
    function calculate(data) {
        field1 + p.field2;
        return result;

</script>
Anton Mironov
Telerik team
 answered on 11 Aug 2021
1 answer
2.5K+ views

Hello,

Could someone provide sample code for export Grid data to excel?  below is the requirement:

1. This is MVC project

2. Kendo Grid with many pages in the View.

3. button located in the view but not located in the toolbar section of the Grid.

4. When click button, all Grid data (not just View data)  should export to excel file.

 

Thanks.

 

Anton Mironov
Telerik team
 answered on 10 Aug 2021
1 answer
237 views

Hello, 

I try to get dataSource from my MVC project but got syntax error. Could someone tell me what's wrong? Thanks.

Action method on MyController:

        public JsonResult Position_Read()
        {
                var entity = new PositionViewModel
                {
                   POS_ID = "10000",
                   POS_TYPE="INTER",
                   CREATE_DT = DateTime.Now
                };

                return Json(entity);
          }

 

JavaScript in View:

 <script>

        function GetServerSourceData() {
            var ds = new kendo.data.DataSource({
                type: "odata",
                transport: {
                    read: "/MySite/MyController/Position_Read"
                },
                schema: {
                    model: {
                        fields: {
                            POS_ID: { type: "string" }, 
                            POS_TYPE: { type: "string" }
    CREATE_DT: { type: "date" },
                        }
                    }
                }
            });
            return ds;
        } 

 </script>

                         
Anton Mironov
Telerik team
 answered on 10 Aug 2021
0 answers
172 views

I have added custom validation on the grid for multiple columns. It's working as expected. The only problem I am facing is that the tooltip position is not pointing to the current cell, it is pointing to different cells in the same row for all columns. How can I fix it?

 


columns.Bound(config => config.X).Title("X").HeaderHtmlAttributes(new { @class = "grid-headercustom" }).
ClientTemplate("#if(data.X == 1)" + "{#<span>Y</span>#}" + "else{#<span>N</span>#}#").
HtmlAttributes(new { @class = "grid-rowcustom" }).HtmlAttributes(new { style = "font-size:12px" }).Filterable(ftb => ftb.Enabled(false));


$.extend(true, kendo.ui.validator, {
    rules: {
        RateV: function (input, params) {
            if (input.is("[name='X']")) {
                var grid = $("#grid-pricefeedconfiguration").data("kendoGrid");
                var row = input.closest("tr");
                var dataItem = grid.dataItem(row);
                if (dataItem.X == true && dataItem.Y <= 0) {
                    input.attr("data-RateV-msg", "X must be greater than zero when the Y is ticked");
                    return false;
                }
            }
            
            return true;
            }
        },
        messages: {
            RateV: function (input) {
                // return the message text
                return input.attr("data-val-X");
            }
        }
    });
})(jQuery, kendo);
I have attached the screenshot. It should point to checkbox cell but it is pointing to other column which has value 0.
Vivek
Top achievements
Rank 1
Iron
 asked on 09 Aug 2021
1 answer
2.5K+ views

I have a checkbox in a grid that I want to conditionally disable. What I have below technically hides the checkbox (haven't figured out how to conditionally 'disable') but you can still click in the box and the checkbox will appear even if it does not meet the condition:

@(Html.Kendo().Grid<SomeUI.Areas.UVL.Models.SomePOModel> ().Name("SomePOgrid") .Columns(columns => { columns.Bound(p => p.forceClose).Title("Force Close") .ClientTemplate("#if(status == 'Pending'){# <input id='forceClose' value='#=forceClose#' class='k-checkbox' type='checkbox' checked='checked'/> #}#") .Width(170).HtmlAttributes(new { style = "text-align:center;" });

})

Wondering if you have a better or solution or if someone can explain what I am missing. Thanks.
Ivan Danchev
Telerik team
 answered on 09 Aug 2021
0 answers
175 views

Hello,

I am using Kendo for Asp.Net MVC.  With an ImageBrowser on the Editor control, the name returned from the server (which is different from the file name uploaded) is respected, but for the FileBrowser, the returned name is ignored.  How does on get this to work?

    

<PackageReferenceInclude="Telerik.UI.for.AspNet.Core"Version="2021.2.616"/>

 

   
  @(Html.Kendo().Editor()
    .Name(Model.Id)
    .HtmlAttributes(new { style = "height:470px", aria_label = "editor" })
    .Tools(tools => tools
      .Clear()
      .Bold().Italic().Underline().Strikethrough().JustifyLeft().JustifyCenter()
      .JustifyRight().JustifyFull().InsertUnorderedList().InsertOrderedList().Outdent().Indent()
      .CreateLink().Unlink().InsertImage()
      .InsertFile()//.SubScript()//.SuperScript()//.TableEditing()
      .ViewHtml().Formatting().CleanFormatting()
      )
    .ImageBrowser(
      imageBrowser => imageBrowser
        .Transport(transport =>
        {
          transport.Read(r => r.Url($"/api/imageupload/read?franchiseId={Model.FranchiseId}"));
          transport.Create(c => c.Url("/api/imageupload/create"));
          transport.Destroy(d => d.Url("/api/imageupload/destroy"));
          transport.UploadUrl($"/api/imageupload/uploadurl?franchiseId={Model.FranchiseId}");
          transport.ImageUrl("/api/imageupload/imageurl?file={0}");
          transport.ThumbnailUrl("/api/imageupload/thumbnailurl");
        }
        )
        .Schema(schema => schema.Model(
            model => model.Fields(fields => fields
                .Name(name => name.Field("Name"))
                .Size(size => size.Field("Size"))
                .Type(type => type.Field("EntryType"))
                )
            )
        )
    )
    .FileBrowser(
      fileBrowser => fileBrowser
        .Transport(transport =>
        {
          transport.Read(r => r.Url($"/api/docupload/read?franchiseId={Model.FranchiseId}"));
          transport.Create(c => c.Url("/api/docupload/create"));
          transport.Destroy(d => d.Url("/api/docupload/destroy"));
          transport.UploadUrl($"/api/docupload/uploadurl?franchiseId={Model.FranchiseId}");
        }
        )
        .Schema(schema => schema.Model(
            model => model.Fields(fields => fields
                .Name(name => name.Field("Name"))
                .Size(size => size.Field("Size"))
                .Type(type => type.Field("EntryType"))
                )
            )
        )
    )
    .Value(Model.Value)
  )
Burton
Top achievements
Rank 1
 updated question on 09 Aug 2021
0 answers
328 views

I have aKendo Grid, I have added custom validation on multiple columns. It's working as expected for all the columns, though it's not working for the columns of the type checkbox. It shows the error message even if the checkbox is unchecked.


columns.Bound(config => config.X).Title("X").HeaderHtmlAttributes(new { @class = "grid-headercustom" }).
ClientTemplate("#if(data.X == 1)" + "{#<span>Y</span>#}" + "else{#<span>N</span>#}#").
HtmlAttributes(new { @class = "grid-rowcustom" }).HtmlAttributes(new { style = "font-size:12px" }).Filterable(ftb => ftb.Enabled(false));


$.extend(true, kendo.ui.validator, {
    rules: {
        RateV: function (input, params) {
            if (input.is("[name='X']")) {
                var grid = $("#grid-pricefeedconfiguration").data("kendoGrid");
                var row = input.closest("tr");
                var dataItem = grid.dataItem(row);
                if (dataItem.X == true && dataItem.Y <= 0) {
                    input.attr("data-RateV-msg", "X must be greater than zero when the Y is ticked");
                    return false;
                }
            }
            
            return true;
            }
        },
        messages: {
            RateV: function (input) {
                // return the message text
                return input.attr("data-val-X");
            }
        }
    });
})(jQuery, kendo);

Vivek
Top achievements
Rank 1
Iron
 asked on 07 Aug 2021
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?