Telerik Forums
Kendo UI for jQuery Forum
1 answer
422 views

Hi 

I am doing export to excel in kendo mvc grid, i have below issue,

I am getting error while opening the excel after exporting "We found a problem with some content Do you want us to try recover as mu7ch as we can" i analysed and found the one of the column data has double quotes and quotion(") after opening the data gets deleted. Is there any way to handle this to open excel without error and maintain data.

 

Thanks

Mohammed

Petar
Telerik team
 answered on 25 Aug 2020
3 answers
364 views

When you float your mouse cursor over the line that separates two columns in a grid (sometimes) a cursor comes up, it looks like a left arrow, two vertical bars and a right arrow.

If you then double click, Kendo now does a nice job of auto fitting the column (on the left of the special cursor). This behavior is different from the normal autoFitColumn call, which does not account for sort and filter icons nor the size of the column header.

How can I get the same auto-fit programmatically?

[I am unable to get a screenshot that includes the cursor because my Adesso keyboard has no proper print screen button. Every app I have tried requires special mouse activity, causing the special icon to disappear before I can take the screenshot]

Tsvetomir
Telerik team
 answered on 25 Aug 2020
5 answers
1.4K+ views

Hi,

 

We have a need to capture when a user presses "t" when focused on a DatePicker. When they type "t" I need to set the Date on the DatePicker to today's date.

This is essentially a quick shortcut key. Needed because we have Forms with lots of DatePickers and the users will use keyboard only as they tab their way through the form.

I do have a solution, which I worked like this:

$("#ExpiryDate").kendoDatePicker({
            format: "d",
            dateInput: true
        });
 
        $("#ExpiryDate").on("keydown", function(e) {
            var keyCode = e.keyCode || e.which;
            if (keyCode == 84) {
                e.preventDefault();
                var picker = $(this).data("kendoDatePicker");
                picker.value(new Date());
            } else {
                return;
            }
        });

 

However this approach means adding this code snippet for every DatePicker after the initial configuration of the component. And we have content this is loaded on demand, so I can't create all DatePickers on the initial load of the page.

What I'm hoping for is a more generic solution. From what I've read, keydown isn't an event on DatePicker that I can extend.

I was hoping for something like this to work:

var extendDatePicker = kendo.ui.DatePicker.extend({
        keydown: function() {
            console.log("keydown");
        }
    });

 

But that was wishful thinking.

If anyone has a solution, I'd appreciate it :)

Thanks

 

John
Top achievements
Rank 2
Iron
 answered on 24 Aug 2020
2 answers
422 views

Hello Admin, 

I am using Kendo Filter Component in .net core 3.1

We have many rows in table and showing all names in filter dropdown but i could not bind dynamically data in filter area.

Please review my all attached files. And let me know how can i bind dynamically data in filter component.

 

Thanks,

 

Nikolay
Telerik team
 answered on 24 Aug 2020
1 answer
585 views

I am using kendo grid on multiple elements throughout my app. I want to do few changes wherever any grid is loaded fully.

Is there a way to write common function for all grids before grid is loaded ?

for ex - 

<script>

function afterGridRendered(){};
// code to bind above method to all grids 

$("#grid").kendoGrid({
            ...
        });

</script>

Ivan Danchev
Telerik team
 answered on 24 Aug 2020
2 answers
495 views

Hi. I'm using a kendo grid backed by a datasource to display some information. The configuration for one field in this datasource can be saved to a database and reloaded (the field is called 'isActive'). I am doing this by fetching the values from a database, looping over them, getting the corresponding dataItem from the dataSource and setting it like so:

//pseudocode

for each (f in filters) {

    if (!f.isActive){

         dataItem.set("isActive", false);

    }

}

The issue is that the time it takes to set a dataItem is between 3 and 5 seconds and I will sometimes be doing this for 100s of items, so it can be very slow. In the demo for setItem it runs much faster, I'm not sure what is different. Getting the dataItem takes a fraction of a second. Is there a faster way to achieve this? I have no idea why it is taking so long

Thanks.

 

Nikolay
Telerik team
 answered on 24 Aug 2020
5 answers
141 views
function GetWarehouseReleationByWarehouseId() {<br>    $.AjaxData.push({ key: 'WarehouseId', value: selectedWarehouse_OnWarehouseManagement.Id });<br>    AjaxTransactions(<br>        '../Warehouse/GetAllWarehouseRelationList/',<br>        $.AjaxData,<br>        function (result) {<br>            selectedWarehouseReleationData = result.Objects;<br><br>            KendoData('grdWarehouse_OnWarehouseRelation').dataSource.data([]);<br>            $.each(selectedWarehouseReleationData, function (index, data) {<br>                <br>                debugger;<br>                KendoData('grdWarehouse_OnWarehouseRelation').dataSource.add({<br>                    Id: data.Id,<br>                    Warehouse: { Id:1,WarehouseName:'test'},<br>                    ProcessType: { Value: data.WarehouseRelationProcessTypeId }<br>                   <br>                });              <br>            });<br><br>        }, 'post', 'json', false, false);<br>};

This My JavaScript fonks I set Value ınline Grid Combobox Here!!


    grid._schemaMethod = {<br>        model: {<br>            id: 'Id',<br>            fields: {<br>                Warehouse: { defaultValue: { Id: '', WarehouseName: '' } },<br>                ProcessType: { defaultValue: { Value: '', Text: '' } },<br>            }<br>        }<br>        };<br>    grid._columns.push(grid.GridColumn('Id', null, '200px', null, null, null, null, null, null, null, true));<br>    grid._columns.push(grid.GridColumn('Warehouse', Field_RelatedWarehouse, '200px', null, "#=Warehouse.WarehouseName#", null, null, null, null, null, null, null, null, null, RelatedWarehouseEditor));<br>    grid._columns.push(grid.GridColumn('ProcessType',Field_ProcessType, '200px', null, "#=ProcessType.Text#", null, null, null, null, null, null, null, null, null, ProcessTypeEditor));<br>    grid._columns.push(grid.GridColumn(null, '&nbsp;', '200px', { style: 'text-align:right' }, null, null, null, null, null, null, null, null, null, ['edit', 'destroy']));


This Part my Inlıne grid !!

 

1.function ProcessTypeEditor(container, options) {<br><br>    var processType = [<br>        { "Text": "Transfer" , 'Value': 1 },<br>        { "Text": "Talep" , 'Value': 2 }<br>    ];<br>    $('<input name="' + options.field + '"/>')<br>        .appendTo(container)<br>        .kendoComboBox({<br>            autoBind: false,<br>            dataTextField: "Text",<br>            dataValueField: "Value",<br>            dataSource: { data: processType },<br>        });<br>};<br>function RelatedWarehouseEditor(container, options) {<br><br>    GetWarehouseListByFacilityId();<br><br>    $('<input name="' + options.field + '"/>')<br>        .appendTo(container)<br>        .kendoDropDownList({<br>            autoBind: true,<br>            dataTextField: "WarehouseName",<br>            dataValueField: "Id",<br>            dataSource: { data: warehouseList_OnContactInfo },<br>        });<br>};

And I this Combobox Value 

 

What Can I now I cant set my result to combobox Can you Help Me ? !  !!

Eyup
Telerik team
 answered on 21 Aug 2020
12 answers
2.5K+ views

Hey

I have problem with the grid his not showing createdTime  Why ? I so Tired for searching solution  plzz help me Im beginner  In  kendo and that my code :

View :
@(Html.Kendo().Grid<appfox.Models.Address>()
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(p => p.AddressLine1);
            columns.Bound(p => p.AddressLine2).Visible(false);
            columns.Bound(p => p.AddressPostalCode);
            columns.Bound(p => p.CreatedDate).Format("{0:dd-MM-yyyy}").EditorTemplateName("Date");
            columns.Bound(p => p.CreatedTime).Format("{0:HH:mm:ss}").EditorTemplateName("Date");
            columns.Command(command => command.Custom("ViewDetails").Click("showDetails")).Width(180);


        })
                   .Resizable(resize => resize.Columns(true))
                    .Reorderable(reorder => reorder.Columns(true))
        .HtmlAttributes(new { style = "height: 380px;" })
        .Scrollable()
        .Groupable()
            .Sortable()
            
        
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
                   .Model(model =>
                    {
                        model.Field(x => x.AddressId).Editable(false);
                        model.Id(x => x.AddressId);


                    })
            .Read(read => read.Action("List", "Test"))
            
            )
 

)

