473,387 Members | 1,891 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,387 software developers and data experts.

DataGrid Header and Text Alignment

Is there anyway to align HeaderText different from text in the column. I want my text to be right aligned and headertext to be center. I don't want to add blank spaces in HeaderText as I am using a function which autoresizes the column.

thanks

Jul 21 '05 #1
2 1757
Hi,

DataGrid has HeaderStyle property. Couldn't you do the alignment with it?

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke
"PankajBanga" <Pa*********@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
Is there anyway to align HeaderText different from text in the column. I want my text to be right aligned and headertext to be center. I don't want
to add blank spaces in HeaderText as I am using a function which autoresizes
the column.
thanks

Jul 21 '05 #2
ah, sorry for that.

Have you tried asking this at Windows Forms Forums:
http://www.windowsforms.net/forums/

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke
"Job Lot" <Jo****@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
I am talking Windows Form DataGrid Control and Web Forms

"Teemu Keiski" wrote:
Hi,

DataGrid has HeaderStyle property. Couldn't you do the alignment with it?
--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke
"PankajBanga" <Pa*********@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
Is there anyway to align HeaderText different from text in the column.
I want my text to be right aligned and headertext to be center. I don't want to add blank spaces in HeaderText as I am using a function which autoresizes the column.

thanks


Jul 21 '05 #3

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

Similar topics

2
by: Jim Dougherty | last post by:
I am using c#.net 2003 and have an an application with a datagrid. The binding is with an array of structs. Everything works ok except the header text is the struct element names and they override...
2
by: Stan Sainte-Rose | last post by:
Hello, I need to know how to format Integer and Real with the datagrid. In fact, I want to use the right alignment. When I use this option the header text comes with the right alignment too. :( ...
2
by: pmcguire | last post by:
I have derived a ComboBoxColumnStyle that inherits DataGridColumnStyle. It works fine except for one behavior. If the user selects a new value from the ComboBox's pulldown list on a brand new...
1
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
5
by: EdB | last post by:
1) How do I make the contents of a Windows datagrid editable while at the same time preventing new rows from being added? 2) How do I align the contents of a column align-right, but the header of...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
0
by: Sam | last post by:
Hi guys, I tried to use DataGridTextBoxColumn alignment property to format my data in the datagrid and I don't quite get what I'd like it to be. The problem is that when I set the alignment...
2
by: John Smith | last post by:
Hi all; Putting "Due" into the column header of a datagrid. Font is a proportional fort. When the alignment is left, there is some space between the column separator bar and the D in Due....
3
by: Simon Abolnar | last post by:
Is it possible to align headers and text in different way. Because with: dgts.GridColumnStyles(0).Alignment = HorizontalAlignment.Center alignment is set for all column (header and text). ...
7
by: Doug Bell | last post by:
Hi Does anyone know (or point me where I can find) how to set the alignment of a DataGrid Column Header different to the alignment of the column. I am trying to show some Right aligned columns...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.