By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,326 Members | 2,726 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,326 IT Pros & Developers. It's quick & easy.

datagrid combobox question

P: n/a
Hi
I have a datagrid with a combo box,
I need to populate the combo with data dependant on the record value.
eg for record 1, field Warehouse = 2R so combo would allow selection of
locations valid for 2R
record 2 has Warehouse = 2M so combo on that row has a selection of
locations valid for 2M

I can set the combo datasource but can't see how to set it on a row by row
basis.

Can someone help.

Thanks

Doug
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi,

There is only one combobox for the column that is shown on the row
that is being edited. You should add each item to the combobox manually.
If you bind the data you will wind up changing the values in multiple rows.

Ken
-----------------------
"Doug Bell" <dug@bigpond> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi
I have a datagrid with a combo box,
I need to populate the combo with data dependant on the record value.
eg for record 1, field Warehouse = 2R so combo would allow selection of
locations valid for 2R
record 2 has Warehouse = 2M so combo on that row has a selection of
locations valid for 2M

I can set the combo datasource but can't see how to set it on a row by row
basis.

Can someone help.

Thanks

Doug

Nov 21 '05 #2

P: n/a
Hi Ken,
I am not following.

The Data Grid is bound to a Data View, "OrderDetails" filtered for a
particular OrderNo

The combo box is bounnd to a Data View, "Locations" filtered currently to
Locations for a selected Facility.

The Combo Box is to assign a Location to an Order Detail Line.

The Order Detail Line has a field, Warehouse already assigned to it.

What I want to do is to filter the list of Locations in the combo box to
Locations within the particular Warehouse (on the OrderDetail line) as
opposed to the current filter that is for the whole Facility.

I can not work out how to do that as currently I am binding the Locations
data to the combo box as part of a custom GridTextBoxStyle set up.

Thanks Doug

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ep*************@TK2MSFTNGP10.phx.gbl...
Hi,

There is only one combobox for the column that is shown on the row
that is being edited. You should add each item to the combobox manually.
If you bind the data you will wind up changing the values in multiple rows.
Ken
-----------------------
"Doug Bell" <dug@bigpond> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi
I have a datagrid with a combo box,
I need to populate the combo with data dependant on the record value.
eg for record 1, field Warehouse = 2R so combo would allow selection of
locations valid for 2R
record 2 has Warehouse = 2M so combo on that row has a selection of
locations valid for 2M

I can set the combo datasource but can't see how to set it on a row by row
basis.

Can someone help.

Thanks

Doug

Nov 21 '05 #3

P: n/a
Hi,

Say you have 50 rows in that column there is only one combobox that
is displayed when a cell in the column goes into edit mode. If you bind the
combobox you will wind up changing values in rows that arent being edited.
So what you need to do is just before the combobox is displayed you need to
clear the list and add the filtered items.
Ken
----------------
"Doug Bell" <dug@bigpond> wrote in message
news:uO**************@TK2MSFTNGP15.phx.gbl...
Hi Ken,
I am not following.

The Data Grid is bound to a Data View, "OrderDetails" filtered for a
particular OrderNo

The combo box is bounnd to a Data View, "Locations" filtered currently to
Locations for a selected Facility.

The Combo Box is to assign a Location to an Order Detail Line.

The Order Detail Line has a field, Warehouse already assigned to it.

What I want to do is to filter the list of Locations in the combo box to
Locations within the particular Warehouse (on the OrderDetail line) as
opposed to the current filter that is for the whole Facility.

I can not work out how to do that as currently I am binding the Locations
data to the combo box as part of a custom GridTextBoxStyle set up.

Thanks Doug

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ep*************@TK2MSFTNGP10.phx.gbl...
Hi,

There is only one combobox for the column that is shown on the row
that is being edited. You should add each item to the combobox manually.
If you bind the data you will wind up changing the values in multiple rows.
Ken
-----------------------
"Doug Bell" <dug@bigpond> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi
I have a datagrid with a combo box,
I need to populate the combo with data dependant on the record value.
eg for record 1, field Warehouse = 2R so combo would allow selection of
locations valid for 2R
record 2 has Warehouse = 2M so combo on that row has a selection of
locations valid for 2M

I can set the combo datasource but can't see how to set it on a row by row
basis.

Can someone help.

Thanks

Doug


Nov 21 '05 #4

P: n/a
Ken,

I am still not sure what you are saying.

My combo box is bound to data not a string list and it is setting the value
just for the row that it is displayed within

I already have a datagrid with a combo box.
The Data Grid is bound to the "OrderDetails" Table.
The Combo Box is bound to the "Locations" Data Table.

When I set a value (ie a Location) in the DataGrid using the combo box, it
is setting the selected location for that record (Order Details Line ) only.
It is not affecting the other records (Rows) in the data Grid or in the
underlying Data Table ("OrderDetails")!!

I want to know if I can set the bound DataView to filter for the value
within the row rather than setting it as a column style.

Or is there some other way to achieve this result.

Say the datagrid is displaying records filtered for Order No 12345678 and it
has 10 lines.

Some of Line 3 might have arrived so the User has to accept say 20 boxes and
allocates them to location A20.
He selects row with Line: 3, Item: AA12345, Description: Blue Plastic,
Units: Boxes, Expected: 50, Received:
5,................................................ ...........Qty Accepted:
[20], Location: [A20]

