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

Hi

I am trying to make the scheduler, day week and month views to fit only a single screen without needing to horizontally scroll. But each day takes up 50% of the screen and its totally unnecessary wasting of the screen space.

Google searches dont give me results, or tell me that it cannot be done.. AND YET, every single demo on the telerik website perfectly fits into a div that takes up 80% of the width of the screen. So its possible, dont tell me it is not. 

How?

Here is some code:

cshtml file:

@model project.models.schedulerModel @using Kendo.Mvc.UI <div id="appointmentCalenderContainer" class="calenderContainer"> @( Html.Kendo().Scheduler<SchedulerModelTaskViewModel>() .Name("appointmentsCalender") .Width(1880) .Height(820) .Editable(true) .AllDaySlot(false) .EventTemplate("<div class='eventBox'><div class='eventInner'><span>#= title #</span></div><div class='eventInner'><span>#= description #</span></div></div>") .Views(views => { views.DayView(x => x.Selected(true)); views.WeekView(); views.MonthView(); }) .DataSource(d => d .Model(m => { m.Id(f => f.TaskID); }) .Read("Read", "CitizenDashboard") .Create("Create", "CitizenDashboard") .Destroy("Destroy", "CitizenDashboard") .Update("Update", "CitizenDashboard") ) ) </div>

Attila
Top achievements
Rank 1
Iron
 answered on 15 Jun 2021
1 answer
6 views
Displaying broken German umlauts in standalone Telerik Reporting Designer. I get this data from Postgres datasource to textboxes and table values, but on a preview and in pdf file shows incorrect symbols of German language. How can I fix that?. Thanks.
artur
Top achievements
Rank 1
Iron
 answered on 08 Jun 2021
4 answers
537 views
Hi,

I want to load the grid either or both the below ways:
1. On change (selected index changed) event of DropDownList. The selected value from dropdown should be passed to grid and based on it grid should display result.
2. On click of the button event. The selected value from dropdown should be passed to grid on button click and based on it grid should display result.

Do we have any kind of example which shows meets my above requirements or any kind of lead that I look into it will be very helpful.

Thanks,
Nirav
Eyup
Telerik team
 answered on 07 Jun 2021
3 answers
13 views

Good day guys,

how possible is this, to send input textbox value to autocomplete textbox while typing. and the autocomplete should be set to readonly.

see attached image

kind regards

 

Tony
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 07 Jun 2021
2 answers
28 views

Hello, 

I want to Fetch all files in a local Folder (Directory) and populate file names and present them in my view page as a drop down list.

taking the name of the file selected and save it in my table as a string value.

any suggestions please ?

Thank you in advance.

Wassim
Top achievements
Rank 1
Iron
 answered on 04 Jun 2021
1 answer
10 views

I check on site some examples for drag-drop in diagram bug that is only available for ASP.Net AJAX but I need them in ASP.NET MVC. I attached a link as well for reference.

https://demos.telerik.com/aspnet-ajax/diagram/examples/interactions/defaultcs.aspx

So, anybody helps me that it is available for ASP.NET MVC or not.

Ivan Danchev
Telerik team
 answered on 03 Jun 2021
1 answer
11 views

