Imad, what you need to do is use databinding in the form, and let the
data binding automatically show each product's data from the combo.
This is what's called a "Master-detail" view, in which the "master" is
a product in the combo, and a "detail" for each product is displayed
in the datagrid.
THere are a lot of ways to do this, but here's an article that will
get you started:
http://weblogs.asp.net/rosherove/story/9088.aspx
(Lesson 4 explains how to make a combo box act as a "master")
good luck.
--Roy Osherove
www.iserializable.com
On Tue, 4 Nov 2003 16:16:21 -0500, "Imad Belabbes"
<ib*******@hotmail.com> wrote:
I just started working with C#.
I have a combobox where upon selecting a product a grid is displayed in the
form with a bunch of data. When selecting another product, I get an
exception because the datagrid is not empty.
How do I empty a Datagrid.
Thanks, Imad.