473,830 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Override Grid Lines on DataGrid

What object would I override in order to control painting
of Grid Lines in a DataGrid?
Nov 15 '05 #1
3 2246
Mark,

You can override the grid's OnPaint method, but then your only choice is to
paint all the grid outline yourself, including row headers and column
headers. To the best of my knowledge, there is no other way with the
standard DataGrid.

Consider 3rd party commercial grids as an alternative. These, I believe,
should be much more customizable.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ma*********@hi ll.af.mil" <an*******@disc ussions.microso ft.com> wrote in
message news:06******** *************** *****@phx.gbl.. .
What object would I override in order to control painting
of Grid Lines in a DataGrid?


Nov 15 '05 #2
I went through the pain of doing my own painting in the
DataGrid OnPaint method which allows me to customize as
needed.
-----Original Message-----
Mark,

You can override the grid's OnPaint method, but then your only choice is topaint all the grid outline yourself, including row headers and columnheaders. To the best of my knowledge, there is no other way with thestandard DataGrid.

Consider 3rd party commercial grids as an alternative. These, I believe,should be much more customizable.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ma*********@h ill.af.mil" <an*******@disc ussions.microso ft.com> wrote inmessage news:06******** *************** *****@phx.gbl.. .
What object would I override in order to control painting of Grid Lines in a DataGrid?


.

Nov 15 '05 #3
Mark,

I take my hat off, really! How did you manage to handle scrolling?

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ma*********@hi ll.af.mil" <an*******@disc ussions.microso ft.com> wrote in
message news:03******** *************** *****@phx.gbl.. .
I went through the pain of doing my own painting in the
DataGrid OnPaint method which allows me to customize as
needed.
-----Original Message-----
Mark,

You can override the grid's OnPaint method, but then

your only choice is to
paint all the grid outline yourself, including row

headers and column
headers. To the best of my knowledge, there is no other

way with the
standard DataGrid.

Consider 3rd party commercial grids as an alternative.

These, I believe,
should be much more customizable.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ma*********@h ill.af.mil"

<an*******@disc ussions.microso ft.com> wrote in
message news:06******** *************** *****@phx.gbl.. .
What object would I override in order to control painting of Grid Lines in a DataGrid?


.


Nov 15 '05 #4

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

Similar topics

1
2581
by: xp | last post by:
I have a datagrid on my VB.Net form. I am trying to use the DblClick event of the grid, but when I run the program and double click on the grid, the event was not evoked. Why? Thanks xp
0
1677
by: Frnak McKenney | last post by:
I have a (small) multi-table database application which allows edits, print reports, and has two scrolling screen displays which show information merged from multiple tables. I'm having trouble with one of the scrolling displays which is implemented as a DataGrid with several custom DataGridColumnStyles. When the Form containing the DataGrid is made visible the initial rows of the DataGrid's DataView source display as one might expect....
0
1172
by: James lennon | last post by:
I am attempting to format a Window.Forms.DataGrid. How do I set the color for the grid lines in the data grid header. The GridLineColor attribute in the table style does not set the color of the grid lines in the header, it only sets color for the grid lines in the data portion. This grid lines in the header are transparent. Thanks, James ..
3
2924
by: Mark.Larsen | last post by:
I made a class that extends DataGridColumnStyle. In the Paint override I draw a border around each cell in the column. All cells look fine except for the last one (final row). The lines I draw in the far right and bottom of the cell don't show. I can draw 1 pixel up from the bottom and 1 pixel left of the right border. What is preventing me from painting the border around this last cell?
0
1063
by: Mark.Larsen | last post by:
What object draws the grid lines in a DataGrid? I need to override its paint method in order to change the border of cells in a column.
4
3010
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be added to the data grid. My current code is coming up with errors, dt and drv are unknown in the else part of the if statement. if (this.dgPrivileges.DataSource == null) {
3
3380
by: SStory | last post by:
I have a style sheet for my site. It has various classes in it. It has <A: styles defined for all anchor tags. I have a datagrid in ASP.NET with a stylesheet linked to the page. It defines links a yellow which is what I normally won't but in this case I want to override the link color and can't seem to do it. I set the forecolor in itemstyle prop. But it doesn't work.
4
2306
by: Woody Splawn | last post by:
I have a grid with, lets say, 3 fields in it, Debit, Credit and Comments, in that order. When the user moves to the debit field, if he enters data in it, I would like for the cursor to skip past the Credit field to the comments field. I have a ColumnChanging event where I trap to see what field the user is on. I trap for the user being on the Debit field. I have code that , in my mind should cause the cursor to move to the Comments...
4
1339
by: Ralf Rennartz | last post by:
Hello NG, i have the following function which works fine: Public Shared Function getFullDatagrid() As System.Web.UI.WebControls.DataGrid Dim myGrid As New System.Web.UI.WebControls.DataGrid() Dim bcn1 As New BoundColumn()
0
9793
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10777
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
10526
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
10206
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
9315
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6951
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
5617
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...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4416
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

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.