473,607 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I place text in the rowheader column of my DataGridView in C#

Hi Team,

This is saravanan i am new to C#.. I am using VS2005 for my windows
based application.. I am using DataGridView to show the values.. What i
want is i want to display the text in the rowheaders of the
DataGridview and I want to enable the tooltip in the cells.

Thanks in advance

Any help or suggesstion is appreciated

Mar 15 '06 #1
1 4979
Hello,

I dont think your suppose to be able to change the RowHeader text in a
windows form, its quite simple in asp.net but in a windows form it can be a
pain in the behind.

However you could trying the following code.

private void MyDataGridView_ RowPostPaint(ob ject sender,
DataGridViewRow PostPaintEventA rgs e)
{
// The using statement automatically disposes the brush.
using (SolidBrush b = new
SolidBrush(MyDa taGridView.RowH eadersDefaultCe llStyle.ForeCol or))
{
e.Graphics.Draw String(e.RowInd ex.ToString(),
e.InheritedRowS tyle.Font, b, e.RowBounds.Loc ation.X + 20,
e.RowBounds.Loc ation.Y + 4);
}
}

Hope this helps in some way
Regards
Scott Blood
C# Developer

<sa************ ***@yahoo.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
Hi Team,

This is saravanan i am new to C#.. I am using VS2005 for my windows
based application.. I am using DataGridView to show the values.. What i
want is i want to display the text in the rowheaders of the
DataGridview and I want to enable the tooltip in the cells.

Thanks in advance

Any help or suggesstion is appreciated

Mar 15 '06 #2

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

Similar topics

4
3790
by: Griff | last post by:
I want to have a table based on the following html: <table> <colgroup> <col class="tableColumnText"/> <col class="tableColumnText"/> <col class="tableColumnNumeric"/> </colgroup>
1
4616
by: Tim Newton | last post by:
Hi Anyone tell me how to number the rowheaders of a datagrid, e.g. 1,2,3,4,5 etc, just like in excel. I could put the row numbers in a new column but there has to be a simple way of adding it to the rowheader?? Thanks Tim
10
32337
by: MSNews | last post by:
Hi. I need to set texts to the row headers of a Datagridview, like we can do with column headers. For example: ======================================== | COLUMN A | COLUMN B | COLUMN B | ROW 1 | | | | ROW 2 | | | |
1
2304
by: Rich | last post by:
Hello, I am reading data from a sql server table that is under replication. This table has the replicatin GUID column that is generated with replicatin. I am reading the data from a dataAdapter/Dataset using a dataview which is the data source for a datagridview control. When I scroll horizontally in the datagridview control and reach this GUID column (which is not at the end of the table) it raises the datagridview dataError event. ...
4
8626
by: Matt | last post by:
I have been searching all over the web for a way to sort a DataGridView based on the actual text being shown in a ComboBox column as opposed to the underlying value (an ID in this case). Can anyone tell me if this is even possible, and if so, how to do it? If this is completely impossible, how would you suggest going about sorting a ComboBox wherein the text displayed in the column is the client's name, and the underlying value is an ID? ...
2
17191
by: Steve Richter | last post by:
I set the Text of a DataGridView control expecting this text to be displayed at the top of the control, as the grid title. But the text does not display. How do I display title text above the column heading of a DataGridView? thanks, DataGridView mGrid1 ; mGrid1 = new DataGridView();
1
1575
nev
by: nev | last post by:
i have a normal datagridview were i want to display the rowcount in the rowheader. how will i do it?
6
2842
by: Miro | last post by:
Sorry for the cross post. I am stuck. I have a datagridview for poker rounds. Basically there are 3 columns in this datagridview. "Round" "SmallBlind" "BigBlind" I have an issue when I tab through the new row being added. It does not 'Add' that row, nor setup the 'next blank add row' so I can continue to tab
0
5642
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be blank unless they are filled by the user. 2) As soon as the user enters a cell, the dtp control should appear as the editing control of that cell. If there's a value in the cell beforehand, that value is set as the value of the dtp editing control...
0
7987
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8472
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8130
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8324
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3954
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2464
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1318
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.