Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2005, 02:05 AM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Header Alignment in System.Windows.Foms.DataGrid

Hi all,
I am having a problem of aligning the header of the datagrid. I want my text in a column of datagrid to be aligned to left and the header of that column to be aligned to center.

I have tried the following code but the problem is that this code just aligns the whole column (along with header and text) to left.

So, friends, if you know, please tell me how can I align the text and the header differently.

Using System.Data;

Datagrid dgrd=new System.Windows.Form.DataGrid();
....
....
....
DataGridColumnStyle myStyle=new DataGridTextBoxColumn();
myStyle.Alignment=HorizontalAlignment.Left;


Cheers!!
Pushkar





Similar Threads
Thread Thread Starter Forum Replies Last Post
system.stackoverflowexception in system.windows.fo scheidel21 Pro VB.NET 2002/2003 2 May 18th, 2007 12:40 AM
Datagrid column alignment Ric_H ASP.NET 2.0 Basics 0 October 13th, 2006 02:16 PM
datagrid header frezing Rama C# 1 March 2nd, 2006 05:15 PM
Text alignment in datagrid pdsluk ASP.NET 1.0 and 1.1 Basics 0 October 21st, 2003 05:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.