Column Name appers twice after draging the column and will not be able to remove the column name in Kendo grid Jquery

0 Answers 54 Views
Telerik Trainer
Bhoomika
Top achievements
Rank 1
Bhoomika asked on 25 Jan 2023, 11:44 AM

Hi,

When I try to drag the column for grouping, the column name appears twice and I'll not be able to remove the extra duplicated one, but the column functionality is working fine.Please do help me resolve this issue.

For ex:If Im trying to group by Title, the column is retrieving the correct results after grouping, but after that if Ive to chose another column, the Title with Blue box remains on the screen and will not be able to remove it.

 

Here is my code:

$("#grid").kendoGrid({
                dataSource: {
                    data: pieChartValues,
schema : {

                          model : {
  id: "dDocName",
                                 fields : {
                                       dDocTitle : {
                                              type : "string"
  
                                       },
                                 other fields
                                 }
                          }
  
  
    
  
},
        pageSize: "",
                },
                <!--height: 885,-->
                groupable: true,
filterable: {
                    extra: false,
                    operators: {
                        string: {
contains:"Contains"
                            
                        }
                    }
                },
               
toolbar: ["search"],
                search: {
                    fields: [
                        { name: "", operator: "" },
{ name: "", operator: "" },


    
                    ]
                },
                sortable: true,
resizable:true,
   
dataBinding:onDataBinding,
                pageable: {
                pageSize: "",
pageSizes:true,

                messages: {
                empty: ""
                }

                },
groupable: true,


dataBound: function() {
for (var i = 0; i < this.columns.length; i++) {
this.FitColumn(i);
}
},

                columns: [{
                    field: 
                    title: 

Other fields

                },]

            });

}
        });

Nikolay
Telerik team
commented on 30 Jan 2023, 07:24 AM

Hi Bhoomika,

Thank you for sharing the Grid declaration.

I tried to reproduce this undesired behavior however, I was unable to. Please refer to the following Dojo demo:

Can you please modify it to showcase the problem so I can investigate further?

As a side note, I noticed you are calling FitColumn() method but the correct one is autoFitColumn()

Also, I noticed you are using a Less material theme and the Less themes have been deprecated with the latest Kendo UI R1 2023 release, thus, I strongly recommend switching to a Sass theme. Support for the Less themes will be discontinued in the very near future.

Regards,

Nikolay

Bhoomika
Top achievements
Rank 1
commented on 31 Jan 2023, 10:14 AM

Hi Nikolay,

Firstly thank you so much  for the suggestion, regarding FitColumn() method I removed auto from autoFitColumn() because I wanted to make the grid responsive.

If I call autoFitColumn(), the grid wont be responsive and Group by columns functions properly .

If I call FitColumn(), the grid will be responsive and Group by columns functionality fails as attached in the pic.

Can you please provide me any other solution for making the Kendo grid responsive.Ive referred the telerik links but I couldnt get the solution

And also after you suggested I changed the less theme to Saas  theme

Links in my code earlier(Less theme):

<link rel="stylesheet" href="/kendo/styles/kendo.common-material.min.css"/>
<link rel="stylesheet" href="/kendo/styles/kendo.material.min.css"/>
<link rel="stylesheet" href="/kendo/styles/kendo.material.mobile.min.css"/>

 

I changed it to Saas theme, correct me if Im wrong

<link rel="stylesheet" href="/kendo/styles/kendo.common.material-main.min.css"/>
<link rel="stylesheet" href="/kendo/styles/kendo.material-main.min.css"/>
<link rel="stylesheet" href="/kendo/styles/kendo.material-main.mobile.min.css"/>

 

Kindly help me with this,

Thanks,

Bhoomika K C

 

Nikolay
Telerik team
commented on 03 Feb 2023, 09:04 AM

Hi Bhoomika,

The Grid supports responsive columns that enable you to hide or display columns with the help of the columns.media property. Please check out the following demo that shows this in action:

Also, below I am posting an article on responsiveness in the Kendo UI components including the Grid:

I hope this helps.

Regards,

Nikolay

No answers yet. Maybe you can help?

Tags
Telerik Trainer
Asked by
Bhoomika
Top achievements
Rank 1
Share this question
or