How to get a DevExpress grid to fill a user control - asp.net

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.

Related

How to fix a DevExpress GridView extension's width while keeping its columns' widths resizable

I want to allow the user to resize the GridView extension's columns' but the total width of the grid should be fixed.
I am currently using these settings.
settings.Width = 1200;
settings.SettingsBehavior.ColumnResizeMode = ColumnResizeMode.Control;
settings.Settings.HorizontalScrollBarMode = ScrollBarMode.Auto;
Though they cause the columns to resize, they also resize the width of the grid when I resize the columns.
Some important things:
a) I am using ASP.NET MVC 4 and DevExpress v12.2.10.0
2) My grid has just 2 columns.
You have to use ColumnResizeMode.NextColumn in the settings of the GridView.
From the documentation:
Changing a column's width changes the next column's width.

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.

Dojo DataGrid - preventing column resize

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/

Adjust Width & Height of a Control (ASP.NET)

I am just starting to study ASP.NET from my WPF Knowledge. I think the UI designing is very difficult in ASP.NET compared to WPF XAML design.
I have a problem in my UI layout. In WPF we use Width=" * " and Height=" * " to adjust height and width of the controls like listview, listbox so that the application can run in any resolution without overlapping ? What is the alternate way to set height and width in ASP.NET?
Ideally you'll want to be setting the style's of your controlls using CSS.
If you have a control that has a CssClass="myControl" then in your CSS you'll be able to do the following:
.myControl{
width: *px;
height:*px;
}
Where * is a numerical value. You can also change the value type from px to % and other value types.
Using a % value type will allow you to cater for multiple resolutions whilst retaining a similar feel to your application.
Use '%' for specifying height and width.
Specified as a of
containing block's width.
Read
width and height

Discovering row height of autosized GridView row in ASP.NET

I have a number of GridView controls that I need to position side-by-side on a page. For example a GridView containing a list of items in a shopping basket, and a number of GridViews to the side showing pricing from a number of suppliers.
The columns are fixed width in the first GridView - meaning that the row height is variable depending on the amount of text.
So, the question is this - is there any way to discover the individual row heights of the first data-bound GridView such that I can alter the other GridViews to correctly align?
The Row.Height property of the grid after databinding is empty as the height has not been explicity set.
thanks!
I don't know of any way to do this in .Net, you can use javascript, maybe set a .Net hidden field on load if you need it in code behind :
var h = document.getElementsByTagName('td')[0].offsetHeight;
Keep in mind this height will also include any cell padding or spacing you have set. Also, this assumes you're not explicitly setting the height in CSS which based on your question I assume you are not.

Resources