Datagrid headaches

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Al

I have two questions about a datagrid, I need to decide which way to go....

I have a datagrid that will show me all the entries in a table. When I click on any cell(actually I would prefer if It could rather select the whole row, where ever I click), I want the data in that datagrid to populate the corresponding textbaoxes on my form, so that the user can edit the values and save them back to the database, and the update the datagrid. How do I do this

Otherwise, what I would like to do is to cut out the populating of the corresponding textboxes and just have the datagrid here I could edit and add new rows, but there are some columns that are lookup columns eg, I have a Manufaturers table, that holds all the possible manufacturers, and a ManufacturersDetail table that holds all the possible contacts for that Manufacturer, So I want to be able to select the manufacturer, then it must filter the possible contacts, but I don't know first of all how to implement the lookup functionality in the datagrid, or the filtering of one field based on the selection of
another field within a datagrid! I have no idea about how to do this. This would definitly be 1st prize, Please can somebody help me, I'm really stuck on this one.And obviously the data stored for the manufacturer/manufacturerDetails are numbers not the actaul description, so I need to store the number but display the description for the manufacturers and manufaturersdetail

Please I need help on this problem desparatly

Thanks soooo much in advanc

Kevin
 
Hi Kevin,

The datagrid itselfs holds no data, so you have to look to the underlaying
datasource.

That is mostly a datatable as part of a dataset.

When you use a currencymanager to keep track of the current active row in
the datagrid, and also look at datbinding from the textboxes and to the
dataview and its rowfilter, I think you are halfway to your solution,

I hope this helps?

Cor
I have two questions about a datagrid, I need to decide which way to go.....

I have a datagrid that will show me all the entries in a table. When I
click on any cell(actually I would prefer if It could rather select the
whole row, where ever I click), I want the data in that datagrid to populate
the corresponding textbaoxes on my form, so that the user can edit the
values and save them back to the database, and the update the datagrid. How
do I do this?
Otherwise, what I would like to do is to cut out the populating of the
corresponding textboxes and just have the datagrid here I could edit and add
new rows, but there are some columns that are lookup columns eg, I have a
Manufaturers table, that holds all the possible manufacturers, and a
ManufacturersDetail table that holds all the possible contacts for that
Manufacturer, So I want to be able to select the manufacturer, then it must
filter the possible contacts, but I don't know first of all how to implement
the lookup functionality in the datagrid, or the filtering of one field
based on the selection of
another field within a datagrid! I have no idea about how to do this. This
would definitly be 1st prize, Please can somebody help me, I'm really stuck
on this one.And obviously the data stored for the
manufacturer/manufacturerDetails are numbers not the actaul description, so
I need to store the number but display the description for the manufacturers
and manufaturersdetail.
 
But is there no way I can do all this in the datagrid itself? I would really like to stp away from the textboxes and try to doo all the stuff in the datagris, like adding, updating and deleting records. But my biggest problem is creating a combobox field and filtering one combobox filed based on another combobox's selection. I need to know how to do this, if there is now way I suppose I'll have to settle for the textboxe idea... :(

Kevin
 
Hi Kevin,

A lot of approaches, one approach is to make a simple select of manufacurers
and let that dataset be the source for the datasource from a combobox.

With that datasource you choose the manufacturer and do a new select from
the contacts that builds a new dataset of the contacts that is the
datasource of your grid.

Than one button to save the dataset, one button to delete a row from the
dataset, and one button to reset the dataset from it status at the select.

Try to make a simple solution as this first, it is that difficult and you
have your sample.

Cor
But is there no way I can do all this in the datagrid itself? I would
really like to stp away from the textboxes and try to doo all the stuff in
the datagris, like adding, updating and deleting records. But my biggest
problem is creating a combobox field and filtering one combobox filed based
on another combobox's selection. I need to know how to do this, if there is
now way I suppose I'll have to settle for the textboxe idea... :((
 
Hi Co

Sorry for the late repl

When I was talking about the combobox, i meant a combobox inside a datagrid, not the native combobox that you put onto a form. I want to know how to make a cell in my datagrid a combobox,and upon the selection of that combo box filter the possible values of another combobox in another datagrid cell- is this even possible

Thanks for your help so far

Kevin
 
Hi Kevin,

Have a look at this one.

<http://dotnet.leadit.be/extendeddatagrid>

Cor
Sorry for the late reply

When I was talking about the combobox, i meant a combobox inside a
datagrid, not the native combobox that you put onto a form. I want to know
how to make a cell in my datagrid a combobox,and upon the selection of that
combo box filter the possible values of another combobox in another datagrid
cell- is this even possible?
 
Back
Top