When I dynamically add in a column and set the title the order in the column filter is wrong. Clicking on "1" in the Column filter disabled "4" which is the 5th column in the loop. However if I remove the Title, then it works as expected. I need to set the Title for my usage. Originally I tried setting the title to an actual text value but that is when I found the order was messed up.


            @(Html.Kendo().Grid<InventoryItemViewModel>()
    .Name("InventoryItemGrid")
    .Columns(columns =>
    {
    columns.Bound(c => c.InventoryItemId).Title("ID").ClientTemplate("#=kendo.toString(InventoryItemId, '000000')#").Media("(min-width: 1200px)").Filterable(ftb => ftb.Multi(true));
    columns.Bound(c => c.Name).Media("(min-width: 1200px)").Filterable(ftb => ftb.Multi(true));
    columns.Bound(c => c.Description).Title("Description").Media("(min-width: 1200px)").Filterable(ftb => ftb.Multi(true));
    columns.Bound(c => c.InventoryItemTypeName).Title("Type").Media("(min-width: 1200px)").Filterable(ftb => ftb.Multi(true));
    columns.Bound(c => c.WetTonnes).ClientTemplate("<span class='source-#=WetTonnesSource#'>#=WetTonnes#</span>").Media("(min-width: 1200px)");
    columns.Bound(c => c.MoisturePercent).ClientTemplate("<span class='source-#=MoisturePercentSource#'>#=MoisturePercent#</span>").Media("(min-width: 1200px)");
    columns.Bound(c => c.CoarseFineRatio).ClientTemplate("<span class='source-#CoarseFineRatioSource#'>#=CoarseFineRatio#</span>").Title("Coarse Percentage").Media("(min-width: 1200px)");
    for (int x = 0; x < 6; x++)
    {
        columns.Bound(c => x).Title(x.ToString()).ClientTemplate(x.ToString());
    }


    columns.Bound(c => c.IsBlended).Media("(min-width: 1200px)").Filterable(ftb => ftb.Multi(true));
    columns.Bound(c => c.Status).ClientTemplate("#=statusTemplate(data)#").Media("(min-width: 1200px)").Filterable(ftb => ftb.Multi(true));

    columns.Bound(c => c.CreatedDate).Media("(min-width: 1200px)").Format("{0:g}").Hidden(true);
    columns.Bound(c => c.CreatedBy).Media("(min-width: 1200px)").Hidden(true);
    columns.Bound(c => c.LastUpdatedDate).Media("(min-width: 1200px)").Format("{0:g}").Hidden(true);
    columns.Bound(c => c.LastUpdatedBy).Media("(min-width: 1200px)").Hidden(true);
    columns.Template(@<text></text>).ClientTemplate("#=resColTemplate(data)#").Title("Details").Media("(max-width: 1200px)");
    })
    .Sortable()
    .Scrollable(s=>s.Height("auto"))
    .Filterable()
    .ColumnMenu(c=>c.Columns(true))
    .Excel(excel => excel
        .FileName("Inventory Item Export.xlsx")
        .Filterable(true)
        .AllPages(true)
        .ProxyURL(Url.Action("Excel_Export_Save", "InventoryItems"))
    )
    .ToolBar(t=>
    {

        t.Template(@<text>
            <div class="toolbar">
                 <label class="k-grid-title-label">Items</label>
<div class="k-grid-toolbar-btns">
<button type="button" class="btn btn-secondary btn-sm" id="ExcludeFilter" data-exclude-state="excluded">
<i class="fa fa-filter" aria-hidden="true"></i>
Exclude Archived
</button>
                     <button id="export" class="btn btn-secondary btn-sm"><i class="fas fa-file-excel"></i></button>
@if (PLS.Library.Authorize.AuthorizeUser(PLS.Models.Enum.AccessLevel.Create, PLS.Models.Enum.SystemSection.Inventory))
{
<a class="btn btn-primary btn-sm"  href="@Url.Action("Create", "InventoryItems", new { Area = "Inventory" })">
Create
</a>
}
</div>
<div class="k-grid-toolbar-search">
<span class="k-textbox k-grid-search k-display-flex">
<input autocomplete="off" placeholder="Search..." title="Search..." class="k-input">
<span class="k-input-icon"><i class="fa fa-search" aria-hidden="true"></i></span>
</span>
</div>
           </div>
            </text>);
    })
    .Search(search =>
    {
        search.Field(f => f.InventoryItemId);
        search.Field(f => f.Name);
        search.Field(f => f.Description);
        search.Field(f => f.InventoryItemTypeName);
        search.Field(f => f.Status);
        search.Field(f => f.WetTonnes);
        search.Field(f => f.CoarseFineRatio);
        search.Field(f => f.MoisturePercent);
    })
    .Pageable(pageable => pageable
        .Refresh(true)
        .PageSizes(true)
        .ButtonCount(5)
    )
    .Selectable(selectable =>
    {
        selectable.Mode(GridSelectionMode.Single);
        selectable.Type(GridSelectionType.Row);
    })
    .Resizable(resize => resize.Columns(true))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("InventoryItems_Read", "InventoryItems"))
        .Sort(sort =>
        {
            sort.Add(f => f.StatusId).Ascending();
            sort.Add(f => f.CreatedDate).Ascending();
        })
        .PageSize(10).ServerOperation(false)
        .Filter(f => f.Add(x => x.Status).IsNotEqualTo("Archived"))
    )
)


 

