I am trying to achieve a responsive design mechanism using Win Forms C#. The approach I adopted now is to create container flowlayoutpanel then several tablelayoutpanels to it with controllers as showing in the below Image:
The Image shows that the flowlayoutpanel flow direction is set to left to right and the table docked to the top. the table layout controls are anchored top, right left. The problem is when resizing the tablelayoutpanels are stacked vertically but an extra room is created. View Image Two.
I tried to remove the extra space room by anchoring tablelayoutpanels to top, left, right. But did not work. The proposed way is to calculate the offset and do the adjustment. But unable to calculate the offset. How Can I make tablelayoutpanels fills the extra spaces and extend the last tablelayoutpanels width in accordance to other tablelayoutpanels until the extra room fits the tablelayoutpanel from second row. Please Consider that I would like to continue using flowlayoutpanel.
Related
I need to place three buttons at the bottom of my page and I want them to be in the left corner, center and right corner respectively. I did create HorizontalLayout into which I added my button. I am fighting with all kinds of alignments for over three days, but whatever I do, buttons remains in the left corner. Here is my code:
HorizontalLayout bottomLayout = new HorizontalLayout();
bottomLayout.setWidthFull();
bottomLayout.setHeight("82px");
bottomLayout.add(buttonA, buttonB, buttonC);
// bottomLayout.setAlignItems(Alignment.STRETCH);
bottomLayout.setAlignSelf(Alignment.END, buttonC);
bottomLayout.setAlignSelf(Alignment.START, buttonA);
bottomLayout.setAlignSelf(Alignment.CENTER, buttonB);
Please do tell me what I am doing wrong and how to correct it.
Also, all my buttons are 80px high and while first two looks vertically aligned to each other, the third one looks couple pixels higher. How do I align them vertically as well?
What you're looking for is bottomLayout.setJustifyContentMode(JustifyContentMode.BETWEEN);
Explainer:
Layouts are 2-dimensional, so the elements in them can be aligned in two ways: horizontally and vertically.
In CSS FlexBox layout model terminology
justification refers to alignment along the layout's direction (horizontally for horizontal layouts)
alignment refers to "cross-axis" alignment (vertically for horizontal layouts)
So setAlignItems and setAlignSelf both refer to the alignment above, wheras setJustifyContentMode refers to justification above.
I have to admit it's really not the most intuitive API. It is like that because it tries to follow the CSS FlexBox model and terminology.
I started a new project as an ASP.NET Web Application and have been going from there modifying it to my needs, but I cannot figure out how to get rid of the margin on the left so that my page can expand to fill the display. You can see the space to the left of the table in the image linked below. No matter what I put in the white area it cannot expand any further left, even if it has to expand enough to the right to put a horizontal scrollbar on the screen. I'd like to avoid a horizontal scrollbar. What should I change to get rid of this margin?
https://imgur.com/UxeZ6wc
From the image it's not possible to inspect the code but I suggest to make sure your style sheets have the right width.
"keep calm and start coding" (etabetaweb)
I'm using Angular UI Grid in a project. The grid sizes itself so that all the columns fit horizontally in a div.
This works great, until there are more rows than fit on one screen. Then, a vertical scroll bar comes up (good), which covers part of the last column (bad). Horizontal scroll bars can be enabled to reach those last 20 or so px, but when you scroll horizontally, the header cells don't scroll. This throws everything out of alignment.
Since the grid was perfectly sized before the scroll bar, there should not be a need for the horizontal scroll bar. But the way the scroll bar covers the content means that without it, you can't see anything that might be in the right 20 or so px.
I need to fix this. Here are some solutions I have looked into implementing, unsuccessfully:
Find some way to know if there is a vertical scroll bar and add padding or margin somewhere to push in the content of both the header cell and the data cell, to keep things in alignment. I haven't found an easy way to grab the container who may or may not have a scroll bar and then I think the logic to ask it if it has a scroll bar would be brittle. Plus, just playing around with adding padding where I think it should go did not effectively push over the content.
Find a way to let the container with the scroll bar push outside of the grid when it has a scroll bar. This has basically the same issue as #1 in that that guy is pretty slippery.
Find a way to replace the scroll bar with my own. It seems that there is someone who did a branch that lets you do this with a specific library, but we are tied to a specific commit of UI Grid and adding libraries takes an act of congress.
Thoughts?
How you can know if there is a vertical scrollbar :
If you haven't customized the rows with a rowTemplate, then you might be having a rowHeight of 30px (if not please inspect).
var dataRowHeight = (numberOfRows * 30) + padding (if you have);
var gridElementHeight = angular.element("#my-ui-grid-div-id")[0].offsetHeight;
if (dataRowHeight > gridElementHeight) {
// you have a verticalscrollbar
}
Safe side : specify width for all columns by % and leave 1% behind for the scrollbar.
Ugly side : Get the width of the 'viewport', loop through and calculate the actual pixels from your provided percentage for all columns, if you detect a vertical scrollbar using the technique above, leave 15px behind.
For the project I have the following Layout:
The content of the page should use the entire space on the screen since the table will be very big. I think a responsive layout is the right for that.
The header contains two Logos which float to the left and a Login block floating to the right side.
In the content area the Navigation box will be always on the left side. Next to it is the table. In the table rows and columns can be added, that is why the table can get very big and should use all the available space. At some point a horizontal slider makes it possible to scroll the table left and right.
Under the content the fototer contains four boxes with additional Information.
What is the best grid solution to realize this kind of Web application?
I'm using CSS table to create a responsive layout and to align images horizontally. All the images will resize horizontally when I resize the screen size.
But the problem is the image on the right hand side will never align itself, if you take a look at my pen:
http://codepen.io/vincentccw/full/IlHfj/
Clearly you can still see the a very thin red line on the top right image, what made it even worst is if I resize them slowly, the whole image start to wobble.
Is there a workaround for this?
Your images are not lining up because even though you have given the cells the same width, due to the way tables are rendered (and the number of decimal places you have used) your right cell is slightly thinner than your left cell making that image slightly shorter (resulting in the red line)
You can either add vertical-align:top to your cells (to stop the wobble) or make sure that the left and right cells are going to be the same width by removing the width for the middle column: http://codepen.io/anon/pen/pzrvc