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

Hello, 

I 'm have a view based on a ViewModel. This View Model has one Complex Property which is a collection.

public class ParentViewModel
    {
        public int Id { get; set; }

    public int Description  { get; set; }

        public List<SecurityListViewModel> secList { get; set; }
    }

Konstantin Dikov
Telerik team
 answered on 03 May 2017
1 answer
247 views

Hi Guys,

i Have Problem with binding:

 

If I use this :

.BindTo((System.Collections.IEnumerable)ViewData["Analyten"])

it's work but if I us this:

.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])

 

it does not work

Have you  any idea ?

 

Thank you

 

 

@model Delphi.ViewModels.VMAnalytCRUD
 
    @(
 Html.Kendo().DropDownListFor(m => m.AnalytId)
   .BindTo((System.Collections.IEnumerable)ViewData["Analyten"])
   // .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
    .DataTextField("AnalytName")
    .DataTextField("AnalytNummer")
    .DataValueField("AnalytId")
    .Template("#= AnalytNummer # - #= AnalytName #")
    .ValueTemplate("#= AnalytNummer # - #= AnalytName #")
    .Filter(FilterType.Contains)
    .AutoBind(false)
    )
Boyan Dimitrov
Telerik team
 answered on 27 Apr 2017
1 answer
140 views

Hello,

first of all the "UI for ASP.NET Core Forum" has no category for "Dialog", so I post my request here.

I tried to implement the dialog with help of the TagHelper as described here http://demos.telerik.com/aspnet-core/dialog/tag-helper. But I found no way to implement some action buttons, as I can do with the C# Razor Helper. I also found this page http://docs.telerik.com/aspnet-core/helpers/dialog but under the tab "tagHelper" there is some strange tag-format with ":" which is not working.

Nikolay
Telerik team
 answered on 24 Apr 2017
1 answer
465 views
Hello,
We start using the Grid (UI fro ASP.NET Core).
Is it possible to open a Bootstrap modal from a hyperlink or button in a Grid row?
Greetings,
Pieter 
Viktor Tachev
Telerik team
 answered on 18 Apr 2017
1 answer
159 views

I found that ServerFiltering is not working out of the box if you set Custo() in datasorce

Like in this example

http://demos.telerik.com/aspnet-mvc/autocomplete/grouping

This is about AutoComplete control. And text send to server via onAdditionalData Function

How I need to do same for DropDownList.

my solution to access filter text input is

    function onAdditionalData() {
        return {
            text: $("#Course").data("kendoDropDownList").filterInput[0].value
        };
    }

 

Looks a bit awkward for me

Can team please explain what if better way here

Plamen
Telerik team
 answered on 17 Apr 2017
0 answers
58 views

I have a RadGrid with 5 columns and 3 of them have an ItemTemplate and EditItemTemplate, both having a control inside (Label and CheckBox, Label and RadDatePicker, Label and RadCombobox).

I have an issue when i click on the ckeckbox, i need to disable the RadDatePicker which is in another column but i cant find it.

I tried to use FindControl to search for the control that i need but always gets me the first founded and if the row that i have selected is not the first one, the control is not the one that i want.

var control = RadGrid1.FindControl(RadGrid1.MasterTableView.ClientID + "_Column3");

I tried also, browsing on the list of items that have my RadGrid and when i search for the control that i want, returns a null.
                foreach (GridDataItem item in RadGrid1.Items)
                {
                    var ctl = item.FindControl(RadGrid1.MasterTableView.ClientID + "_Column3");
                    if (ctl == null) continue;
                }

I dont know what am i doing wrong or if i am missing something but i hope that you could help me.

Hector
Top achievements
Rank 1
 asked on 12 Apr 2017
3 answers
112 views

Instead of the built in arrow to open a details table view for a row (like in attachment 1)

We want to do it with a button but not in the same location we will have an extra column for the button (somewhat like attachment 2). We are trying to match an existing UI.

The Master/Details grid is bound via code and that is all working properly.

 

How or what event should I use?

 

Viktor Tachev
Telerik team
 answered on 12 Apr 2017
1 answer
245 views

Hello,

If I use the following grid with columns.AutoGenerated(true) then no column headers are shown (why?) if there are no records available!

As a result the "No records" info is on top and there is a gap between navigation/paging bar and the grid bottom (see attached picture)

 

robert

Viktor Tachev
Telerik team
 answered on 07 Apr 2017
1 answer
545 views

Hi,

I want to display a message when i click on a row in radgrid.

With the code, i have, i can display the message. Now, if the user clicks on OK, I want to perform one method and if he cancels, i want to perform another method.

How do i know what the user clicked on?

<telerik:RadGrid runat="server" ID="rg_OnlineDownloads" AutoGenerateColumns="false"
                                OnNeedDataSource="rg_OnlineDownloads_NeedDataSource"
                                onitemcommand="rg_OnlineDownloads_ItemCommand" >
                                <MasterTableView DataKeyNames="HouseholdID">
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="ApplicationDate" HeaderText="ApplicationDate">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="HouseholdID" HeaderText="HouseholdID">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ClientName" HeaderText="ClientName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="FamilyMembers" HeaderText="#nbrs">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ClientAddress" HeaderText="ClientAddress">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="CellPhone" HeaderText="CellPhone">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridButtonColumn UniqueName="Transfer" CommandName="Transfer" ConfirmText="" ConfirmDialogType="RadWindow"
                                           ConfirmTitle="Transfer to Intake"  ButtonType="PushButton" > </telerik:GridButtonColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>

 

Code Behind:

protected void rg_OnlineDownloads_ItemCommand(object sender, GridCommandEventArgs e)
     {
         if (e.CommandName == "Transfer")// CommandName of LinkButton
         {
             GridDataItem dataItem = e.Item as GridDataItem;
             string hHoldID = dataItem["HouseholdID"].Text;
             string clntNm = dataItem["ClientName"].Text;  
             (rg_OnlineDownloads.MasterTableView.GetColumn("Transfer") as GridButtonColumn).ConfirmText =
                 "Do you want to transfer " + clntNm + " ? ";
 
              
         }
     }
 

 

Thanks in Advance

Eyup
Telerik team
 answered on 04 Apr 2017
3 answers
612 views

Hi,

I have a problem removing a newly added row or clearing updated values during update when calling Ajax Create or Update methods. I've tried e.sender.cancelChanges(); and also the code below with no luck. The error alert shows on the screen but the row sticks in the grid after hitting OK on the error window prompt. Is there a reason why the cancel changes is not updating the Json dataset after the error?

Error JS:

<script type="text/javascript">
    function error_handler(e) {
        if (e.errors) {
             
            var message = "Errors:\n";
            $.each(e.errors, function (key, value) {
                if ('errors' in value) {
                    $.each(value.errors, function () {
                        message += this + "\n";
                    });
                }
            });
            //Display the message
            alert(message);
 
            // Cancel the changes.
            var grid = $("#meterGrid").data("kendoGrid");
            grid.cancelChanges();
        }
    }
</script>

 

My grid:

@(Html.Kendo().Grid<MeterSerialsViewModel>()
                    .Name("meterGrid")
                    .Columns(columns =>
                    {
                        columns.Command(command => { command.Edit(); }).Width(60).Visible(Model.IsEditable);
                        columns.Bound(o => o.MeterSerialId);
                        columns.Bound(o => o.VendorAccountId).Visible(false);
                        columns.Bound(o => o.MeterSerialName).Width(300);
                        columns.ForeignKey(o => o.CommodityId, (System.Collections.IEnumerable)ViewData["CommodityTypes"], "CommodityTypeId", "Name").EditorTemplateName("GridForeignKeyEditor").Title("Commodity").Width(250);
                        columns.Bound(o => o.IsActive).ClientTemplate("<input type='checkbox' disabled='disabled' #= IsActive ? checked='checked': checked='' # />");
                        columns.Bound(o => o.CreatedOn).Width(180).Format("{0:MM/dd/yyyy hh:mm tt}");
                    })
                    .ToolBar(toolbar =>
                    {
                        if (Model.IsEditable)
                        {
                            toolbar.Create();
                        }
                    })
                    .Pageable()
                    .Sortable()
                    .Editable(editable => editable.Mode(GridEditMode.InLine).Enabled(Model.IsEditable))
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .ServerOperation(false)
                        .PageSize(10)
                        .Events(events => { events.Error("error_handler"); })
                        .Model(model =>
                        {
                            model.Id(o => o.MeterSerialId);
                            model.Field(o => o.MeterSerialId).Editable(false);
                            model.Field(o => o.VendorAccountId).DefaultValue(Model.VendorAccountId).Editable(false);
                            model.Field(o => o.IsActive).DefaultValue(true);
                            model.Field(o => o.CreatedBy).Editable(false);
                            model.Field(o => o.CreatedOn).Editable(false);
                        })
                        .Sort(s => { s.Add("CommodityTypeName").Ascending(); })
                        .Read(r => r.Action("GetMeterSerials", "VendorAccounts", new { vendorAccountId = Model.VendorAccountId }))
                        .Create(c => c.Action("CreateMeterSerial", "VendorAccounts", new { vendorAccountId = Model.VendorAccountId }))
                        .Update(u => u.Action("UpdateMeterSerial", "VendorAccounts")))
)

 

Controller to exception testing error prompt:

catch (Exception ex)
            {
                ModelState.AddModelError(string.Empty, ex.ToString());
                return Json(new[] { model }.ToDataSourceResult(request, ModelState));
            }

 

Boyan Dimitrov
Telerik team
 answered on 31 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?