Home All Groups Group Topic Archive Search About

combo boxes in datagrids

Author
4 Oct 2006 2:54 AM
Ausclad
How Would you implement this?

I have an existing Access application that needs to be converted to .net

I am restricted to use the existing database design.

One of the areas is a timesheet data entry screen.

The existing Access app writes to a table (tblTimesheetHours).  In the data
entry screen, the fields, like employee name, job, etc are bound to combo
boxes that lookup values in other tables.

So far I can replicate most of this in .nets datagrid.

The problem I have is that the existing app lets them select the employees
by either name, or by payroll id.  Selecting one combo box, automatically
updates the other combo box.

In my datagrid I have a combobox for employee payroll, which is bound to the
value from tblTimesheetHours…and with a datasource from a lookup dataset I
have populated…..eg

        With Me.DataGridViewcboEmpCode
            .DisplayMember = "EmpCode"
            .ValueMember = "EmpCode"
            .DataSource = dsLookups.Tables("EmplsCodeLookup")
        End With

I also have the name field bound like so

        With Me.DataGridViewcboName
            .DisplayMember = "Name"
            .ValueMember = "Name"
            .DataSource = dsLookups.Tables("EmplsCodeLookup")
        End With

Basically, if the user updates either the name or the payroll code, I need
the value in the other combo box to move to the same record.

There doesnt seem to be anyway to update the selected item in a combo box
within a datagrid.  That is, on a cell change event, if I want to update the
payroll combo box to be the same as the employee name combo box, there is no
selectedindex property I can update....

What am I missing?

thanks

Author
4 Oct 2006 2:02 PM
Izzy
> What am I missing?

Better controls!

www.infragistics.com


Ausclad wrote:
Show quoteHide quote
> How Would you implement this?
>
> I have an existing Access application that needs to be converted to .net
>
> I am restricted to use the existing database design.
>
> One of the areas is a timesheet data entry screen.
>
> The existing Access app writes to a table (tblTimesheetHours).  In the data
> entry screen, the fields, like employee name, job, etc are bound to combo
> boxes that lookup values in other tables.
>
> So far I can replicate most of this in .nets datagrid.
>
> The problem I have is that the existing app lets them select the employees
> by either name, or by payroll id.  Selecting one combo box, automatically
> updates the other combo box.
>
> In my datagrid I have a combobox for employee payroll, which is bound to the
> value from tblTimesheetHours...and with a datasource from a lookup dataset I
> have populated.....eg
>
>         With Me.DataGridViewcboEmpCode
>             .DisplayMember = "EmpCode"
>             .ValueMember = "EmpCode"
>             .DataSource = dsLookups.Tables("EmplsCodeLookup")
>         End With
>
> I also have the name field bound like so
>
>         With Me.DataGridViewcboName
>             .DisplayMember = "Name"
>             .ValueMember = "Name"
>             .DataSource = dsLookups.Tables("EmplsCodeLookup")
>         End With
>
> Basically, if the user updates either the name or the payroll code, I need
> the value in the other combo box to move to the same record.
>
> There doesnt seem to be anyway to update the selected item in a combo box
> within a datagrid.  That is, on a cell change event, if I want to update the
> payroll combo box to be the same as the employee name combo box, there is no
> selectedindex property I can update....
>
> What am I missing?
>
> thanks
Author
6 Oct 2006 1:01 AM
Ausclad
"Izzy" wrote:

>
> > What am I missing?
>
> Better controls!
>
> www.infragistics.com
>
>

Is this forum here to help people or just for Vendors to spam there goods?????

Has anyone got a solution that doesnt involve buying expensive add ons??