Anton Mironov
Telerik team
 answered on 02 Jun 2021
1 answer
17 views

About 40% of the time our build fails with a bunch of errors like below


 Response status code does not indicate success: 500 (Internal Server Error).
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='System.Diagnostics.StackTrace'&semVerLevel=2.0.0'.
  Response status code does not indicate success: 500 (Internal Server Error).
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='System.Xml.XmlDocument'&semVerLevel=2.0.0'.
  Response status code does not indicate success: 500 (Internal Server Error).
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='System.Xml.XDocument'&semVerLevel=2.0.0'.
  Response status code does not indicate success: 500 (Internal Server Error).
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='System.Reflection.Emit.ILGeneration'&semVerLevel=2.0.0'.
  Response status code does not indicate success: 500 (Internal Server Error).
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='System.Composition.TypedParts'&semVerLevel=2.0.0'.
  Response status code does not indicate success: 500 (Internal Server Error).
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='System.Configuration.ConfigurationManager'&semVerLevel=2.0.0'.
  Response status code does not indicate success: 500 (Internal Server Error).

Note it doesnt always happen. Any idea how to troubleshoot this? 

Thanks

 

Ivan Danchev
Telerik team
 answered on 01 Jun 2021
1 answer
11 views

I have a grid which has ServerOperations set to TRUE.  The total number of records is very large, so we're only displaying 20 at a time.  One of the columns contains a filter dropdown containing a list of checkboxes for selecting specific values to filter on.  I want the Filter dropdown to include ALL possible values for the user to choose from...not just the ones that are returned for each page.  Is there a recommended approach for doing this?  (I have provided the grid initialization code below...)

 

                @(Html.Kendo().Grid<MemberPopCodeModel>()
                 .AutoBind(false)
                 .Name("MemberPopCodeGrid")
                 .HtmlAttributes(new { @class = "editor-grid" })
                 .Columns(columns =>
                 {
                     columns.Bound(e => e.PopCode.FormattedText).Filterable(ftb => ftb.Multi(true).CheckAll(true).Search(true).BindTo(memberPopCodeListItems)).Sortable(true)
                            .HtmlAttributes(new { @class = "ellipsis-nowrap", title = "#= PopCode.FormattedText #" })
                            .HeaderHtmlAttributes(new { @title = HtmlLocaleHelper.GetLabelTooltip(ManagedCareConstants.Localization.Labels.Fields.PopCode).ToString() })
                            .Title(HtmlLocaleHelper.GetLabelText(ManagedCareConstants.Localization.Labels.Fields.PopCode).ToHtmlString());
                     columns.Bound(e => e.EffectiveDate).ClientTemplate("#= formatReceivedDate(StrEffectiveDate) #").Filterable(true).Sortable(true)
                             .HtmlAttributes(new { @class = "ellipsis-nowrap", title = "#= kendo.format('{0:d}', kendo.parseDate(StrEffectiveDate)) #" })
                             .Filterable(a => a.UI("datePicker"))
                             .HeaderHtmlAttributes(new { @title = HtmlLocaleHelper.GetLabelTooltip(ManagedCareConstants.Localization.Labels.Fields.MemberPopCodeEffectiveDate).ToString() })
                             .Title(HtmlLocaleHelper.GetLabelText(ManagedCareConstants.Localization.Labels.Fields.MemberPopCodeEffectiveDate).ToHtmlString());
                     columns.Bound(e => e.EndDate).ClientTemplate("#= formatReceivedDate(StrEndDate) #").Filterable(true).Sortable(true)
                             .HtmlAttributes(new { @class = "ellipsis-nowrap", title = "#= kendo.format('{0:d}', kendo.parseDate(StrEndDate)) #" })
                             .Filterable(a => a.UI("datePicker"))
                             .HeaderHtmlAttributes(new { @title = HtmlLocaleHelper.GetLabelTooltip(ManagedCareConstants.Localization.Labels.Fields.MemberPopCodeEndDate).ToString() })
                             .Title(HtmlLocaleHelper.GetLabelText(ManagedCareConstants.Localization.Labels.Fields.MemberPopCodeEndDate).ToHtmlString());
                     columns.Bound(e => e.Status).Filterable(ftb => ftb.Multi(true).CheckAll(true).BindTo(new[]{
                                                  new { Status = statusCurrent },
                                                  new { Status = statusFuture },
                                                  new { Status = statusPast },
                                                  new { Status = statusInvalid }
})
                     ).Sortable(false)
                             .HeaderHtmlAttributes(new { @title = HtmlLocaleHelper.GetLabelTooltip(ManagedCareConstants.Localization.Labels.Fields.GlobalPeriodStatus).ToString() })
                             .Title(HtmlLocaleHelper.GetLabelText(ManagedCareConstants.Localization.Labels.Fields.GlobalPeriodStatus).ToHtmlString());
                 })
.Scrollable()
.Resizable(r => r.Columns(true))
.Sortable(s => s
.AllowUnsort(false)
.SortMode(GridSortMode.SingleColumn))
.Events(e => e
.DataBound("popCodeGridDataBound")
.DataBinding("popCodeGridDataBinding")
.FilterMenuInit("onFilterMenuInit")
)
.Filterable(filterable => filterable
.Extra(false)
.Messages(msg => msg.Clear(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.Operators.Clear).ToString()))
.Operators(operators => operators
.ForDate(date => date.Clear()
    .IsEqualTo(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.Operators.EqualTo).ToString())
    .IsGreaterThanOrEqualTo(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.Operators.GreaterThanOrEqualTo).ToString())
    .IsLessThanOrEqualTo(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.Operators.LessThanOrEqualTo).ToString())
    )
)
)
.DataSource(d => d.Ajax()
.ServerOperation(true)
.Events(e => e.Error("onWebApiError"))
.Read(read => read.Url(
ContextHelper.BuildWebApiUrl(ManagedCareConstants.WebApi.Controllers.ManagedCare, ManagedCareConstants.WebApi.Actions.GetMemberPopCode)
).Type(HttpVerbs.Get)
)
.Model(m => m.Id(e => e.PopCodeId))
.Sort(s =>
{
    s.Add("EndDate").Descending();
    s.Add("EffectiveDate").Descending();
    s.Add("PopCode.FormattedText").Ascending();
})
)
.Pageable(pageable => pageable
    .Refresh(true)
    .PageSizes(true)
    .ButtonCount(3)
    .Messages(messages =>
    {
        messages.ItemsPerPage(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.ItemsPerPage).ToString().Trim());
        messages.Next(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.NextPage).ToString().Trim());
        messages.Last(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.LastPage).ToString().Trim());
        messages.Previous(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.PreviousPage).ToString().Trim());
        messages.First(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.FirstPage).ToString().Trim());
        messages.Refresh(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.Refresh).ToString().Trim());
        messages.Display(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.Display).ToString().Trim());
        messages.MorePages(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.MorePages).ToString().Trim());
        messages.Empty(HtmlLocaleHelper.GetLabelText(CoreConstants.Localization.Labels.Grid.Empty).ToString().Trim());
    })
)
.Resizable(r => r.Columns(true))
.Scrollable()
.Selectable(se => se.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
.Sortable(s => s
.AllowUnsort(false)
.SortMode(GridSortMode.SingleColumn)
)
.Selectable(se => se.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
    )
Anton Mironov
Telerik team
 answered on 31 May 2021
2 answers
132 views
I am trying perform batch editing in kendo grid.

My remote validation is not working properly

In Page source it show all the attributes related to remote validation

<input data-bind="value:Name" class="text-box single-line" data-val="true" data-val-length="Name cannot exceed 100 characters." data-val-length-max="100" data-val-remote="Option name already exist" data-val-remote-additionalfields="*.Name,*.Id,*.ParentOptionId" data-val-remote-url="/Options/OptionNameUnique" data-val-required="The Name field is required." id="Name" name="Name" value="" type="text">


Still remote validation not getting called.
Anton Mironov
Telerik team
 answered on 31 May 2021