467,886 Members | 1,776 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,886 developers. It's quick & easy.

combo boxes in datagrids

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

Oct 4 '06 #1
  • viewed: 1363
Share:
2 Replies
What am I missing?
Better controls!

www.infragistics.com
Ausclad wrote:
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
Oct 4 '06 #2


"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??
Oct 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Ausclad | last post: by
4 posts views Thread by Dave | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.