472,988 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Three problems with custom DataGridView column

Hey everyone...

I've got three problems with a custom DataGridView column I've built
following the "How To: Host Controls in Windows Forms DataGridView
Cells" article. The base editing control is a ComboBox which is
similar to the built-in Combo column but will hopefully be more

First: I am using this control in multiple columns which _should_ hold
unique items. However, the items added to column A are visible in
column B, and so on. I'm initializing a new instance of the control
for each column and adding them manually. Why is this happening when
each column have a "new" instance?

MyComboCol colA = new MyComboCol();
MyComboCol colB = new MyComboCol();
MyComboCol colC = new MyComboCol();
// set column A properties
// set column B properties
// set column C properties

Second: As I type text into the control and leave the cell, the text
is automatically added to the Items collection if it doesn't already
exist. This behavior is occurring internally in the class using an
overriden OnLeave event. The problem is that when I move from column A
to column B or a built-in TextBoxColumn, the items in the column A
collection will disappear. I'm assuming that this is related to my
"First" problem, but I'm not certain. Any ideas why this would be

Third: I'm not able to access the "Items" collection by using
"colA.Items" like you would with DGVComboBoxColumn. I'm calling Base()
and Clone() in my controls class and have set everything to public in
hope that get access to it. How do I expose the EditingControl's
(Inherited ComboBox) Items collection from the Column class?

Thanks for your help,

Dec 15 '06 #1
0 2300

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

Similar topics

by: Pete Davis | last post by:
I have a Windows Forms datagrid with the datasource set to an ArrayList. The ArrayList is initially empty. I have DataGridColumn styles defined for 4 columns with widths, header titles, and...
by: Bob | last post by:
Thinking two things, 1- Creating a userControl -yeah you guessed it, a multi column drop down combobox - I've looked at several articles and did not find what I need, one that's bindable and that...
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...
by: RickH | last post by:
Has anyone wrapped the Windows Media Player ActiveX control as a custom DataGridView column type (prefereably in VB)? That might want to share the source code on the group? So that video/audio...
by: lbelkova | last post by:
Hello, I've created a custom DataGridViewColumn. Everything work well, except for some reason the column doesn't accept some of the chars: "q", "." and "'". Did anybody have a similar problem?...
by: Claes Wedin | last post by:
I'm doing a Component class that inherits from DataGridView. One thing that it does is to add a default column in the grid. I put the code for this in the class and when I drag the control to my...
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...
by: Kevin S Gallagher | last post by:
I am working on a custom column from Code Project were I want to persist a value using the following code in the property HighlightBackgroundColor. Note the default color is "Red" but when changing...
by: VC | last post by:
Hi, could someone points me to a article, whitepaper or other about how to create a simple custimized column for a (2008 .net) DataGridView windows form control? I've saw a lot of sample over...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.