473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

DataGrid Column Heading

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);
}
Nov 17 '05 #1
1 1177
Hi
I figured it out. The mapping name should of been "Budg" instead of the
tblQryBudget

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);
}

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jade | last post by:
Hi, I wanted to know if anyone know how to use the first column of the datagrid to display values that are pulled from a database, while the second column is one where i can add my own heading....
4
by: Bruce Pullum | last post by:
I have a datagrid that I am using a DataView with. All works great for the sorting of the columns. However, after I sort the column, and then try and select a data row to edit, the row selected...
0
by: Robert Brinson | last post by:
Hello all! I'm running .NET Framework 1.1 using VS.NET 2003. I've got a mystery with a DataGrid. Below is the definition of the DataGrid from my aspx page: </asp:datagrid><asp:datagrid...
10
by: Alan Lambert | last post by:
I am writing a web-based reporting tool and using a datagrid to display information returned from a database. I am displaying column headings from bound columns with no problems but I need to...
4
by: skOOb33 | last post by:
I successfully autosized the columns and rows on my Datagrid, and am now facing another issue. Having the sorting ability by clicking the column headers is key, but when I do that, it resizes all...
3
by: TPhelps | last post by:
I have a sample of an unbound (autogeneratecolumns is true) sortable/pagable datagrid that works. I want to change one of the columns to a hyperlink. The examples I find use a bound column. I...
4
by: Adrian Parker | last post by:
Can someone tell me how to be able to force line breaks in a datagrid column heading? If the text contains "abc<br>def" then that is what comes out; the source view contains the "abc&lt;br&gt;def". ...
4
by: cooltech77 | last post by:
Hi, I am trying to build the following functionality in the datagrid. I have a lot of columns in the datagrid which are being populated from the database and the user needs to scroll...
2
by: mark4asp | last post by:
This page is currently using a Repeater control to create a table with 6 columns. The first column has 2 ImageButton controls and a common header. How can I do this with a DataGrid ? I need...
1
by: ECD | last post by:
Hello all, I can usually find solutions to my .NET problems by searching these groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0 framework). I want to disable sorting on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.