Telerik Forums
UI for ASP.NET MVC Forum
2 answers
200 views

Hello,

I'm using the MultiColumnComboBox as an editor w/in a Telerik Grid. One of the columns in the underlying model I used a display format attribute, [DisplayFormat(DataFormatString = "{0:#,##0.##;(#,##0.##)}")] that isn't coming through in the MultiColumnComboBox dropdown list. A second column is a percentage, [DisplayFormat(DataFormatString = "{0:P3}")] where, again, the display format isn't carried through to the widget. Can you explain to me how I can format the columns of the MultiColumnComboBox, please? I'd also like to align these values to the right. I used the HeaderTemplate to align the header to the right, but the column cell values align to the left.

Regards,

Patrick

Aleksandar
Telerik team
 answered on 11 Mar 2021
3 answers
753 views

Hey Guys

What's the approach to use for when clients loose the connection to the Server and they should  try and reconnect to the SignalR data source and resync once it's back?

 

I am using a Grid, but I guess this is a generic question.

 

Many thanks

 

Rob

Rob
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 10 Mar 2021
12 answers
539 views

Hi ,
i want to sort values inside multi checkbox filter dropdown.

here is my grid functionality.

so actually my requirement is if user applies some filters on few columns inside grid. he wants to save his applied filters as default view when he again comes to that page. so here user will clicks save my view button , am saving those filters in database. so when user again comes to that page am loading those filters  through java script code. below is my code. the below code is working fine means filters are applying to grid.

 

if i remove sorting code inside FilterMenuInit then grid is working fine except columns sorting functionality. if i include sorting code inside FilterMenuInit then sum of columns is not working. so i want like sorting multifilter check box values with checked while appling  filter values in page load and sum of aggregate columns.

here am attaching image and project code . pls find it.

https://drive.google.com/file/d/1BigmLzF_12b2sFzANGrGWCWaA5j4gcBT/view?usp=sharing


Nikolay
Telerik team
 answered on 09 Mar 2021
2 answers
454 views

I have class like 

<p>public class TestGrid{</p><
p>public string col {get;set}</p>
<p>public string col-first{get;set;}</p>
<p>List<Temp> temps {get;set;}</p>
<p>}</p>
<p></p>
<p>public class Temp{</p>
<p>public string Id{get;set;}</p>
<p>public bool IsIt{get;set;}</p>
<p>public bool DoesNeeded{get;set;}</p>
<p>}</p>

 

How to make Grid from TestGrid? 

How to filter by Temp-class column? 

Tsvetomir
Telerik team
 answered on 09 Mar 2021
3 answers
205 views

I have a chart, with a click event which opens a window with a grid in it. This works fine, but most of the time, the chart tooltip stays visible, on top of the window and grid.

 

How can I prevent this, either by closing the tooltip before the window opens, or have the window show above the tooltip?

 

Thanks

Nikolay
Telerik team
 answered on 09 Mar 2021
9 answers
2.0K+ views

I've found examples how to use the kendo dropdown list as a editor in a column. Can you please provide me an example of how to use a MultiColumnComboBox as a column editor and how you would populate the MultiColumnComboBox in such a use case?

Thank you.

Ivan Danchev
Telerik team
 answered on 08 Mar 2021
1 answer
102 views

Hi,

how to find the selected cell header column name from the below example.

 

https://demos.telerik.com/aspnet-mvc/grid/multicolumnheaders

 

Marin Bratanov
Telerik team
 answered on 08 Mar 2021
6 answers
139 views

Hi ,
i want to sort values in multi checkbox filter dropdown.
here am attaching image and project code . pls find it.

 

https://drive.google.com/file/d/1BigmLzF_12b2sFzANGrGWCWaA5j4gcBT/view?usp=sharing


sandy
Top achievements
Rank 1
Iron
Veteran
 answered on 07 Mar 2021
5 answers
220 views
I have a grid containing a Start Date, an End Date, and a notes column.  For testing purposes, I added custom validation to check that the notes begins with an upper case letter, and it works just fine in all cases.  I added validation to the start date to make sure that the start date doesn't start after the end date, and vice versa for the end date.

The validation for these fields will show properly if I immediately select an invalid value.  However, if I select a valid value, and then select an invalid value, the validation message does not show.  The editor will not let me move away from the field until it is valid, so that piece is working - it just does not show the message.

I am using Kendo for MVC, with InCell editing.
 
//register custom validation rules
(function ($, kendo) {
    $.extend(true, kendo.ui.validator, {
        rules: { // custom rules
            notesvalidation: function (input, params) {
                if (input.is("[name='Notes']") && input.val() != "") {
                    input.attr("data-notesvalidation-msg", "Notes error");
                    return /^[A-Z]/.test(input.val());
                }
 
                return true;
            },
            startdatevalidation: function (input, params) {
                if (input.is("[name='StartDate']") && input.val() != "") {
                    input.attr("data-startdatevalidation-msg", "Start Date needs to be before End Date");
                    var row = input.closest("tr");
                    var grid = $('#Grid1').data().kendoGrid;
                    var dataItem = grid.dataItem(row);
                    if (dataItem.EndDate == "")
                        return true;
                    var result = (new Date(Date.parse(input.val())) <= dataItem.EndDate)
                    return result;
                }
 
                return true;
            },
            enddatevalidation: function (input, params) {
                if (input.is("[name='EndDate']") && input.val() != "") {
                    input.attr("data-enddatevalidation-msg", "End Date needs to be after Start Date");
                    var row = input.closest("tr");
                    var grid = $('#Grid1').data().kendoGrid;
                    var dataItem = grid.dataItem(row);
                    if (dataItem.StartDate == "")
                        return true;
                    var result = (new Date(Date.parse(input.val())) >= dataItem.StartDate)
                    return result;
                }
 
                return true;
            }
        },
        messages: { //custom rules messages
            productnamevalidation: function (input) {
                // return the message text
                return input.attr("data-val-notesvalidation");
            },
            startdatevalidation: function (input) {
                // return the message text
                return input.attr("data-val-startdatevalidation");
            },
            enddatevalidation: function (input) {
                return input.attr("data-val-enddatevalidation");
            }
        }
    });
})(jQuery, kendo);

