DataTable Column question

  • Thread starter Thread starter Mika M
  • Start date Start date
M

Mika M

Hello!

I add column into DataTable after table is filled into DataSet like ...

ds.Tables("WorkQueue").Columns.Add("OpenQty", GetType(Integer),
"OrderedQty-PreparedQty")

This column will be the last one, but how can I place it just after
'OrderedQty' 'PreparedQty' columns, because then it's not the last column?
Is this even possible?
 
Apply a DataGridTableStyle to the grid:

DataGridTableStyle gridStyle = new DataGridTableStyle();
gridStyle.MappingName = PMProductCollection.TABLE_NAME; //make sure that
this matches the table name
itemsGrid.TableStyles.Add(gridStyle);

//OrderedQty
DataGridColumnStyle dgcs = new DataGridTextBoxColumn();
dgcs.MappingName = OrderedQty;
dgcs.HeaderText = "Quantity Ordered";
//dgcs.ReadOnly = true; ?
gridStyle.GridColumnStyles.Add(dgcs);

//PreparedQty
DataGridColumnStyle dgcs = new DataGridTextBoxColumn();
dgcs.MappingName = PreparedQty;
dgcs.HeaderText = "Quantity Prepared";
//dgcs.ReadOnly = true;
gridStyle.GridColumnStyles.Add(dgcs);

//OpenQty
DataGridColumnStyle dgcs = new DataGridTextBoxColumn();
dgcs.MappingName = OrderedQty;
dgcs.HeaderText = "Quantity Open";
//dgcs.ReadOnly = true;
gridStyle.GridColumnStyles.Add(dgcs);


The order you add column styles to the table style is the order they will be
displayed in.

HTH;
Eric Cadwell
http://www.origincontrols.com
 
Back
Top