Telerik Forums
UI for ASP.NET MVC Forum
3 answers
316 views

Hi,

 

I have a scheduler controle that I am showing 1 day on but I don;t want it to be a specific day I am using it to assign appointments for Monday, Tuesday, Wednesday, etc reardless of the actual date so I would like to hide the date selector, current date and the heading showing the current date as shown below:

If I could also affect the line height for the times that would be great too as they are a little tall currently.

Any help would be gratefully received.

Thanks,

 

Ian

Ian
Top achievements
Rank 1
Iron
 updated answer on 17 Nov 2023
2 answers
196 views

I am  using the PanelBar with Items Binding. I am LoadingContent on the Expansion of a Panel.  I would like to "refresh" or re load the content after a panel has been expanded, collapsed and then re-expanded.  Currently, the panel does not re-load the content.

 

Is there a way to force the panel to be re-loaded?

Antonio
Top achievements
Rank 1
Iron
 answered on 17 Nov 2023
1 answer
99 views

Hello,

we want to add editable fields in the template part of a grid.

Our grid looks sth. like this:

@( Html.Kendo().Grid(Model.TABLE) .Columns(columns => { columns.Bound(c => c.PRIO); columns.Bound(c => c.COMMENT); }) .DataSource(dataSource => dataSource .Ajax() ... .Model(m => { m.Id(p => p.ID); }) ) .ClientDetailTemplateId("template") .Editable(e => e.Mode(GridEditMode.InCell)) )

The template does look sth. like this:

<script id="template" type="text/x-kendo-template">
    <div class="col-md-6">
        <p><strong>Beschreibung:</strong></p>
        <p>#: stm_bez1 #</p>
        <p>#: stm_bez2 #</p>
        <p>#: stm_bez3 #</p>
        <p>#: stm_bez4 #</p>
        <p>#: stm_bez5 #</p>
        <p>#: stm_bez6 #</p>
        <p>#: rsc_text1 #</p>
        <p>#: rsc_text2 #</p>
        <p>#: rsc_text3 #</p>
        <p>#: rsc_text4 #</p>
        <p>#: rsc_text5 #</p>
        <p>#: rsc_text6 #</p>
    </div>
    @*
        HOW WOULD WE IMPLEMENT THE EDITABLE FIELDS HERE?
    *@
</script>

How would we go about putting these fields in the template part, and have them editable and propagate to the server on save?:

Eyup
Telerik team
 answered on 15 Nov 2023
1 answer
122 views

