473,773 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 DataGridTableSt yle called AutoResizeDataG ridTableStyle
- Hook up the OnResize and OnDataSourceCha nged from the
AutoResizeDataG ridTableStyle to their respected events
of the DataGrid it's meant for.
- When the datasource changes in the DataGrid(OnData SourceChanged)
- Rebuild DataGridColumnS tyle'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 1733

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

Similar topics

5
2273
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 DataGrid? I've found a number of postings and help topics but would like to find something that treats the DataGrid as a topic, not just a loose collection of hundreds of articles. TIA,
3
5307
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 grid-- all I want to do is write to the grid, read from it, and allow the user to enter text in particular cells. Is the WinForms datagrid a viable candidate for this sort of work? If it is, can you recommend a resource to help me get up to...
5
9178
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 a datagrid do >> not << constitute a set of 'selected' records. Apparently one and only one row may be 'selected' in a datagrid. By selected row I mean the row
4
1917
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, but the problem is that people see the question and just write about overriding OnPaint or pointing to the syncfusion site without reading the question.. it's coloring the entire row, not just one cell.. I can't believe it, but there is so many...
1
1412
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 namespace CustomGrid
3
2465
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. How can I do that ? Thank you
3
1819
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 class that is a collection of multiple instances of the control. In ASP.NET, if I wanted to bind the data of the collection ( each control having it's own row in the grid ) it was not a problem. I was also able
0
2779
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 class described at: http://dotnetjunkies.com/WebLog/bsblog/archive/2004/09/02/24116.aspx This can help with sorting and filtering of collections, when displayed in a DataGrid. A DataGrid is a powerful data display widget. One of the interesting...
1
1179
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 bid the same dataset to the datagrid. kindly tell me how to do this in winforms.....
1
1476
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 open datagrid that has no connection to the databse as the bound datagrid have. We have began to use a third party datagrid that is called flygrid but I
0
9621
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
9454
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
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8937
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...
1
7463
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
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
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
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
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.