Solved

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

Posted on 2011-03-03
7
917 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
Comment Utility
for that you have to customize each column and select width of that column in data grid.
0
 
LVL 13

Expert Comment

by:agarwalrahul
Comment Utility
0
 
LVL 14

Expert Comment

by:Dhanasekaran Sengodan
Comment Utility
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Parth48
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
following link is giving complete walk through

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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

15 Experts available now in Live!

Get 1:1 Help Now