Telerik Forums
UI for ASP.NET Core Forum
0 answers
66 views

Hi,

The first time I click on submit on my form, the values from the RadListBox are read, but when going back on the page although the same items are still selected if I click submit for the second time, the values of the item selected are read as null. I have to actually uncheck and check again the items from the list for this to be read again. Do you know what might be the issue here?

This is what I have on my search.aspx.cs file:

 

            int eCount = 0;
            String strEvalReasonList = String.Empty;

           
            IList<RadListBoxItem> collectionEvalReasons = rlbEvalReasons.CheckedItems;
            foreach (RadListBoxItem exp in collectionEvalReasons)
            {

               // Response.Write(exp.Value + ":" + exp.Text + "<BR>");
               

                // foreach (RadListBoxItem exp in rlbEvalReasons.CheckedItems)
                // {

                if (exp.Value.ToString() == "All")
                {
                    Session["EvalReasonList"] = null;
                    break;
                }
                else
                {
                    if (eCount > 0)
                    {
                        strEvalReasonList += ",";
                    }
                    strEvalReasonList += "'" + exp.Value.ToString() + "'";
                    eCount++;
                }
            }
                if (strEvalReasonList==String.Empty)
                {
                    Session["EvalReasonList"] = null;
                }
                else
                {
                    Session["EvalReasonList"] = strEvalReasonList.ToString();
                }

 

 

Thanks

Violeta
Top achievements
Rank 1
 asked on 08 Feb 2017
1 answer
216 views

Instructions for setting-up a NuGet private feed on your development machine are given at http://docs.telerik.com/aspnet-mvc/getting-started/nuget-install. The following instructions allow you to do the same when running MSBuild on a Build machine such as hosted by Azure.

  1. Add NuGet.config to WebApp project in Visual Studio
    • Add new item NuGet.config to same directory as project.json and edit as below, setting your own username and password (in clear text) as needed to logon to the Telerik site:
      <?xml version="1.0" encoding="utf-8"?>
      <configuration>
          <packageSources>
               <add key="Telerik" value="https://nuget.telerik.com/nuget/" />
          </packageSources>
          <packageSourceCredentials>
            <Telerik>
              <add key="Username" value="will.***@****.com" />
              <add key="ClearTextPassword" value="********" />
            </Telerik>
          </packageSourceCredentials>
      </configuration>
  1. Edit Build Definition to add step for NuGet installer - In Visual Studio a) select Team Explorer, Builds b) select Build Definition, right click | Edit Build Definition. This opens the Build Definition in your browser - see attached screen shot
  2. In Build Definition editor add build step = Nuget Installer, drag/drop to top of list and specify the solution file as well as the NugGet.config
  3. Save
  4. Save your changes to source control for the WebApp in Visual Studio - i.e. the Build Definition and NuGet.config
  5. Queue a New Build

I hope this saves someone a bit of time.

Will

 

 

 

Ianko
Telerik team
 answered on 02 Feb 2017
2 answers
537 views

Anybody else having trouble setting the height of a grid in asp.net core?

