Telerik Forums
UI for ASP.NET Core Forum
2 answers
373 views

Hi!

We are developing a Grid, and we require having an Editable ListBox in a Cell of a GRID.
I have search for this solution and try coding during a week without success.
My project is ASP.NET Core and MVC tech. I have tried with EditorTemplates and ClientDetailTemplateId without lucky.
Please, is this possible? Has the ListBox a SAVING action? and how can achieve this or similar?
The final requirement is having a Editable List of string items in the databound of the ViewModel.

Thanks in advance!

Raul
Top achievements
Rank 1
 answered on 24 Jul 2017
1 answer
802 views

I have the following data structures in my app:

public class MetricValue
{
    public DateTime TimeStamp { get; set; }
    public double Average
}

public class CustomMetrics
{
    public string ResourceName { get; set; }
    public List<MetricValue> Metrics { get; set; }
}

This is the Action that returns the data for the chart in the razor view:
public async Task<IActionResult> GetAllDatabasesDTUPercentages()
{
    List<CustomMetrics> data = ...

    return Json(data);
}

 

I have been reading through the demos and documentation and samples on Github but I have no idea how to configure the chart in the razor view. Most examples have the data come through the page Model or an object with known properties as series.

The ResourceName should be the series name and I should see a series for each CustomMetrics object in the JSON data.

 

Any help would be appreciated.

Alex Hajigeorgieva
Telerik team
 answered on 20 Jul 2017
1 answer
197 views

Hi,

I'm trying download from nuget telerik core packages but after setup following this instruction: 

http://docs.telerik.com/aspnet-mvc/getting-started/nuget-install#set-up-nuget-package-source

nuget still can't establish connection to telerik.

My licence has expired few days ago but I still can use latest version in new project (i think).

Could you please help me fix the problem? Is way using telerik controls without nuget in existing project.

Thanks

Leszek

Alex Hajigeorgieva
Telerik team
 answered on 19 Jul 2017
