Dojo DataGrid - preventing column resize - datagrid

Is there a way to set a fixed column size in Dojo DataGrid, and not allow it to be resized by the user? Thanks.

The cells defined within the grid's structure support a boolean noresize property. Setting this to true will disable resizing on that particular cell.
You might want to do something about overriding the default CSS though - it appears to use a rather noticeable cursor when hovering over non-resizable cell boundaries.
You can also set a specific width of a column in the structure using the width property on a particular cell.
Example: http://jsfiddle.net/kfranqueiro/qNfC9/

Related

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 to get a DevExpress grid to fill a user control

I am quite new to ASP.NET development so I am unsure of how to do this without hardcoding the value.
To make the ASPxGridView to occupy a container space by width, set the control's Width property to 100%. This trick won't work for the height. Please note, the ASPxGridView is an XHTML compatible control and this standard does not support setting the height property yo 100%. Also, I should tell you that usually the grid's height is defined by its content. I.e. if you are planning to show 10 records per page, the grid's height will be identified by the height of these 10 rows + height of the column headers pane, height of the pager and other elements (footer, group panel...). If you want to set the control's height directly, I would suggest that you activate the vertical scrollbar (Settings.ShowVerticalScrollbar = true and specify the Settings.VerticallScrollableHeight property. This property will allow you to define the height of the of the scrollable part (rows). I hope, this information will be helpful to you.

QTreeWidget set height of each row depending on content

I want to make editable cells with multi-lines content in QTreeWidget and I use for this purpose QPlainTextEdit as a delegate. I need to set proper size to all rows that switching between editing and displaying went smooth, without any visible changes.
rect = textEdit.blockBoundingRect(textEdit.firstVisibleBlock())
With this I can find out the height I need to set for the row, but I missing the place where I can do it.
How can I set proper height to QTreeWidget's rows on initialization stage and how to handle it's changes?
You need to reimplement delegate's sizeHint(). It will automatically handle row's height and width.
And note, that QTreeWidget::uniformRowHeight property must be false in this case, though it will slow tree element rendering if it contains many rows.

Auto-sizing and positioning in Flex

I am working on a flex app that uses XML templates to dynamically create DisplayObjects. These templates define different layouts that can be used for each page of content in the app (ie , 2 columns, 3 columns etc etc). The administrator can select from one of these and populate each area with their content.
The templates add one of 3 types of DisplayObject - HBox, VBox or a third component - LibraryContentContainer (an mxml component that is defined as part of the app) - which is effectively a canvas element with a TextArea inside.
The problem that I am getting is that I need each of these areas to automatically resize to fit the length of the content but don't seem to be able to find an effective way to do so.
In the LibraryContentContainer, when the value of the TextArea is set, I am calling .validateNow() on the LibraryContentContainer. I then set the height property on both the TextArea and LibraryContentContainer to match the textHeight property of the TextArea.
In the following example, this is the LibraryContentContainer, viewer is the TextArea and the value property of the TextArea is bound to this.__Value. v is the variable containing the content for the textarea
this.__Value = v;
this.validateNow();
this.viewer.height = this.viewer.textHeight;
this.height = this.viewer.height;
This works to a degree in that the TextArea grows or shrinks depending on the length of content, but it's still not great - sometimes there are still vertical scrollbars even tho the size of the TextArea has grown.
Anyone got any ideas?
Thanks
Adam
I think the problem lies not with your dynamically added components, but with the component they're being added to. How is the height of this component being determined? If you set verticalScrollPolicy and horizontalScrollPolicy on this container to off, do your scrollbars disappear? If that's the case, then you'll need to look at how this component is sized rather than your hbox, vbox, or whatever it is you're adding.

Change the height of a list item when it's in edit mode

I have custom list item renderers and editors for a List control. I need for the editor to have a greater height then the renderer, i.e., the row should expand(in height) when it goes into edit mode. However, even when the list's variableRowHeight is set to true, it doesn't do what I want: the height seems to be based on the height of the renderer only, not the editor. Is there any way to do what I want?
Have you tried setting the height of each of the renderers on the row that the editItemRenderer is on.
If my memory serves me correctly the varible row height takes its height from the first column cells (this may be wrong?)
If you have varibleRowHeight then when you go to edit a cell make sure all cells in the row are the same height and you may also have to invalidate the size and display.
If you have already solved this post your answer as it would be interesting to see what different approaches you may have taken.

Resources