views:

797

answers:

3

I am using Infragistics wingrid in my application. I have assigned a datasource to my wingrid.Now i want to add a new column at a specific location.

Can any one plz tell me how can this be performed.

Regards,

Savan

+1  A: 

Greetings,

I would add the new column to your datasource. Since the datasource is bound to the grid the column should appear.

Brian Kriesel
+1  A: 

It sounds like you're trying to add an unbound column. In this case you can add the following in the InitializeLayout delegate of the grid:

private void myUltraGrid_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
     e.Layout.Bands[0].Columns.Add("New Column Name");
}
Blanthor
A: 

Infragistics HOWTO:UltraWinGrid Layout Initialization

http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1692

From the article: "When the DataSource property of the grid is set to a source of data, the InitializeLayout event fires. The UltraWinGrid expects grid layout initialization to be performed inside this event. This does not mean that you can’t tweak the layout at other times, but most of the layout-related properties should be set inside the InitializeLayout event."

ephemeral