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

Hi, My kendo inline grid is not calling the update method in controller, when any of its fields is autopopulated dynamically.

I am not manually editing any of the fields in the particular row, instead the fields are getting automatically populated. And on update click I need to do validation in server controller method .But unfortunately the control is not going to the server method on update button click.

Can someone help me to resolve this,

 

Ivan Danchev
Telerik team
 answered on 17 Jun 2020
2 answers
248 views

Hello,

 

I'm using ASP.NET Core 2.1 and trying to get a Pie chart bound to a remote datasource based on this example:  https://demos.telerik.com/aspnet-core/pie-charts/remote-data-binding.  I can't get anything except the "Title" to show. The pie never displays. (FYI, the pie chart works fine for hardcoded data.)  I know the controller works as I'm getting response data in the format I expect.  Here's some streamlined code:

Here's my view:

    @(Html.Kendo().Chart<WT.Models.Cars>()
        .Name("chart1")
.Title(title => title.Text("Title").Position(ChartTitlePosition.Top))
        .DataSource(ds => ds.Read("CarTotals_PieChart", "Output"))
        .Series(series => series.Pie(model => model.NumCars, model => model.CarManu))
        )

Here's my model:

public class Cars
{
    public string CarManu{ get; set; }
    public int NumCars { get; set; }
}

Here's my response JSON data:

{"Data":[{"CarManu":"GM","NumCars":167},{"CarManu":"Ford","NumCars":120},{"CarManu":"Mazda","NumCars":60},{"CarManu":"Ferrari","NumCars":19}],"Total":4,"AggregateResults":null,"Errors":null}

 

I've seen other posts related to this exact same (issue but never a resolution.  What am I doing wrong? Thanks in advance.

Werdna
Top achievements
Rank 1
 answered on 17 Jun 2020
2 answers
79 views

Hello,

in a Telerik RadGrid (web) I need to merge some cell rows like the attached image, 
and change the font color based on values in these cells.

Has anyone idea how to make this?

Thanks a lot. 

Luis

Luis
Top achievements
Rank 1
Veteran
 answered on 17 Jun 2020
1 answer
163 views
Is it possible to have Filename, Error events and validation with synchronous mode? I have a form where i need the upload to happen on form submit for the additional information and would like these options. Is it possible? 
Aleksandar
Telerik team
 answered on 16 Jun 2020
3 answers
199 views

I'm using Asp.net core razor pages with custom column settings.  The client wants to block users from navigating off the page when there is a row in edit mode. Is there a suggested way to do this that doesn't involve jquery? Every example I've found so far is under jquery. Ideally, the client should be told with some kind of message the reason for preventing page close. 

 

Ivan Danchev
Telerik team
 answered on 15 Jun 2020
1 answer
773 views

Hello,

I have a grid with custom template column and with event handler for grid change event (I have omitted not important parts of code):

    @(Html.Kendo().Grid<OpportunityTool.Models.AccountForGrid>()
        .Name("AccountGrid")
        .Columns(columns =>
        {
            // other columns definitions - not important here
            columns.Bound(p => p.SlaveAccount.Owneridname).Title("Vlastník")
                .ClientTemplate("<div class='contact-presenter'>#=SlaveAccount.Owneridname#</div>");
        })
        .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
        .Events(events => events
                            .Change("AccountGridChange"))
    )

I have assigned event handler for click on my custom column too:

    $('#AccountGrid').on('click', '.contact-presenter', showContactDetail);

I want to prevent the selection of the whole row, when user clicks on my custom column. I don't know how to do it, because change event is fired before cell click event.

Is there a way to change the order of the events?

 

Thanks for help,

Boris.

Tsvetomir
Telerik team
 answered on 15 Jun 2020
2 answers
102 views

I am unable to replicate this demo on page/data load. With data that is already checked the parent gets put into an indeterminate state if any of its children are checked.

The indeterminate state only appears if the user manually clicks one of the children check boxes.

https://dojo.telerik.com/ebAVASUp - here February is checked and its parent is in an indeterminate state on data/page load

My Code

<kendo-treeview name="DataRestrictionTree" load-on-demand="false" template="#=TreeViewTemplateSet(item.PathDescription,item.ModifiedBy,item.ModifiedDate,item.checked)#">
               <checkboxes check-children="true"/>
               <!--Batch attribute in hierachical datasource is needed so any change causes an update-->
               <hierarchical-datasource type="Kendo.Mvc.UI.DataSourceTagHelperType.Ajax" server-filtering="true" server-sorting="true" page-size="0" batch="true" on-request-end="RequestEnd">
                   <transport>
                       <read url="@Url.Action("GetDataRestrictionAssignments", "DataRestrictionAssignment")" datatype="json" data="DataAssignmentFilter" />
                       <update url="@Url.Action("UpdateDateRestrictions", "DataRestrictionAssignment")" datatype="json" />
                   </transport>
                   <schema>
                       <hierarchical-model id="PrimaryId" children="HasChildren"></hierarchical-model>
                   </schema>
               </hierarchical-datasource>
           </kendo-treeview>
Ivan Danchev
Telerik team
 answered on 12 Jun 2020
2 answers
103 views

Hello,

i am using mvc returning the Json result as list . In the view using the data source reading action controller name and returning the list 

