Hello,
I have a Grid Grouping Control in Essential Studio 10.4.0.71 that does not seem to work with percentages for the width. If I set the width to some exact value (e.g. 200px or 600px) the width is as expected. However if I set the width to 60%, the width is ignored without error and the control stretches across the screen. This is a non-Ajax grid, nested in a <div>, no-cell wrapping, with scroll bars, and used with master pages.
I want the grid to fit within a specific area (within the <div>, actually) and resize with the browser window. My existing control (Infragistics) did this automatically, when the width was set to a percent. I also tried putting the grid control in an <asp:Panel> but it would not respect the panels size (even with the width and height tags completely removed from the grid control).
Why won't Width="60%" work???
Visual Studio 2010
.NET Framework 4.0
Essential Studio 10.4.0.71
VB.Net Code behind
Thanks!
--Dale
Hi Dale,
Thanks for using Syncfusion products.
We are sorry for inconvenience caused. We are unable to reproduce the issue. We have prepared a simple sample, video demonstrating the working of the sample and the same can be downloaded from the following links.
Sample link: sample.zip
Video link: video-2.zip
Could you please try the above sample and get back to us whether you are able to reproduce the issue? If not, could you please give more information or by reproducing the issue in the above sample so that we could sort out the issue and provide you with solution. The information provided would be of great help in resolving the issue.
Please let us know if you have any concerns.
Regards,
Ranjithkumar
Ranjithkumar,
Thank you for the very detailed video and example! I can confirm that your example worked as expected for me (compiled in VS2010, viewed in IE7). The width of the grid did obey the 'Width' setting as a percentage.
Puzzled as to what the issue might be, I started moving code and ASP source from my solution into your example line by line. By doing so, I was able to find the cause. I can send you the updated example source code, but the changes are so minor I do not think it will be necessary.
The only changes made to your example were the addition of some extra columns, and an update to the code-behind class that populates them. The text added is quite long, to force scrollbars on the grid (to emulate my issue). Attached are two screen captures that illustrate the problem I am having.
Your Example uses
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <div>
With a proper result.
If however we change
<div> to
<div style="position: absolute">
the grid no longer respects a width as a percentage. This is unfortunate, as my CSS design requires both <div style="position: absolute"> AND a grid width as a percentage. What can I do to the grid to make it respect this setting?
Thanks!
--Dale
Hi Dale,
Thanks for your update.
Sorry for the delay in getting back to you.
We have forwarded your query to our development team for further analysis. We will update you on two business days.
Please let us know if you have any concern.
Regards,
Ranjithkumar.
Ranjithkumar,
It's been a few more than two business days, do you have any news?
Thanks!
--Dale
Hi Dale,
Sorry for the delay in getting back to you.
We would like to let you know that , if we set position as absolute for ‘div’, it will not recognize its parent element and set to its own minimum width. So we suggest you to set width for the ‘div’ in pixels where you set position as absolute. If you set the width in percentage, it will set the width of the ‘div’ based on the ‘body’ element. Please refer to the below document based on simple table for clear understanding.
Setting position as absolute for div.docx
Please let us know if you have any concern.
Regards,
Ranjithkumar