Wednesday, November 11, 2009

How To Set Column Width in AspxGridView in C#

There are Two Class Ledger and AccountGroup ,There is a XpCollection of Ledger on AccountGroup and its one part is on Ledger
Now Find Ledger Property From AccountGroup and Find its ListView and then Find the Column whose width you have to Change.
if (View is DetailView && View.ObjectTypeInfo.Type == typeof(AccountGroup))
{
DetailView dv = (DetailView)View;
ListPropertyEditor lv = (ListPropertyEditor)dv.FindItem("Ledger");
ListView Lv = (ListView)lv.ListView;
ASPxGridListEditor editor = (ASPxGridListEditor)lv.ListView.Editor;
ASPxGridControl gridView = editor.Grid;
gridView.SettingsBehavior.ColumnResizeMode = ColumnResizeMode.Control;
gridView.Columns["Name"].Width = new System.Web.UI.WebControls.Unit(350);
}

No comments:

Post a Comment

Mat Table Angular

Mat Table in Angular Mat table is used to display data . its a material designed styled data-table . For using Material Table MatTableMo...