No linebreak in ASP.NET - asp.net

just wanna ask is it possible to remove the linebreaks? Now I want to have a row of textbox, buttons and a combobox, but the combobox will be at new line when I run the application. So is there a way to stop it from going to a new line? Thanks.

Setting the form elements style display property to "inline" will ensure they fall on the same line until they run out of space, at which point of course, they have to go to the next line. Now you can set the height and width properties on the form elements so they all fit on the same line, and even expand to fill the available space if needed.
The combo box should have it's style display property set to block, so it will fall on the next line automatically. EX: Style="display:block"

Are you running out of vertical space? Inline is the solution if not, as some elements may default to block and add a new line.
But if you want everything to be on the same line, but are running out of space, you could try specifying for a root element style="white-space:nowrap;". I forget if it's white-space or whitespace, but either it would prevent wrapping of elements that way.

Related

How can I exchange an item and a spacer?

In qt, I have a form that contains among other things, a group with
A combo box
a checkbox
a spacer
a button
Based on some logic, I want sometimes to show another combo box... Where the spacer is, but smaller.
When I add it though, everything resizes automatically
I don't see a way to make it invisible, and yet keep items of the same size when I make it visible again.
I tried making it fixed size... But unless I use fixed sizes and positioning for everything, which I think is a bad idea, the items still move around when I change visibility.
It seems silly... But how can I make my little combo box show up instead of the spacer not next to it ? Spacers don't seem to have a name...
I would do
combo.setVisible(condition);
Spacer.setVisible(!condition);
Very easy... Except how do I access the spacer from code ?
My suggestion is to use a container QWidget instead of the spacer. Here is how it will look:
A combo box
a checkbox
a widget-container
a button
Widget-container is a QWidget with fixed size. Put your combo-box there and it will maintain it's size when you show/hide the combo-box.
Regarding your question (You will not need it but just to know in the future):
how do I access the spacer from code
You can create a spacer from code like this:
QSpacerItem* spacer = new QSpacerItem(0, 15, QSizePolicy::Fixed, QSizePolicy::Fixed);
layout->addItem(spacer);
...
Also you can get it from a layout if you know its index:
QLayoutItem* item = layout->itemAt(index);
But there is no such method as show/hide for layout items.

ASP.NET drowdownlist item text preceding blank space is not rendered

I need to indent some dropdownlist item texts to right based upon a condition. For this I simply add blank space to the left of those item text, however they don't get rendered and the texts get trimmed. Here's what I've tried so far:
Left padded certain texts right in the database (the dropdown list is populated from database)
item.Text=" "+item.Text;
item.Text=" "+item.Text;
None of the above methods work. What is the proper way of doing this? I don't want to go CSS.
Here is the jsfiddle
I think this is more a HTML then ASP.NET issue. In HTML spaces are trimmed between elements. The spec determined that 'non-significant' whitespace must be removed.
You have to use to make a 'significant' whitespace which will be rendered when at the start or end of an element.

Is there a CSS property which acts like android XML "wrap content"?

In particular I have a GWT project with a
TextArea element which I want to conform to a set width and expand as much as needed to the bottom.
ListBox element which I want to conform to a set width and expand vertically to show the entirety of the displayed list item.
Those are two widgets using replaced elements: <textarea> and <select> respectively.
for the TextArea, there's no way to make it really "resize automatically" other than listening to events and computing the new size (there's actually no need to compute the new size, you can just let the browser do it; see http://phaistonian.pblogs.gr/expanding-textareas-the-easy-and-clean-way.html)
for the ListBox, it's impossible to have the items' text wrap. See Word wrap options in a select list for a similar question in pure JS.
Set the width to whatever number and set height to auto.

How do I truncate a Flex StyleableTextField after two lines?

In my Flex 4.5 mobile app, I have an actionScript item renderer (that derives from Flex's LabelItemRenderer). I want to fit in exactly 2 lines of text, and then truncate the rest. The width and height of the label are fixed and known statically.
How can I do this? The StyleableTextField.truncateToFit() method only works for one line of text.
I've set wordWrap = true, so the text now flows into the second line - but I need to truncate the text if it doesn't fit in two lines.
I need it to show all the text if there is only one line. (in both cases the label should be vertically middle-aligned in my renderer)
I know how to override layoutContents to do sizing and positioning etc of the StyleableTextField. So I'm looking specifically for ideas to implement custom text truncation with the StyleableTextField).
Any ideas?
Unless you're using something specific to the StyleableTextField try the s:Label. It has a property maxDisplayedLines which you could set to 2 and it will handle the truncation.

Displaying one component on the top of other

How can I display one component on the top of another one in flex without explicitly mentioning x-axis & y-axis?
Use canvas and inside canvas you can add controls that will be displayed one above another, the last one added will be the top most one and first added will stay in behind.
Something else to consider, depending on your UI:
This is still a bit 'hacky' (any solution for doing this will be), but given a container (VBox etc) with two or more components, set the includeInLayout property in the first component to false. When the container renders the second component will ignore the first and draw on top.
This also would allow you to add additional components in that same container, but obviously it depends on your UI a great deal.

Resources