DataGrid Column Heading

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Hi

I am trying to change the Heading Name on a Datagrid from BudgID to "Budget
ID"

I am loading the data in fine but the HeaderText does not change or any of
the other properties. The program runs without errors.

Any suggestions

Thanks in advance

Bill





private void TheDataGrid()

// ---------------------------------------------------------------------------

//

{

string SQLBudget = "Select BudgID FROM Budget";

daQryBudg = new OleDbDataAdapter(SQLBudget,connMW);


daQryBudg.Fill(dsTest,"Budg");

DataTable tblQryBudget = dsTest.Tables["Budg"];


dgTest.DataSource = tblQryBudget;

DataGridTableStyle tsBudg = new DataGridTableStyle();

tsBudg.MappingName = "tblQryBudget";


cs = new DataGridTextBoxColumn();

cs.Width = 100;

cs.MappingName = "BudgID";

cs.HeaderText = "Budget ID";

ts.GridColumnStyles.Add(cs);

dgTest.TableStyles.Add(ts);


}
 
Hi
I figured it out. The mapping name should of been "Budg" instead of the
tblQryBudget
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top