He entered the value 20 and selects the location 'A20' using the combo box.

Doug

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
Hi,

Say you have 50 rows in that column there is only one combobox that is displayed when a cell in the column goes into edit mode. If you bind the combobox you will wind up changing values in rows that arent being edited.
So what you need to do is just before the combobox is displayed you need to clear the list and add the filtered items.
Ken
----------------
"Doug Bell" <dug@bigpond> wrote in message
news:uO**************@TK2MSFTNGP15.phx.gbl...
Hi Ken,
I am not following.

The Data Grid is bound to a Data View, "OrderDetails" filtered for a
particular OrderNo

The combo box is bounnd to a Data View, "Locations" filtered currently to
Locations for a selected Facility.

The Combo Box is to assign a Location to an Order Detail Line.

The Order Detail Line has a field, Warehouse already assigned to it.

What I want to do is to filter the list of Locations in the combo box to
Locations within the particular Warehouse (on the OrderDetail line) as
opposed to the current filter that is for the whole Facility.

I can not work out how to do that as currently I am binding the Locations
data to the combo box as part of a custom GridTextBoxStyle set up.

Thanks Doug

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ep*************@TK2MSFTNGP10.phx.gbl...
Hi,

There is only one combobox for the column that is shown on the row that is being edited. You should add each item to the combobox manually. If you bind the data you will wind up changing the values in multiple

rows.

Ken
-----------------------
"Doug Bell" <dug@bigpond> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi
I have a datagrid with a combo box,
I need to populate the combo with data dependant on the record value.
eg for record 1, field Warehouse = 2R so combo would allow selection of
locations valid for 2R
record 2 has Warehouse = 2M so combo on that row has a selection of
locations valid for 2M

I can set the combo datasource but can't see how to set it on a row by row basis.

Can someone help.

Thanks

Doug


Nov 21 '05 #5

P: n/a
Ken,
Sorry the Combo is not bound to the Locations Table.
The Locations Table is the datasource for the Combo Box.

The combo Box is bound to the Location field in the Order Details Table.

Does this make more sense?

"Doug Bell" <dug@bigpond> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Ken,

I am still not sure what you are saying.

My combo box is bound to data not a string list and it is setting the value just for the row that it is displayed within

I already have a datagrid with a combo box.
The Data Grid is bound to the "OrderDetails" Table.
The Combo Box is bound to the "Locations" Data Table.

When I set a value (ie a Location) in the DataGrid using the combo box, it
is setting the selected location for that record (Order Details Line ) only. It is not affecting the other records (Rows) in the data Grid or in the
underlying Data Table ("OrderDetails")!!

I want to know if I can set the bound DataView to filter for the value
within the row rather than setting it as a column style.

Or is there some other way to achieve this result.

Say the datagrid is displaying records filtered for Order No 12345678 and it has 10 lines.

Some of Line 3 might have arrived so the User has to accept say 20 boxes and allocates them to location A20.
He selects row with Line: 3, Item: AA12345, Description: Blue Plastic,
Units: Boxes, Expected: 50, Received:
5,................................................ ...........Qty Accepted:
[20], Location: [A20]

He entered the value 20 and selects the location 'A20' using the combo box.
Doug

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
Hi,

Say you have 50 rows in that column there is only one combobox

that
is displayed when a cell in the column goes into edit mode. If you bind

the
combobox you will wind up changing values in rows that arent being edited.
So what you need to do is just before the combobox is displayed you need

to
clear the list and add the filtered items.
Ken
----------------
"Doug Bell" <dug@bigpond> wrote in message
news:uO**************@TK2MSFTNGP15.phx.gbl...
Hi Ken,
I am not following.

The Data Grid is bound to a Data View, "OrderDetails" filtered for a
particular OrderNo

The combo box is bounnd to a Data View, "Locations" filtered currently to Locations for a selected Facility.

The Combo Box is to assign a Location to an Order Detail Line.

The Order Detail Line has a field, Warehouse already assigned to it.

What I want to do is to filter the list of Locations in the combo box to
Locations within the particular Warehouse (on the OrderDetail line) as
opposed to the current filter that is for the whole Facility.

I can not work out how to do that as currently I am binding the Locations data to the combo box as part of a custom GridTextBoxStyle set up.

Thanks Doug

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ep*************@TK2MSFTNGP10.phx.gbl...
Hi,

There is only one combobox for the column that is shown on the

row that is being edited. You should add each item to the combobox manually. If you bind the data you will wind up changing the values in multiple

rows.

Ken
-----------------------
"Doug Bell" <dug@bigpond> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi
I have a datagrid with a combo box,
I need to populate the combo with data dependant on the record value.
eg for record 1, field Warehouse = 2R so combo would allow selection of locations valid for 2R
record 2 has Warehouse = 2M so combo on that row has a selection of
locations valid for 2M

I can set the combo datasource but can't see how to set it on a row by row basis.

Can someone help.

Thanks

Doug



Nov 21 '05 #6

P: n/a
Doug,

You have normally to use a datarelation for that, are you able to do that?

Cor
Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.