Skip to content

Instantly share code, notes, and snippets.

@strepicor
Created August 29, 2017 02:23
Show Gist options
  • Save strepicor/ef02706dc21379106eb72131e1b3748c to your computer and use it in GitHub Desktop.
Save strepicor/ef02706dc21379106eb72131e1b3748c to your computer and use it in GitHub Desktop.
UltraGrid Column Header Name, Width & Position
private void grdName_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)
{
foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn col in grdName.DisplayLayout.Bands[0].Columns)
{
if(col.Key == "DB_Col_Name_1")
{
col.Header.Caption = "Column Name 1";
col.Width = 100;
col.Header.VisiblePosition = 1;
}
else if(col.Key == "DB_Col_Name_2")
{
col.Header.Caption = "Column Name 2";
col.Width = 50;
col.Header.VisiblePosition = 2;
}
//....
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment