| |||||||||||
VerticalAlign EnumerationSystem.Web.UI.WebControls Namespace Specifies the vertical alignment of an object within a control. RemarksThe VerticalAlign enumeration represents the vertical alignment options for an item relative to its container control. Members
ExampleThe sample below shows how to programmatically set the VerticalAlign property of a DataGrid at run time, depending on user input. The code also demonstrates how simple it is to retrieve the available system vertical align styles and dynamically add each to a selectable list. void Page_Load ( Object src, EventArgs e ) {
if ( !IsPostBack ) {
ICollection v_alignEnum =
TypeDescriptor.GetConverter ( typeof ( VerticalAlign ) ).GetStandardValues ( );
foreach ( VerticalAlign v in v_alignEnum ) {
AlignSelect.Items.Add ( v.ToString ( ) );
}
AlignSelect.SelectedIndex = 2;
string query = "SELECT Lastname, Firstname, Address, City, Country FROM nw_Employees";
myGrid.DataSource = fetchData ( query, "northwind" );
myGrid.DataBind ( );
}
myGrid.ItemStyle.VerticalAlign = ( VerticalAlign ) AlignSelect.SelectedIndex;
}
See Also |
| ||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme