Telerik Forums
UI for ASP.NET Core Forum
1 answer
123 views

 want to have a filter row in my grid but only display the filter for some columns.  How can i do this?

 

ALSO .. how do I decide whether it is a textbox, calendar or numeric data entry?

 

Also .. can a date range be specified?

Eyup
Telerik team
 answered on 23 Apr 2021
1 answer
469 views

I'm using the RadioGroup and setting the for to a string property in my page model.  The Get is working fine with displaying the value in the model but when I save the form, in the post the for value is null.  Any ideas on how to get this to work?

Razor Page

<kendo-radiogroup for="Input.OwnOrRentId"
    label-position="RadioGroupLabelPosition.Before"
    layout="RadioGroupLayout.Horizontal" bind-to="Model.OwnOrRentItems">
</kendo-radiogroup>

 

Code behind

  [BindProperty]
   public InstallerPageModel Input { get; set; }

 

 public List<IInputGroupItem> OwnOrRentItems { get; set; }
 
        OwnOrRentItems = new List<IInputGroupItem>()
        {
            new InputGroupItemModel()
            {
                Label = OwnOrRentOptions.Own.GetDescription(),
                Value = OwnOrRentOptions.Own.NumericValue().ToString(),
                Enabled = true,
                CssClass = "green",
                Encoded = false,
                HtmlAttributes = new Dictionary<string,object>() { { "data-custom", "custom" } }
            },
            new InputGroupItemModel()
            {
                Label = OwnOrRentOptions.Rent.GetDescription(),
                Value = OwnOrRentOptions.Rent.NumericValue().ToString(),
                Enabled = true,
                CssClass = "green",
                Encoded = false,
                HtmlAttributes = new Dictionary<string,object>() { { "data-custom", "custom" } }                   
            }
        };
 
   public class InputGroupItemModel :IInputGroupItem
   {
    public IDictionary<string, object> HtmlAttributes { get; set; }
 
    public string CssClass { get; set; }
 
    public bool? Enabled { get; set; }
 
    public bool? Encoded { get; set; }
 
    public string Label { get; set; }
 
    public string Value { get; set; }
   }

 

 

Veselin Tsvetanov
Telerik team
 answered on 23 Apr 2021
1 answer
130 views

I have following DropDownListFor in a grid column

@{
    var selecItems = Enum.GetValues(typeof(Something)).OfType<Something>().Select(item => new
    {
        Text = item.Localize(),
        Value = item
     });
}
@(Html.Kendo().DropDownListFor(m => m)
            .DataTextField("Text")
            .DataValueField("Value")
            .BindTo(selecItems))

on the following column I have a MultiSelectFor. When user select an option from DropDownListFor must change MultiSelectFor datasource. Its possible?

Ianko
Telerik team
 answered on 22 Apr 2021
1 answer
513 views

Dear Admin,

I need to bind dynamically data model one by one in kendo title layout. I couldn't found any data source binding or any other ajax binding.

i have get list from controller in model collection i couldn't bind data using bodytemplate or BodyTemplateId.

Any one help me? I have share attached file with you to understand my code and help me for better solution.

 

Please provide solution in .net core because i am using .net core 3.1

 

 

Angel Petrov
Telerik team
 answered on 22 Apr 2021
1 answer
164 views
I have Master Detail items and would like to use a Hierarchy.  Is there an easy way to CRUD both Mater and Detail items.  I would must prefer to use builtin functionality than develop some.  Can people suggest good solutions.
Eyup
Telerik team
 answered on 21 Apr 2021
1 answer
1.3K+ views
How do I make some Core Grid columns editable and some readonly?
Mihaela
Telerik team
 answered on 20 Apr 2021
7 answers
247 views

I'm facing really strange behavior run core mvc app on Ipad chrome/edge browser on Ipad. This happen for all grids in the app. 

I get the following error:

kendo.all.js:67733 Uncaught TypeError: Cannot read property 'rows' of null  
at init._scrollable (kendo.all.js:67733)<br>   
at init._thead (kendo.all.js:69496)<br>   
at init._continueInit (kendo.all.js:63660)

