473,385 Members | 2,069 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,385 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
flexible.

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
myDataGridView.Columns.Add(colA);
myDataGridView.Columns.Add(colB);
myDataGridView.Columns.Add(colC);

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
happening?

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,
Mike

Dec 15 '06 #1
0 2343

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

Similar topics

2
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...
3
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...
1
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...
0
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...
1
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?...
3
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...
3
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...
0
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...
3
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
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,...
0
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,...

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.