@(Html.Kendo().Window().Name("Details")
    .Title("Customer Details")
    .Visible(false)
    .Modal(true)
    .Draggable(true)
        .LoadContentFrom("List", "Test")
    .Width(300))

_____________________________________________________________________________________

Class:

 public partial class Address
    {
        public int AddressId { get; set; }
        public string AddressLine1 { get; set; }
        public string AddressLine2 { get; set; }
        public Nullable<byte> AddressPostalCode { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string Country { get; set; }
        public string TimeZone { get; set; }
        public string CreatedBy { get; set; }
        public System.DateTime CreatedDate { get; set; }
        public System.TimeSpan CreatedTime { get; set; }
        public string UpdatedBy { get; set; }
        public System.DateTime UpdatedDate { get; set; }
        public System.TimeSpan UpdatedTime { get; set; }
    }
}

 

Controller 

        public ActionResult Index1([DataSourceRequest]DataSourceRequest request)
        {
            List<Address> omList = new List<Address>();
            Address om = new Address();


            using (Test1Entities objContext = new Test1Entities())
            {
                var q = objContext.Address.ToList();
                omList = getOrders(q);

                DataSourceResult result = omList.ToDataSourceResult(request);
                return View(result);

                // return omList;
            }


        }

        private List<Address> getOrders(List<Address> olist)
        {
            List<Address> omList = new List<Address>();
            foreach (var ads in olist)
            {
                Address o = new Address();
               
                o.AddressLine1 = ads.AddressLine1;
                o.AddressLine2 = ads.AddressLine2;
                o.AddressPostalCode = ads.AddressPostalCode;
                o.City = ads.City;
                o.State = ads.State;
                o.Country = ads.Country;
                o.TimeZone = ads.TimeZone;
                o.CreatedBy = ads.CreatedBy;
                o.CreatedDate = ads.CreatedDate;
                omList.Add(o);
            }

            return omList;
        }

        public ActionResult List([DataSourceRequest]DataSourceRequest request)
        {
            List<Address> omList = new List<Address>();
            Address om = new Address();


            using (Test1Entities objContext = new Test1Entities())
            {
                var q = objContext.Address.ToList();
                omList = getOrders(q);

                DataSourceResult result = omList.ToDataSourceResult(request);
                return Json(result, JsonRequestBehavior.AllowGet);

                // return omList;
            }
        }

Tsvetomir
Telerik team
 answered on 20 Aug 2020
5 answers
889 views

Hi ,

 

I have below scenarion

I am loading  text box  dropdown and switch in Grid in load, i need to maintain the selected values or entered values after the grid refresh

Is there any way to maintain

 

Anton Mironov
Telerik team
 answered on 20 Aug 2020
5 answers
147 views

when splitter moved to the right, Gantt's header's width was expanded,but  The  Width of Gantt's timeLine was not expanded.

I think the automatically calculated timeline width of the Gantt chart is wrong

How can I solve this situation?

 

ps Add another picture.

Neli
Telerik team
 answered on 19 Aug 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?