Solved

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

Posted on 2011-03-03
7
925 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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