Never mind. I figured it out.
DataGridTableStyle ts_auditAddress = new DataGridTableStyle(); //Creates
new table Style
ts_auditAddress.MappingName = "AZMViewTable"; //Maps tablestyle to grid
datasource
DataGridTextBoxColumn DataCol_key = new DataGridTextBoxColumn(); //Adds
column to tableStyle
DataCol_key.HeaderText = "Customer Key";
DataCol_key.MappingName = "col_Key"; //maps Columnstyle DataCol_key to
column in datatable named col_Key.
ts_auditAddress.GridColumnStyles.Add(DataCol_key); //Adds Columnstyle
DataCol_key to TableStyle
dataGrid_auditAddress.TableStyles.Add(ts_auditAddr ess);
Thanks,
Angel
"Angel" <none> wrote in message news:Or*************@TK2MSFTNGP12.phx.gbl...
The Winform datagrid I'm working is already displaying data from a
datatable. How can I add columns to that datagrid? I know (or at least I
think I know) how to add the tableStyle and gridColumnStyles during design
time but I don't know what to do next (make the grid display the data).
The datatable is filled during run-time.
Thanks,
Angel