473,564 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# 2.0 DataGridView Performance

Hi There

In a C# 2.0 application I have a DataGridView that contains thousands
of rows. There is some fairly complex business logic that determines:
- Row forecolor
- Row backcolor
- Cell font

My first approach was to bind the DataGridView and then iterate through
every row in the data grid and set up the row's default style and each
cell's default style, but I think that approach is pretty inefficient

Could you please confirm that I am on the right track with this
approach:
- Set the DefaultCellStyl e at the grid level according to the most
common cell style
- Since alot of the formatting is at the row level, use the RowPrePaint
event as the place to apply changes to the .InhertiedStyle property of
each row and, where necessary, individual cells

What do you think ?

Cheers
Bill

Nov 17 '05 #1
0 2164

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

Similar topics

1
1964
by: FX | last post by:
Hi all, I'm using a CLR 2 component DataGridView and I'm encountered Performance issue. Here is the snippet : string valueStr = value.ToString(); DataGridViewRowCollection rows = dataGridView1.Rows; foreach (DataGridViewRow dataGridViewRow in rows) { dataGridViewRow.Cells.Value = valueStr; }
7
9678
by: steve | last post by:
Hi All I urgently need help on setting datagridview cell borders at runtime I found some code on the web from Programming Smart Client Data Applications with .NET 2.0 by Brian Noyes See below This is what I have been trying to achieve, but when I run it ALL the cell
1
3282
by: =?Utf-8?B?VkJB?= | last post by:
Hi Well what i'm trying to do is search text in a datagridview, i've seen similar code around in other posts or forums, i'm implementing this by using a Textbox, and the code in the TextChanged event, so when the user keeps typing, the datagridview must refresh itself showing only the results that contain the text written so far. I've...
1
7768
by: Karl | last post by:
Hi all... This is a good one. You'll like this... I am working on a course management tool that allows certain Courses to be cross referenced with Job Roles and, when they are, whether the course is a priority course or not. Simple. Because there is alot of data stored for each course, I am using a tab control with several pages. The...
2
2901
by: M R | last post by:
I need to build and display a huge data grid (roughly 5000x5000). (I know it is difficult to view, but i need to do it anyway) the immediate problem i am facing is that it takes a VERY long time to add 5000 columns. i created an array of DataGridViewTextBoxColumn and called DataGridView Columns.AddRange(array). This still takes a VERY long...
3
5808
by: azraiyl | last post by:
Hello, When I create a DataTable and add 10000 rows my computer needs about 20ms. To delete 10000 rows it needs about 15ms. When I connect the DataTable to a DataGridView it needs 3100ms to add 10000 rows and 6300ms to delete 10000 rows. That might be ok because the control needs an update.
8
9026
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
If I populate a DataGridView with a query supplied at runtime, boolean fields render as a CheckBox instead of just a text rendering of '0' or '1'. That is nice sometimes, but I would like the flexibility of showing text sometimes as well. Is there an easy way to get the text '0' or '1' instead of the CheckBox? My DataGridView is filled in with...
3
2154
by: Tony K | last post by:
VB 2005 - Windows Vista I have a form that seems to lock up when the number of rows exceed the height of the datagridview. The following code executes when data is received through the serial port (ie. barcode scanning). It seems that everything works GREAT and processes as it was meant to be until the rows exceed the display area. I...
7
1806
by: Bill Schanks | last post by:
VB.NET 2005 SQL Server 2000 I have a datagridview that users will update. When there are only a few records the update is fine. However when they update 100-200 of the rows the udpate can take 2+ Mins. Is this normal performance, as the datagridview was not meant to update this many records at once?
0
7583
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...
1
7642
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...
0
7950
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...
0
5213
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...
0
3643
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
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...

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.