Hey, I'm trying to sort the data in the MultiSelectFor, so it can be displayed in alphabetical order.


                            @(Html.Kendo().MultiSelectFor(model => model.UserIds)
                                .HtmlAttributes(new { @class = "large" })
                                .Placeholder("Select users ...")
                                .DataValueField("Value")
                                .DataTextField("Text")
                                .AutoClose(false)
                                .DataSource(.DataSource(ds => ds.Read("AvailableUsers", "UserApi"))
                                 )

I've searched for this issue and tried some suggested things but with no success: 


                            @(Html.Kendo().MultiSelectFor(model => model.UserIds)
                                .HtmlAttributes(new { @class = "large" })
                                .Placeholder("Select users ...")
                                .DataValueField("Value")
                                .DataTextField("Text")
                                .AutoClose(false)
                                .DataSource(ds => ds.Custom()
                                            .Transport(t => t
                                                .Read(r => r
                                                    .Action("AvailableUsers", "UserApi")
                                                    .Data("{ any: false }")
                                                )
                                            )
                                            .Sort(s => s
                                                .Add("Value")
                                                .Descending()
                                            ))
                                
                            )


 public JsonResult AvailableUsers()
 {
     var userRepo = new UserRepository(ntfy);
    var result = userRepo.GetAll().Select(_ => new SelectListItem
           {
                Text = string.Format("{0} ({1} {2})", _.Username, _.Firstname, _.Lastname),
                Value = _.Id.ToString()
           });
     return this.Json(result, JsonRequestBehavior.AllowGet);
 }
Anton Mironov
Telerik team
 answered on 13 Nov 2023
1 answer
218 views
I've seen some examples for displaying a context menu and retrieving the data item of the row that was clicked, but is there a way to also determine which column of the grid was clicked when the context menu is displayed?
Anton Mironov
Telerik team
 answered on 10 Nov 2023
1 answer
73 views
When I updated to 2023.3.1010, the refresh button in the grid pager shows up as a pause icon. When I examine the page, the span is using k-i-arrow-rotate-cw. Is there a workaround for this?
Anton Mironov
Telerik team
 answered on 09 Nov 2023
1 answer
369 views

This problem was introduced when I upgraded to 2023.3.1010

 

The grid control renders it's pager like this:


<a aria-label="Refresh" class="k-pager-refresh k-link" href="/Home/Paging_Orders" title="Refresh">
     <span class="k-icon k-i-arrow-rotate-cw"></span>
</a>

Note the icon. If it was using FONT icons, it should have the class k-icon-font as well as the other classes.
If it was using SVG icons, it should have an embedded SVG inside it.

But it has neither, so there is nothing displayed at all.

I went to the online demonstration page https://demos.telerik.com/aspnet-mvc/grid/paging. Once you click the checkbox to display the refresh button, it renders the button correctly as an SVG icon.

<span class="k-icon k-svg-icon k-svg-i-arrow-rotate-cw k-button-icon">
      <svg aria-hidden="true" focusable="false" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M480 288c0 123.7-100.3 224-224 224S32 411.7 32 288 132.3 64 256 64V0l160 96-160 96v-64c-88.2 0-160 71.8-160 160s71.8 160 160 160 160-71.8 160-160c0-29.1-7.8-56.4-21.5-80l55.5-32c19.1 32.9 30 71.2 30 112z"></path></svg>
</span>

I do not understand what this demo is doing that my code is not.

Here is how I am creating the grid:


@( Html.Kendo().Grid<FromAspnetFrameworkTemplate.Models.OrderViewModel>() .Name("Grid") .Columns( columns => { columns.Bound(o => o.OrderID); columns.Bound(o => o.ContactName); columns.Bound(o => o.ShipAddress); columns.Bound(o => o.OrderDate).Format("{0:d}"); columns.Bound(o => o.ShipCountry); } ).Pageable( pager => pager.PageSizes(new[] { 10, 20, 30 }).Refresh(true).Responsive(false) ).DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("Paging_Orders", "Home")) ) )

 

I am using the following Nuget packages:

  • Telerik.UI.for.AspNet.Mvc5, 2023.3.1010
  • Telerik.FontIcons, 2.0.0
  • Telerik.SvgIcons, 2.0.0

I am including the styles and scripts like so:


<link href="https://kendo.cdn.telerik.com/themes/7.0.1/default/default-main.css" rel="stylesheet" />
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
<script src="~/Scripts/kendo/2023.3.1010/kendo.all.min.js"></script>
<script src="~/Scripts/kendo/2023.3.1010/kendo.aspnetmvc.min.js"></script>


Eyup
Telerik team
 answered on 03 Nov 2023
0 answers
95 views

Hello,

I was wondering if there is a way to change the asp.net mvc data grid checkbox selection option's image from a checkbox to say, a star.

Or would I need to essentially rebuild the functionality through a custom template?

 

Thanks

Jimmy
Top achievements
Rank 1
 asked on 02 Nov 2023
0 answers
79 views
I want to do some operation on columnsmenu click event of kendo ui fo mvc. Please suggest how we can handle that event and whats the event name in Jquery.
gaurav
Top achievements
Rank 1
 updated question on 02 Nov 2023
1 answer
334 views

Hi,

We have an export to Excel functionality implemented for Kendo MVC Grid. We have used Telerik.Documents.SpreadSheetProcessing and Kendo.MVC.Export libraries to achieve this functionality.
Followed the steps mentioned in this url :https://docs.telerik.com/aspnet-mvc/html-helpers/data-management/grid/export/server-export.

Now, this seems not working and we are receiving the below exception

System.InvalidOperationException: The workbook must have at least one worksheet.     at Telerik.Documents.SpreadsheetStreaming.Exporters.Xlsx.XlsxWorkbookExporterBase.CompleteWriteOverride()     at Telerik.Documents.SpreadsheetStreaming.Core.EntityBase.Dispose(Boolean disposing)     at Telerik.Documents.SpreadsheetStreaming.Core.EntityBase.Dispose()     at Kendo.Mvc.Export.Helpers.CollectionToStream(SpreadDocumentFormat format, IEnumerable data, IList`1 model, String title, Action`1 columnStyleAction, Action`1 rowStyleAction, Action`1 cellStyleAction)     at Kendo.Mvc.Export.ExportExtensions.ToXlsxStream(IEnumerable instance, IList`1 model, String title, Action`1 columnStyleAction, Action`1 rowStyleAction, Action`1 cellStyleAction)     at SGE.Aladdin.Web.Controllers.ReportController.<ExportWorkRequestListInExcel>d__273.MoveNext() in D:\Aladdin Dev Code\SGE.Aladdin.Web\Controllers\ReportController.cs:line 21500

