Solved

how can i customizing DataGrid in C#.net window application ??

Posted on 2011-03-03
7
919 Views
Last Modified: 2012-05-11
i want to know that how can i customizing Datagrid in C#.net window application ??

here i attach one snapshot , please refer the attached snapshot ....

give me some suggestions ..
03-03-2011-2-02-16-PM.png
0
Comment
Question by:Parth48
7 Comments
 
LVL 13

Expert Comment

by:Naman Goel
ID: 35025064
for that you have to customize each column and select width of that column in data grid.
0
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 35025384
0
 
LVL 14

Expert Comment

by:Dhanasekaran Sengodan
ID: 35025548
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:Parth48
ID: 35025815
i want to change the column header ,but how can i change it ??

instead of uname it's UserName

but how can i change it ??
0
 
LVL 14

Accepted Solution

by:
Dhanasekaran Sengodan earned 500 total points
ID: 35026024
grid.Columns[0].HeaderText

                    or

grid.Columns["columnname"].HeaderText

                     or

public Form1()
    {
        InitializeComponent();

        grid.Columns[0].HeaderText = "First Column";
        //..............
    }


More details are http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.columns.aspx at MSDN. More details about DataGrid are http://msdn.microsoft.com/en-us/library/e0ywh3cz.aspx
0
 
LVL 13

Expert Comment

by:Naman Goel
ID: 35027447
Hey for that you can use HeaderText property.

just select the column from Properties explorer in visual studio and change the HeaderText property

following are the list of properties with DataGridViewColumn object

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn_properties.aspx
0
 
LVL 13

Expert Comment

by:Naman Goel
ID: 35027494
following link is giving complete walk through

http://www.dotnetperls.com/datagridview-columns
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now