This is a migrated thread and some comments may be shown as answers.

Hide column in virtual grid - Bug

5 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 17 Dec 2019, 11:16 AM

Hi

 

I'm using virtual scrolling in a grid and want to show and hide columns dynamically.

While doing so, it seems to work first, but breaks, after scrolling down.

Hiding column 2 and scrolling down, removing column 2 values and replaceing them with column 3 values.

 

See example for this behaviour:

http://dojo.telerik.com/EJOZAJob/6

 

How to fix column values switching while scrolling and remaining correct columns and values on scroll.

 

Greets Robin

5 Answers, 1 is accepted

Sort by
0
Robin
Top achievements
Rank 1
answered on 18 Dec 2019, 08:08 AM

Not the best, but seems to work:

http://dojo.telerik.com/AgiPUVuy/12

Better solution is welcome.

0
Alex Hajigeorgieva
Telerik team
answered on 19 Dec 2019, 11:33 AM

Hello, Robin,

Thank you for keeping the thread updated.

The issue you are experiencing is due to the presence of a rowTemplate. When a row template is defined, the Kendo UI Grid does not use its own template so it becomes the responsibility of the developer to handle the hide, show and column reorder as you have discovered.

I would suggest using column templates instead for simplicity if at all possible in your scenario which will remove any need for programmatic template handling.

https://www.telerik.com/forums/columnhide-not-working-with-row-templates

Also, there is no need to make the data items observable, you can just pass the data array to the data source - the widget will internally transform them to observable as noted in the documentation here:

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/data

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Robin
Top achievements
Rank 1
answered on 19 Dec 2019, 12:49 PM

Hi Alex

 

Thanks for clearance.

Think I'll try to use columns template next time and use row bind in another way.

 

The observable part is from another problem I need to handle:

https://www.telerik.com/forums/update-single-cell-value-on-mvvm-jquery-grid-without-reloading-whole-grid#wHZHTCnTLk2Qy1ZKLvRsvQ

 

Greets Robin

0
Alex Hajigeorgieva
Telerik team
answered on 19 Dec 2019, 01:29 PM

Hello, Robin,

You should be able to redraw the row of the grid with this approach we have in the knowledge base:

https://docs.telerik.com/kendo-ui/knowledge-base/grid-update-particular-row-without-refresh

If you do not see any issues with it, you will be able to remove the extra code, what are your thoughts on that?

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Robin
Top achievements
Rank 1
answered on 19 Dec 2019, 01:58 PM

Hi

I'd prefer to update the one cell which got an update, instead the entire row.

beside that I do not had this example, but another one from the internet which I did not get to work.
Don't know what was the issue.

This time I will stay on my solution cause it's all live yet, so may try next time.

Greets Robin

Tags
Grid
Asked by
Robin
Top achievements
Rank 1
Answers by
Robin
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or