473,378 Members | 1,444 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,378 software developers and data experts.

WinForms DataGrid

Hello,

why is the System.Windows.Forms.DataGrid so un-customizable? I am
trying to build a DataGrid that will resize it's last column when
there is room left over (make it fill the total clientwidth). I am
almost capable of doing so by the following actions:
- Create a custom DataGridTableStyle called AutoResizeDataGridTableStyle
- Hook up the OnResize and OnDataSourceChanged from the
AutoResizeDataGridTableStyle to their respected events
of the DataGrid it's meant for.
- When the datasource changes in the DataGrid(OnDataSourceChanged)
- Rebuild DataGridColumnStyle's for each column in the new
DataSource and set its MappingName
- Call OnResize()
- When the DataGrid changes size (OnResize)
- Calculate total column width !!!!!!!!
- if smaller then clientSize of DataGrid -> resize last column

A pretty neat job, works like a charm. Lot of things I am still not
happy with ofcourse, but hey, the problem is solved.

The problem is the calculation of the total column width, a DataGrid
has a column in front of the first data column which you cannot access.
Ofcourse this thing has width, so I am unable to calculate the total
gridSize correctly. THIS SUCKS, unless I am completely blind to the
solution(I have looked and searched a long time).

Is there anybody that knows how to
- autoresize last column
- calculate the size of the first index-column
- has a totally new implementation of DataGrid, this sucks

Pls let me know,

Wouter van Vugt
Nov 15 '05 #1
0 1693

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

Similar topics

5
by: John Spiegel | last post by:
Hey all, I have contusions and I think a minor concussion after trying to find information on advanced WinForms DataGrid use. Does anyone know of a site / book that gets really in-depth on the...
3
by: Dave Veeneman | last post by:
I am just getting into the WinForms data grid, and just about everything I am seeing on it seems to say that the grid must be bound to an ADO.Net dataset. I want to use the grid as a simple unbound...
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
4
by: David Krmpotic | last post by:
Hello, Can please tell me how to do it ? This should be simple, because I'd think it's used a lot.. but in reality is not that simple and there is at least 50 topics about it in newsgroups,...
1
by: Serdge Kooleman | last post by:
i would like to write my event that will react on specific keys in my custom DataGrid (WinForms)... please help to do this. so far i have this custom grid... and i create it in main object ...
3
by: \(\( Olivier \)\) | last post by:
Hello, I've searching for the old properties MergeCol et MergeRow from MSFlexGrid in the new WinForms DataGrid control. I would like to merge all the cells wich contains the same values. ...
3
by: Tom S. | last post by:
VS.Net 2003 V 7.1.3088 ..Net Framework V 1.1.4322 SP1 WinXP SP2 I have a WinForms project that I'm having trouble with. I have a custom user control ( all code based, no visual ) and another...
0
by: Dino Chiesa [Microsoft] | last post by:
If you develop WinForms or WebForms clients that consume webservices, and display the results in a DataGrid, you may be interested in a helper class I found recently. It is the CollectionView...
1
by: tirumalab | last post by:
Hi i worked on webapplication till now ,new to winforms... kindly tell me the process how to reflect the changes in the data the were made in the datagrid, on to dataset. And again i want to...
1
by: TonyJ | last post by:
Hello! If there is a datagrid in VS2005 for winforms what kind of datagrid is it then. 1.Is it a bound datagrid that has a direct connection to columns for tables in the database. 2. Is it an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.