@(Html.Kendo().Grid<Basic_Core.Models.Authors>()
    .Name("grid")
    .HtmlAttributes(new { style = "height:850px;" })

etc......

No matter what height I set it always renders with 400px. This even happens with the demo grid from Telerik.

The exact same code works just fine  with MVC5

@(Html.Kendo().Grid<Basic_MVC.Models.Authors>()
    .Name("grid")
    .HtmlAttributes(new { style = "height:850px;" })

etc.....

 

Would be really grateful for an insightful answer.

 

 

Hugo
Top achievements
Rank 1
 answered on 31 Jan 2017
2 answers
1.9K+ views

Telerik Team,

 

I am doing a POC to demo the Kendo UI ASP.NET Core components for our application. I would like to know how to apply the themes (such as Blue Opal, Bootstrap, Fiori, Flat, High Contrast, Material, Metro, Moonlight, Nova etc.,) that are shown on the top of Telerik demo pages. Please see the attached snapshot for reference. When we select any theme on the list, the Grid control will change the display accordingly. However, I do not find the code to apply the themes. Please provide the sample or link where I could find the code. Thanks in advance.

 

Regards,

Naga

Naga
Top achievements
Rank 1
 answered on 30 Jan 2017
1 answer
676 views

Users can see textarea with html tags while Editor is loading.

<div class="form-group">
    <label asp-for="Description" class="col-md-2 control-label"></label>
    <div class="col-md-6">
        @(Html.Kendo().EditorFor(model => model.Description)
          .HtmlAttributes(new { style = "width: 100%;height:440px;" })
          .Tools(tools => tools
              .Clear()
              .Bold().Italic().Underline().Strikethrough()
              .InsertUnorderedList().InsertOrderedList()
              .Formatting()))
        <span asp-validation-for="Description" class="text-danger"></span>
    </div>
</div>

 

Is there a way to hide the textarea until Editor is loaded?

Thank you

Rumen
Telerik team
 answered on 23 Jan 2017
3 answers
249 views

Hi everyone

 

I'm using Kendo/Angular 2 grid with custom filters, paging and sorting and ASP.NET Core on the server side.

When sending POST request from client side, I have to format request parameters to "form data" because server side bindings uses that format by default in order to retrieve data for the grid.

Is there a way to configure server side code to accept json format instead of form data?

I have found an open source library which might do that: https://github.com/kendo-labs/dlinq-helpers but I'm wondering is there an option to do all this with standard Kendo.Mvc.UI library?

 

Thanks

Vladan

Konstantin Dikov
Telerik team
 answered on 23 Jan 2017
0 answers
62 views
0 answers
238 views

Installer and VS Extensions for ASP.NET Core

Visual Studio Integration Overview
A new article on how to enhance your experience in developing web applications with ASP.NET Core.

Downloading New Versions
A new article on how to keep your projects updated when using Telerik UI for ASP.NET Core.

Creating Projects
A new article on how to create a new Telerik UI for ASP.NET Core application.

Kendo UI
Top achievements
Rank 1
 asked on 20 Jan 2017
6 answers
324 views

Telerik Team,

 

We are working on the ASP.NET Core web application development and planning to use Kendo UI ASP.NET Core Components. Currently I am evaluating the ASP.NET Core Components for usage in our application. While going thru the demos, I have observed that the ASP.NET Core Components comes in two versions: ASP.NET MVC and HTML/JavaScript. After looking at the demos, I understand that the HTML/JavaScript version involves writing lot of HTML/JavaScript code, where was the ASP.NET MVC version code is compact. I would like to know what are the pros and cons of one over the other. Please provide any document or URL which gives the differences between these two versions and which one will be the better option to use in ASP.NET Core web application. Thanks in advance.

 

Regards,

Naga

Rumen
Telerik team
 answered on 18 Jan 2017
3 answers
1.0K+ views

I am trying to implement a grid with a foreign key Column.

I am using your example

http://demos.telerik.com/aspnet-core/grid/foreignkeycolumn

I am trying to understand the right way to implement the editor template, unfortunately you didn't provide a full working example.

this is the error:

An unhandled exception occurred while processing the request.
ArgumentNullException: Value cannot be null.
Parameter name: items
.ctor

And this is the view

@(Html.Kendo().Grid<TraderMade.Models.Market>()
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(c => c.Name).Width(200);
            columns.ForeignKey(p => p.CountryId, (System.Collections.IEnumerable)ViewData["countries"], "Id", "Name")
          .Title("Nazione").Width(150);
            columns.Bound(c => c.City).Title("Città").Width(150);
            columns.Bound(c => c.MIC).Title("Codice").Width(80);
            columns.Bound(c => c.WebSiteUrl).Title("Web site").Width(250);
            columns.Command(command => command.Destroy()).Width(110);
        })
        .Filterable(ftb => ftb.Mode(GridFilterMode.Menu))
        .HtmlAttributes(new { style = "height: 380px;" })
        .ToolBar(toolbar =>
        {


            toolbar.Create();
            toolbar.Save();
        })
        .Editable(editable => editable.Mode(GridEditMode.InCell))
        .Scrollable()
        .Groupable()
        .Sortable()


        .DataSource(dataSource => dataSource
            .Ajax()
            .Batch(true)
            .ServerOperation(false)
            .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.Id))
        .Create("Countries_Create", "Home")
        .Read("Countries_Read", "Home")
        .Update("Countries_Update", "Home")
        .Destroy("Countries_Delete", "Home")
        ).Deferred()
)

this is the relevant part of the controller

 private void PopulateCountries()
        {
            var countries = _context.Countries.ToList();
            ViewData["countries"] = countries;
            ViewData["defaultCountry"] = countries.First();
        }


        public IActionResult Index()
        {
            PopulateCountries();
            return View();
        }

 

 public ActionResult Countries_Read([DataSourceRequest] DataSourceRequest request)
        {
            var markets = _context.Markets;
            DataSourceResult result = markets.ToDataSourceResult(request);


            return Json(result);



        }

I have read somewhere that I need to create a folder in views\shared\EditorTemplates, in this folder I have created

GridForeignKey.cshtml

@model object

@(
 Html.Kendo().DropDownListFor(m => m)
        .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
        .ValuePrimitive(true)
)

 

here the model:

  public class Country
    {
        public int Id { get; set; }
        public string Name { get; set; }

        public string CodeAlpha2 { get; set; }

        public string CodeAlpha3 { get; set; }
        public int CodeNumeric { get; set; }


        public ICollection<Market> Markets { get; set; }
    }

 public class Market
    {
        public int Id { get; set; }
        public string MIC { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public string City { get; set; }
        public string WebSiteUrl { get; set; }
        public string Notes { get; set; }
        public bool IsEnabled { get; set; }
        public int CountryId { get; set; }
        [ForeignKey("CountryId")]
        public Country Country { get; set; }


    }

I have tried to use ViewModel instead of model, but no matter what i write in  columns.ForeignKey  I have always the same error.

thank you for the support

 

Konstantin Dikov
Telerik team
 answered on 16 Jan 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?