var result = context.table.sekect(m=>new

{
m.number 

}

return view(result.ToList());

 

.datatextfield(“Number”)

.datavaluefield(“Number”)

 

getting undefined in dropdown.

i have tried the json result as well in another method same results.

 

Do I need to add anything in the startup?

Thank you 

SB

 

 

Neli
Telerik team
 answered on 11 Jun 2020
3 answers
131 views

Suppose I have a MultiColumnComboBox like below.  How can I have like 10 columns in it but hide specific ones of them?  I need the data from the additional columns when the user makes a selection but, I don't want them to show.  So in the example below, how could I hide the ID, and Inst columns?  I think it would be done in the dataBound event but no idea how to do it.

--Rich

 

@(Html.Kendo().MultiColumnComboBox()
    .Name("MainSched")
    .DataTextField("Room")
    .DataValueField("Room")
    .Columns(columns =>
    {
        columns.Add().Field("ID").Title("ID").Width("100px;");
        columns.Add().Field("Room").Title("Room").Width("100px;");
        columns.Add().Field("Inst").Title("Inst").Width("100px;");
        columns.Add().Field("MKey").Title("MKey").Width("100px");
    })
    .HtmlAttributes(new { @class = "FontSmall" })
    .Height(400)
    .DataSource(source => source
    .Custom()
    .Transport(transport => transport
        .Read(read =>
        {
            read.Action("MainSched_Read", "Home");
        })))
    .Events(events => events.Change("MainSched_Change").DataBound("MainSchedDataBound"))
    )

Ivan Danchev
Telerik team
 answered on 10 Jun 2020
1 answer
886 views

Hi,

I would like to get Telerik feedback on the best way to override the delete grid function.

We are using a grid with inline editing but on the delete we need to capture extra data.

We are are doing right now:

  1. Listening for the on remove event
  2. event prevent default
  3. launch a dialog to capture extra data
  4. user confirm or not
  5. if user confirm we delete
  6. if user cancel we cancel

Everything is working good but I would like to get recommandation on how to prevent the row to disapear from the frontend ONLY WHEN the user confirm.

 

Right now as soon the delete command is clicked and we reach the on remove the row is already removed from the frontend.

 

here is code samples we have

the grid with the onremove

 

<kendo-grid name="plancodegroupgrid" height="600" navigatable="true" selectable="" on-data-bound="dataBound" on-remove="onremove">
    <datasource type="DataSourceTagHelperType.Ajax" server-filtering="true" server-paging="true" page-size="100" on-request-end="onrequestend">
        <transport>
            <read url="planCodeGroup/PlanCodeGroup_Read" />
            <update url="planCodeGroup/PlanCodeGroup_Update" />
        </transport>
        <schema>
            <model id="PlanCodeGroupID">
                <fields>
                    <field name="PlanCode" editable="false"></field>
                    <field name="RateScaleCode" editable="false"></field>
                    <field name="PolicyTypeCode" editable="false"></field>
                    <field name="RiskIntegrityGroupPrefixCode"></field>
                    <field name="SystemName" editable="false"></field>
                    <field name="StartDate" editable="false" type="date"></field>
                    <field name="EndDate" type="date"></field>
                </fields>
            </model>
        </schema>
    </datasource>
    <messages>
        <commands edit=" " update=" " canceledit=" " destroy=" " create=" "/>
    </messages>
    <sortable enabled="true" mode="multiple" show-indexes="true" />
    <filterable enabled="true" mode="row" />
    <editable mode="inline" confirmation="false" />
    <columns>
        <column field="PlanCode" title="@localizer["PlanCode"].Value">
            <filterable>
                <cell show-operators="false"></cell>
            </filterable>
        </column>
        <column width="150" field="RateScaleCode" title="@localizer["RateScale"].Value">
            <filterable>
                <cell show-operators="false"></cell>
            </filterable>
        </column>
        <column width="150" field="PolicyTypeCode" title="@localizer["PolicyType"].Value">
            <filterable>
                <cell show-operators="false"></cell>
            </filterable>
        </column>
        <column width="150" field="SystemName" title="@localizer["System"].Value">
            <filterable>
                <cell show-operators="false"></cell>
            </filterable>
        </column>
        <column field="RiskIntegrityGroupPrefixCode" editor="riskIntegrityGroupPrefixCodeEditor" title="@localizer["GroupPrefix"].Value">
            <filterable>
                <cell show-operators="false"></cell>
            </filterable>
        </column>
        <column field="StartDate" title="@localizer["Start Date"].Value" format="{0:MM/dd/yyyy}">
            <filterable>
                <cell show-operators="false"></cell>
            </filterable>
        </column>
        <column field="EndDate" title="@localizer["EndDate"].Value" format="{0:MM/dd/yyyy}">
            <filterable>
                <cell show-operators="false"></cell>
            </filterable>
        </column>
        <column width="100">
            <commands>
                <column-command name="edit"></column-command>
                <column-command name="destroy"></column-command>
            </commands>
        </column>
    </columns>
    <scrollable height="auto" virtual="true" enabled="true" />
</kendo-grid>

 

 

The onremove js  stopping the event and launching how dialog

function onremove(e) {
    e.preventDefault();
    $('#reason').val('');
    $('#dialog').data('kendoDialog').open();
    model = $('#plancodegroupgrid')
        .data('kendoGrid')
        .dataSource.get(e.model.PlanCodeGroupID);
};

 

if user cancel that s what we have (the row is re showing) 

function cancelDeletePlanGroup(e) {
    if (!confirmed) {
        $("#plancodegroupgrid").data("kendoGrid").cancelChanges();
    } else {
        confirmed = false;
    }
}

 

I tried the setup an onclick event on the delete command

But somehow the function is never called

<column width="100">
    <commands>
        <column-command name="edit"></column-command>
        <column-command name="destroy" click="onremove"></column-command>
    </commands>
</column>

The grid is capable of because when i setup the built in confirmation dialog on the row is staying in the UI until a choice is made.

other option would be to build my own delete button but I want to ask you guys before moving forward.

Let me know what is your recommended to proceed with all that logic being the exact same but without row getting away while user is making his choice.

 

Cheers

Veselin Tsvetanov
Telerik team
 answered on 10 Jun 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?