Chayanika
Top achievements
Rank 1
 answered on 05 Mar 2021
15 answers
728 views

I have a Parent Child relationship that is using a Parent Grid and Tab strip with child grids.  I can get the data to show up but my custom buttons to add / edit and delete data is not working or showing up

TIA

 

Error

TypeError: Cannot read property 'dataItem' of undefined
    at AddEditCustomerShip (https://localhost:44368/Customer:238:63)
    at HTMLAnchorElement.onclick (https://localhost:44368/Customer:1:1)

<script id="template" type="text/kendo-tmpl">
    @(Html.Kendo().TabStrip()
            .Name("tabStrip_#=CustomerID#")
            .SelectedIndex(0)
            .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
            .Items(items =>
            {
                items.Add().Text("Contacts").Content(@<text>
                    @(Html.Kendo().Grid<I2MS.Models.CustomerContactViewModel>
                    ()                    
                    .Name("grid_contact#=CustomerID#")
                    .Columns(columns =>
                    {
                    columns.Bound(o => o.CustomerContactID).Hidden();
                    columns.Bound(o => o.FirstName).Width(40);
                    columns.Bound(o => o.LastName).Width(40);
                    columns.Bound(o => o.Phone).Width(40);
                    columns.Bound(o => o.Email).Width(40);
                    columns.Bound(o => o.Address).Width(40);
                    //columns.Bound(o => o.Address2).Width(200);
                    columns.Bound(e => e.City).Width(40);
                    columns.Bound(e => e.State).Width(40);
                    columns.Bound(e => e.PostalCode).Width(40);

                    columns.Template("<a title=\"Edit\" onclick=AddEditCustomerContact(event,#=CustomerID#);><img src='images/edit.png' alt='edit' /></a> &nbsp; <a role='button' title='Delete' onclick='onDeleteCustomerContact(event,#=CustomerID#)'><img src='images/delete.png' alt='delete' /></a>").Width(30);
                    })
                    .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(10)
                    .Read(read => read.Action("HierarchyBinding_CustomerContacts", "CustomerContact", new { customerID = "#=CustomerID#" }))
                    .Model(model => { model.Id(i => i.CustomerContactID); })
                    )
                    .ToolBar(toolbar =>
                    {
                        toolbar.Custom().Name("<span class='k-icon k-i-add'></span>Add New Customer Contact").HtmlAttributes(new { style = "float:right", id = "btnAddNewCustomerContact", onclick = "AddEditCustomerContact(null,#=CustomerID#)" });
                        //toolbar.Create();
                    })
                    .Pageable(p => { p.PageSizes(new[] { 5, 10, 20, 50, 100 }).Responsive(false); })
                    .Sortable()
                    .ToClientTemplate()

                    )
                </text>
                );
                 items.Add().Text("Shipping Addresses").Content(@<text>
                    @(Html.Kendo().Grid<I2MS.Models.CustomerShipViewModel>()
                        .Name("grid_ship#=CustomerID#")
                        .Columns(columns =>
                        {
                            columns.Bound(o => o.CustomerShipID).Hidden();
                            columns.Bound(o => o.Name).Width(40);
                            columns.Bound(o => o.PhoneNumber).Width(40);
                            columns.Bound(o => o.Address).Width(40);
                            //columns.Bound(o => o.Address2).Width(200);
                            columns.Bound(e => e.City).Width(40);
                            columns.Bound(e => e.State).Width(40);
                            columns.Bound(e => e.PostalCode).Width(40);

                            columns.Template("<a title=\"Edit\" onclick=AddEditCustomerShip(event,#=CustomerID#);><img src='images/edit.png' alt='edit' /></a> &nbsp; <a role='button' title='Delete' onclick='onDeleteCustomerShip(event,#=CustomerID#)'><img src='images/delete.png' alt='delete' /></a>").Width(30);
                        })
                        .DataSource(dataSource => dataSource
                            .Ajax()
                            .PageSize(10)
                            .Read(read => read.Action("HierarchyBinding_CustomerShips", "CustomerShips", new { customerID = "#=CustomerID#" }))
                            .Model(model => { model.Id(i => i.CustomerShipID); })
                        )
                        .ToolBar(toolbar =>
                        {
                            toolbar.Custom().Name("<span class='k-icon k-i-add'></span>Add New Customer Ship").HtmlAttributes(new { style = "float:right", id = "btnAddNewCustomerShip", onclick = "AddEditCustomerShip(null,#=CustomerID#)" });
                        })
                        .Pageable(p => { p.PageSizes(new[] { 5, 10, 20, 50, 100 }).Responsive(false); })
                        .Sortable()
                        .ToClientTemplate()

                        )
                </text>
                );
            })
            .ToClientTemplate())
</script>

Georgi Denchev
Telerik team
 answered on 05 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?