...

 

I haven't at the moment touched any k-* styles for the grids.

The same grids work very fine in the desktop browsers (and in Ipad Safari).

FYI: The problem can be reproduced also using Edge development tools on desktop simulating mobile browser.

Any advise?

 

Tsvetomir
Telerik team
 answered on 20 Apr 2021
4 answers
703 views

Hi Progress,

Im currently trying to develop an grid view through your beautifully developed Kendo grid. 

The grid is displayed properly with the grid displaying the enum value as i wish. However i have stumbled upon a problem when using the GridEditMode.PopUp.

When pressing Add new Feature the option i can choose is the Enums key, not the value. My wish is to make an dropdown list of these enums for available features an user can choose from. And not the Key. 

I will supply my code here. 

@(Html.Kendo().Grid<X.Administration.UI.Models.FeaturesGridViewModel>
    ()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id).Hidden();
        columns.Bound(p => p.Tag);
    })
    .ToolBar(toolbar => toolbar.Create().Text("Add new feature"))
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
    .Ajax()
    .PageSize(10)
    .Events(events => events.Error("error_handler"))
    .Model(model => model.Id(p => p.Id))
    .Read(read => read.Action("GetFeaturesByCarId", "Grid", new {id = @Model.Id}))
    .Update(update => update.Action("AddFeatureByVehicleId", "Feature", new { id = @Model.Id }))
    )
    )

Iv'e attached files displaying how it looks now, and what i wish for. My wish is to have an Html.Kendo().DropDownList() in my popup, when adding an entry. However i am not able to create one in my GridEditMode.PopUp. 

The result im looking for is similar to that of an Kendo drop down list. However iv'e been unable to locate an example in in the forums for ASP.NET CORE, using an dropdown of all available enums.

 

 

 

 

Mihaela
Telerik team
 answered on 19 Apr 2021
7 answers
1.6K+ views

Hello, im basically trying to do the Sorting/Paging/Filtering in my WebApi instead of the WebApp. 

Im trying to send the DataSourceRequest with a Http-Request to my WebAPI which works as long I dont add a filter. If I add a Filter I get the following error

Could not create an instance of type Telerik.DataSource.FilterDescriptor. Type is an interface or abstract class and cannot be instantiated.

 

If my DataSourceRequest does not contain a Filter (e.g just sortings) everything works perfectly.

How I send the DataSourceRequest to my WebAPI : 

var client = new RestClient($"{api.Address}:{api.Port}/api/v1");
var rr = new RestRequest("tmp/HelloWorld",Method.POST);
rr.AddHeader("Content-Type", "application/json; charset=utf-8");
rr.AddJsonBody(request); // Request is the DataSourceRequest that get passed to my Method
var result = client.Execute(rr, Method.POST);

 

My WebApi Function

public ActionResult<IEnumerable<TmpDTO>> HelloWorld([FromBody] DataSourceRequest request)
{
// do Something here
}

 

However my API never gets called when the DataSourceRequest contains a FilterDescriptor.

I saw a few threads (usually a few years old) and a few examples but I havent seen'n a single example on how to serialize the FilterDescriptors. Is this even possible? I just need the entire DataSourceRequest in my WebAPI

 

Thanks in advance. 

Neli
Telerik team
 answered on 16 Apr 2021
3 answers
211 views

I am trying to use a ViewComponent to encapsulate a simple dataset using a pager and datasource.  Using the example from https://demos.telerik.com/aspnet-core/pager , I can get the example to work directly in a Razor page.  When wrapped in a ViewComponent, the script for the DataSource is never rendered.  This appears to be a server-side rendering issue, as the <script>dataSource1=....</script> is never rendered.  Also, when doing similar example for Grid and ListView, they work fine.

Should pager and dataSource work in a viewComponent?  Maybe I missed something.

Eyup
Telerik team
 answered on 16 Apr 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?