473,406 Members | 2,956 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,406 software developers and data experts.

ComboBox and Datagridview

Hello, i have a datagrid with some columns... the last column is a
ComboBox with 2 items: "yes" and "no"...
i'd like when i select a value "yes" the color's column became
Yello....
someone have an idea....
thanks a lot!
Apr 11 '08 #1
5 5837
On Apr 11, 9:15*am, Christian <christian.per...@gmail.comwrote:
Hello, i have a datagrid with some columns... the last column is a
ComboBox with 2 items: "yes" and "no"...
i'd like when i select a value "yes" the color's column became
Yello....
someone have an idea....
thanks a lot!
Hi,

When the selected value change handle the event and change the color
of the parent control
soething like
void changed_color(object sender, Eventargs e)
{
ComboBox c = sender as Combobox;
c.Parent = c.selectedvalue;

}
Apr 11 '08 #2
Hello Christian. Good Day.

Try this code.

if (grid.CurrentRow.Cells[0].Value == "YES")
{
MessageBox.Show("YES");
}
else
{
MessageBox.Show("NO");
}

Hope can help you

--
To be Happy is To be Yourself
"Christian" wrote:
Hello, i have a datagrid with some columns... the last column is a
ComboBox with 2 items: "yes" and "no"...
i'd like when i select a value "yes" the color's column became
Yello....
someone have an idea....
thanks a lot!
Apr 12 '08 #3
Hello Christian. Good Day.

Try this code.

if (grid.CurrentRow.Cells[0].Value == "YES")
{
MessageBox.Show("YES");
}
else
{
MessageBox.Show("NO");
}

Hope can help you

--
To be Happy is To be Yourself
"Christian" wrote:
Hello, i have a datagrid with some columns... the last column is a
ComboBox with 2 items: "yes" and "no"...
i'd like when i select a value "yes" the color's column became
Yello....
someone have an idea....
thanks a lot!
Jun 27 '08 #4
On 11 Apr, 17:44, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac...@gmail.comwrote:
On Apr 11, 9:15 am, Christian <christian.per...@gmail.comwrote:
Hello, i have a datagrid with some columns... the last column is a
ComboBox with 2 items: "yes" and "no"...
i'd like when i select a value "yes" the color's column became
Yello....
someone have an idea....
thanks a lot!

Hi,

When the selected value change handle the event and change the color
of the parent control
soething like
void changed_color(object sender, Eventargs e)
{
ComboBox c = sender as Combobox;
c.Parent = c.selectedvalue;

}
Hi Ignacio,
when i debug your code i have the same error:"Cannot implicitly
convert type 'object' to 'System.Windows.Forms.Control'. An explicit
conversion exists".
i don't understand where i put the cast and the type of cast that i
must use...

thaks
Christian
Jun 27 '08 #5
On 12 Apr, 03:35, Saimvp <Sai...@discussions.microsoft.comwrote:
Hello Christian. Good Day.

Try this code.

if (grid.CurrentRow.Cells[0].Value == "YES")
{
MessageBox.Show("YES");
}
else
{
MessageBox.Show("NO");
}

Hope can help you

--
To be Happy is To be Yourself

"Christian" wrote:
Hello, i have a datagrid with some columns... the last column is a
ComboBox with 2 items: "yes" and "no"...
i'd like when i select a value "yes" the color's column became
Yello....
someone have an idea....
thanks a lot!
Hi Saimvp,
i try your code but seem doesn't work.....
Jun 27 '08 #6

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

Similar topics

2
by: Nathan | last post by:
Hi, I have a datagridview bound to a List of objects (ObjectA). Each ObjectA contains an ObjectB property. Class ObjectA { public ObjectB objB {} }
4
by: Matt | last post by:
I have been searching all over the web for a way to sort a DataGridView based on the actual text being shown in a ComboBox column as opposed to the underlying value (an ID in this case). Can anyone...
8
by: | last post by:
I am sure this has been asked and answered, but here goes anyway... VS.Net 2005, VB.Net How can you display more than one field in the displaymember property of a combobox inside the...
0
by: c_shah | last post by:
I have the controls on my form display the values of the currently selected row of the DataGridView. I am binding my DataGridView to a collection (Collection - which implements IBindingList...
3
by: sklett | last post by:
I'm changing from a DataGrid to a DataGridView and have run across a problem. The items that are bound to the DataGrid have an int Property that represents a primary key of a lookup table in my...
3
by: Przemek M. Zawada | last post by:
Dear Group, I'm developing sample window form, using DataGridView control, which is filled with data through BindingSource, which is based on type of object, as follow: public sampleClass {...
2
by: David Jackson | last post by:
Hello, I have an unbound DataGridView of which one of the columns is a ComboBox colum containing category data, plus an additional option called <newSo when the ComboBox is dropped down it looks...
0
by: Dom | last post by:
I have a datagridview control, and one column is a ComboboxColumn. I simply create a ComboboxColumn, add items to it, then add the column to the Datagridview control. If I were working with a...
3
by: DEC | last post by:
I have a VB application that's about 95% done. As usual, it's that last 5% that's got me stymied. The program is a Bill-of-material update program that interfaces with an SAP database. The BOM's...
0
by: HDI | last post by:
Hi, I'm using vb.net express 2005 and I've got a project where I use a datagridview with a combobox in the first column. Depending on the value the user selects I have to set values of other...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...
0
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...
0
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...
0
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,...

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.