13 Answers, 1 is accepted
You can use the Device Detection Framework for changing the MultiViewColumns and MultiViewRows properties, based on the screen size:
Hope this helps.
Regards,
Konstantin Dikov
Telerik by Progress
Thanks but it doesn't seem to work....
I added the following, but even when I narrow my browser on my laptop to where all the other controls show the "Small" or "XSmall" setting this still returns "XLarge"....
DeviceScreenSize screenSize = Detector.GetScreenSize(Request.UserAgent);
if (screenSize == DeviceScreenSize.Small)
{
radCalendar.MultiViewColumns = 2;
}
Have you tried to customize the RadCalendar based on the Height and Width properties returned from the DeviceScreenDimensions (Detector.GetScreenDimensions(Request.UserAgent))?
Regards,
Konstantin Dikov
Telerik by Progress
As documented in the help article, if there is no match for the device made the request, the Width and the Height will be 0, but opening the page from mobile devices will return the correct size. As for the DeviceScreenSize, the size of the browser will not make any difference on the screen size of the device, because this is a client characteristic. If you need to make any changes to view depending on size of the browser's window you will have to retrieve that information on the client and pass it to the server manually. For example, you can store that information in a HiddenField and initiate a postback when the size of the window changes.
Hope this helps.
Regards,
Konstantin Dikov
Telerik by Progress
This does NOT work. It still shows as 3 months accross on my phone....
//DeviceScreenDimensions screenSize = Detector.GetScreenDimensions(Request.UserAgent);
//if (screenSize.Width > 0 && screenSize.Width <= 500)
// radCalendar.MultiViewColumns = 1;
//else if (screenSize.Width > 500 && screenSize.Width < 1000)
// radCalendar.MultiViewColumns = 2;
//else
// radCalendar.MultiViewColumns = 3;
This does seem to work....
DeviceScreenSize screenSize = Detector.GetScreenSize(Request.UserAgent);
if (screenSize == DeviceScreenSize.Small)
radCalendar.MultiViewColumns = 1;
else if (screenSize == DeviceScreenSize.Medium)
radCalendar.MultiViewColumns = 2;
else
radCalendar.MultiViewColumns = 3;
Can you please elaborate on what device you are testing the and on which browser? As I have mentioned previously, if there is no match for the device making the request, the GetScreenDimensions method will return 0 and you will have to use the GetScreenSize method instead.
Regards,
Konstantin Dikov
Telerik by Progress
The Samsung Galaxy S 6 model is not included in our data, but I will forward this to our developers team, so they could include it for the future releases. For the time being you could use the approach with the GetScrenSize method.
Best Regards,
Konstantin Dikov
Telerik by Progress
Really?? That phone has been out for at least a year and it is not included. How does that work when my clients get new devices then? When do you typically add them? That seems like a HUGE issue.
I have tried the other method you suggested first and that didn't seem to work either....
There is a internal list with the UserAgents and the DeviceModels, which contains the information needed by the Device Detection Framework. As I have mentioned, I will forward this to our developers, so they could update those lists accordingly.
As for the GetScreenSize approach, you have mentioned in one of your previous posts that this approach works and allows you to change the views of the RadCalendar, which is why I suggested that you keep using this approach.
Please excuse us for any inconvenience caused by this.
Best Regards,
Konstantin Dikov
Telerik by Progress
Although that there is no fixed time frame in which the list is updated, you should keep in mind that it is not possible to update that list with every new phone that is coming out. However, all popular phones should be updated as soon as possible, so as I have mentioned, I will forward this to our developers team and furthermore, we will reconsider the practice for updating the list regularly.
Regards,
Konstantin Dikov
Telerik by Progress