473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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 4963
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(object sender,
DataGridViewRowPostPaintEventArgs e)
{
// The using statement automatically disposes the brush.
using (SolidBrush b = new
SolidBrush(MyDataGridView.RowHeadersDefaultCellSty le.ForeColor))
{
e.Graphics.DrawString(e.RowIndex.ToString(),
e.InheritedRowStyle.Font, b, e.RowBounds.Location.X + 20,
e.RowBounds.Location.Y + 4);
}
}

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

<sa***************@yahoo.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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
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
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...
10
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 |...
1
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...
4
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...
2
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...
1
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
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.