2 answers
81 views
MAP
Hi, where can I ask the question about Map for ASP.NET Core? There isn`t section for this control in ASP.NET Core Forum...
Angel Petrov
Telerik team
 answered on 19 Jul 2017
1 answer
111 views

The only way I have found to specify the editable template of a Grid is by creating a separate view inside Shared/EditorTemplates or Controller/EditorTemplates. However, I would like to generate the views dynamically (based on the permissions of the user). So is there any way that I can specify a custom template in the same view? Can ClientTemplate do that?

The Grid control can already generate a dynamic template for the popup, is there any way to override it's behavior?

Georgi
Telerik team
 answered on 18 Jul 2017
1 answer
955 views
I am porting a Silverlight website to HTML5 for my company and we are heavily using Telerik controls, as it's one of the only frameworks that has the richness we had while using Silverlight.  We have had great success as Telerik has had every widget and feature we had in our silver light, so it's been great being able to use a single framework for all of our grid and charting needs.

What I am stuck on right now is creating a grid that has a single column but supports different data types for each row.  For example the column might had a field for floats, a drop down menu, and a field for strings.  In Silverlight this was almost no effort to do.  You could take your class instance and drop it in a grid in XAML and XAML knew all of the data types and made each cell match the type(i.e. and editable string field for a string, a drop down menu for an enum, etc.).

What I am wondering is how to achieve this same functionality in Telerik.  Keep in mind that the data source is not an IEnumerable, it is a very large class instance with hundreds of different data members of differing types(int, float, bool, enum).  I attached a screenshot of what this looks like in silver light.  There are 2 columns in the screenshot, the left is a read-only text field, and the right-side column is where you change the values. 
Viktor Tachev
Telerik team
 answered on 17 Jul 2017
4 answers
477 views

I'm trying to render a grid on demand in a tab using the nw component views. I have tried the following but non work.

 

@(Html.Kendo().TabStrip().Name("tabstripx").Items(tabstrip =>
{
tabstrip.Add().Text("Tab1").Content(
@<text>
   @Component.InvokeAsync("SupplierCompliance", new { SupplierId = Model.Id })
</text>);
                       
tabstrip.Add().Text("Tab1").Content(@<text>
    <vc:supplier-compliance id="3"></vc:supplier-compliance>
</text>);
}))

 

 

 

 

Nouman
Top achievements
Rank 1
 answered on 14 Jul 2017
2 answers
140 views

Hello-

I am having an issue accessing my ICollection <Image> Images in the ClientTemplate. It is accessible from the kendo datasource, but not in the ClientTemplate script; however, all of other variables of a different type from my class are accessible. The Image class has a member of type string called "name". My script to access that variable is below. When I load this page, the ListView comes up empty.

 

<script type="text/x-kendo-tmpl" id="template">
        <div id="product">   
            <dl id="itemDetails">
                <dt>ImageName:</dt>              
                <dd>#:Images[0].Name#</dd>            
            </dl>
        </div>
</script>

 

How I successfully access the variable from the dataSource:

function x () {
            var index = this.select().index();
            var dataItem = this.dataSource.view()[index];
             
            $("#ImageName").html(dataItem.Images[0].name);
}

 

How does my syntax need to change to access it in the ClientTemplate script?

Thank you for the help,

S

Viktor Tachev
Telerik team
 answered on 14 Jul 2017
4 answers
401 views

Hi,

I am new to Telerik controls. I am trying to bind grid to datasource, not sure what am I doing wrong but grid is always empty.

Here is some sample code.

 public IActionResult Index(string YYYYQ)
        {
            var initialYYYYQ = YearAndMonth.AbstractStartYearMonth();
            SelectedMeasuresViewModel sModel = GetMeasureSelectionData(initialYYYYQ);      
            return View(sModel);
        }

 public ActionResult MeasureSelections_Read([DataSourceRequest] DataSourceRequest request)
        {
            return Json(GetMeasureSelectionData("2017-02"));
        }

private SelectedMeasuresViewModel GetMeasureSelectionData(string YYYYMM)
        {

         measureSelectionList = someData;
            SelectedMeasuresViewModel sModel = new SelectedMeasuresViewModel();
            sModel.SelectedYYYYMM = YYYYMM;
            sModel.SelectedMeasureSets = measureSelectionList; (this is list of MeasureListData)

            return sModel;
        }

 

View is simple

@using (Html.BeginForm())
{

 @Html.DropDownListFor(m => m.SelectedYYYYMM, YearAndMonth.MonthDropdownOptions(), new { onchange = "this.form.submit(); " })

@Html.Partial("MeasureSelections", Model.SelectedMeasureSets)

}

Partial View is

@(Html.Kendo().Grid<EncorI.Web.Areas.Admin.Models.MeasureListData>()
        .Name("measureSelectionGrid")
        .Columns(columns =>
        {
            columns.Bound(c => c.Enabled).Width(100);
            columns.Bound(c => c.MeasureSetID).Width(100);
            columns.Bound(c => c.MeasureSetName).Width(300);
            columns.Bound(c => c.HospitalID).Width(100);
            columns.Bound(c => c.HospitalName).Width(300);
        })
        .HtmlAttributes(new { style = "height: 850px;" })
        .Scrollable()
        .Groupable()
        .Sortable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("MeasureSelections_Read", "measureSelectionGrid"))
            .PageSize(20)
        )
)

Viktor Tachev
Telerik team
 answered on 12 Jul 2017
2 answers
142 views

Is there a simple way to change the background color of the Month/Year view?

Thanks.

-------------------------------------------------------------------------------------------------------------

<telerik:RadDatePicker RenderMode="Lightweight" ID="FromScreeningDatePicker" runat="server" Width="120px"
ClientEvents-OnDateSelected="FromDateSelected"

Calendar-CalendarTableStyle-BackColor="White"

Calendar-TitleStyle-BackColor="White"
MinDate='<%# Convert.ToDateTime("01/01/1900")%>' MaxDate='<%# Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"))%>'
DbSelectedDate='<%# startDate %>' FocusedDate="01/01/2016">

</telerik:RadDatePicker>

HSK
Top achievements
Rank 1
 answered on 12 Jul 2017
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?