Exception is getting triggered when we convert the list to ToXlsxStream. Not able to figure out what exactly has gone wrong. Sharing the code below:

Jquery code
--------------
 $("#btnExcelWrReport").click(function () {
            $('#WaitModal').modal('show');

            var grid = $("#WorkRequestListReport").data("kendoGrid");

            var currentdate = new Date();
            var filename = "WorkRequestReport_" + currentdate.getDate() +
                + (currentdate.getMonth() + 1) +
                + currentdate.getFullYear() +
                + currentdate.getHours() +
                + currentdate.getMinutes() +
                + currentdate.getSeconds();
            var options = {
                format: $(this).data("format"),
                title: filename
            }
            $("#export-data").val(encodeURIComponent(JSON.stringify(options)));
            $("#export-model").val(encodeURIComponent(JSON.stringify(grid.columns)));

            $("#frmdownload").submit();

        });

    $("#frmdownload").submit(function (event) {

        event.preventDefault();
        var actionURL = '@Url.Action("ExportWorkRequestListInExcel", "Report")';
        $('#WaitModal').modal('show');
        var postData = { model: $("#export-model").val(), data: $("#export-data").val() };

        $.ajax({
            url: actionURL,
            data: postData,
            type: 'POST',
            success: function (data) {
                    $('#WaitModal').modal('hide');
                    window.location.href = '@Url.Action("DownloadReportInExcel", "Report")?fileGuid=' + data.FileGuid + '&filename=' + data.FileName + '&mimeType=' + data.MimeType;
                @*if (data.FileGuid != "") {
                    $('#WaitModal').modal('hide');
                    window.location.href = '@Url.Action("DownloadReportInExcel", "Report")?fileGuid=' + data.FileGuid + '&filename=' + data.FileName + '&mimeType=' + data.MimeType;
                }
                else {
                      $('#WaitModal').modal('hide');
                    $('#MessageModal').modal('show');
                    $('#Message').html("@CommonResources.NoRecordsToExport");
                }*@
            }
        });
        return false;
    });

Controller
----------------

var columnsData = JsonConvert.DeserializeObject<IList<ExportColumnSettings>>(HttpUtility.UrlDecode(model));
                dynamic options = JsonConvert.DeserializeObject(HttpUtility.UrlDecode(data));
                SpreadDocumentFormat exportFormat = options.format.ToString() == "csv" ? exportFormat = SpreadDocumentFormat.Csv : exportFormat = SpreadDocumentFormat.Xlsx;
                Action<ExportCellStyle> wrReportCellStyle = new Action<ExportCellStyle>(ChangeWRReportCellStyle);


                string fileName = string.Format("{0}.{1}", options.title, options.format);
                string mimeType = Helpers.GetMimeType(exportFormat);
                Session["IsData"] = "0";
                var workRequestList= await GetExportWorkRequestList();

                int i = 0;
                while (Convert.ToString(Session["IsData"]) != "1")
                { 
                    i++;
                }


                string handle = Guid.NewGuid().ToString();
                string title = DateTime.Now.ToString();
                try {
                    title = options.title;
                }
                catch(Exception ex) { }
                Stream exportStream = exportFormat == SpreadDocumentFormat.Xlsx ? workRequestList.ToXlsxStream(columnsData, title, cellStyleAction: wrReportCellStyle) : workRequestList.ToCsvStream(columnsData);


                TempData[handle] = exportStream;
                return Json(new { FileGuid = handle, FileName = fileName, MimeType = mimeType });
            }
            catch (Exception ex)
            {
                ExceptionLogHelper.Log("ReportController", "ExportWorkRequestListInExcel", ex);
                return Json(new { FileGuid = string.Empty });

}

Please help me. I am not sure why this suddenly stopped working. In a different page, this same code works fine for an excel export.

                                                           
Anton Mironov
Telerik team
 answered on 30 Oct 2023
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
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
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
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?