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

Show/hide columns when RenderMode=Mobile

5 Answers 144 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mats
Top achievements
Rank 1
Mats asked on 30 Nov 2015, 02:05 PM

Hi,

When rendering the RadGrid in RenderMode=Mobile there are no check boxes to Show/Hide the columns from "Menu/Columns display".

The check boxes are there if I have any other RenderMode (like Classic or LightWeight).

Does anyone know how to get the check boxes ?

Thanks

/Mats

5 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 01 Dec 2015, 03:34 PM
Hello Mats,

See my test movie below that demonstrates how to show/hide columns in RadGrid with Mobile RenderMode
http://screencast.com/t/kkZkQtGdE

Note that you should have the AllowColumnHide="true" added in the RadGrid client settings in order to have the required option enabled.
                

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mats
Top achievements
Rank 1
answered on 02 Dec 2015, 08:59 AM

Hi Maria,

Thanks for your answer. It was the AllowColumnHide="true" that made the trick. I did not realize this since I don't need to set it in the other render modes (only in Mobile).

But I realize that I have another problem in regards to this:
I am making adjustments to the HeaderContextMenu (adding/hiding menu items and changing menu item texts). These adjustments will show in all render modes except for Mobile. Is there any way for me to make the adjustments in HeaderContextMenu to show when RenderMode=Mobile?

Thanks again,
/Mats

0
Marin
Telerik team
answered on 07 Dec 2015, 09:35 AM
Hello,

On the server side you can check the ResolvedRenderMode property of each Telerik control.

On the client-side the property is called: get_renderMode() returning a value from this enumeration:
Telerik.Web.UI.RenderMode.prototype = {
    Auto: 0,
    Classic: 1,
    Lite: 2,
    Native: 3,
    Mobile: 4
};



Regards,
Marin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mats
Top achievements
Rank 1
answered on 07 Dec 2015, 10:28 AM

Hi Marin,

I'm not sure I understand what you mean with your post.

My problem is that Telerik is building the "header context menu" totally different if rendered in standard (like Classic or Lightweight) mode than if rendered in Mobile mode.
If in standard mode you are using the RadGrid.HeaderContextMenu property as a "template" to build the context menu. When in Mobile mode the RadGrid.HeaderContextMenu property is not used at all. Instead you check the RadGrid markup (columns, sort expressions, grouping...) to build the functionality.

I make changes in HeaderContextMenu. When I open the menu on a column in a grid rendered in Classic or Lightweight mode then the context menu shows what I expect. But when I open the menu in Mobile mode then the functionality is not affected by my adjustments.

 Thanks

/Mats

0
Maria Ilieva
Telerik team
answered on 09 Dec 2015, 03:37 PM
Hello Mats,

If I understand your case correctly you are trying to access and customize some settings in the ContextMenu and your adjustments are not affecting the ContextMenu when the grid is in Mobile RenderMode.
If this is your case I would suggest you to elaborate on what changes exactly you are making and demonstrates the code that is working in Classic rendering so that we can advise on how to modify it for the Mobile RenderMode.

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Mats
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Mats
Top achievements
Rank 1
Marin
Telerik team
Share this question
or