Ist it possible to use UltraDropDown in wingrid with 2 related columns in the grid?
I have a grid table with several columns, but for the sample lets say I have
ID, TEXT, IDHERKUNFT and IDEinheit.
I would like to have in IDEinheit a drop-DownList which shows as display-Member EinheitBez from table:
Einheit which have the columns:
IDHEKRUNFT , IDEinheit as Primary key and the column EinheitBez for the data
normally I wouldhandle this like this:
strsql = "SELECT IDHEKRUNFT, IDEinheit, EinheitBez FROM Einheit"daEinheit = New OleDb.OleDbDataAdapter(strsql, DBConnection1)daEinheit.Fill(dsStamm, "Einheit")uddEinheit.DataSource = dsStamm.Tables("Einheit")uddEinheit.DisplayMember = "EinheitBez"uddEinheit.ValueMember = "IDEinheit"
But how is it to handle with a double key column??
Thanks for help
Carla
Hi Carla,
I'm not sure I understand your question, but it sounds like you want the dropdown to change both cells in the grid when the user makes a selection. There's no built-in way to do this, but you could trap the CellChange event and update the other cell when the first one changes.
Hi Mike,
may be I do not explain my problem in a good way.
First case is to handle a ultracombo-Box or/and a ultra drop down box with 2 key-Values.
Example: Table Work with primary key IDHEKRUNFT and IDTA
and column discription.
I would like show discription as display member and what is the syntax in visual basic to define the value Member with this 2 keys?
ultracombobox.valuemember = "IDHEKRUNFT", "IDTA"
or something like that?
And after we have solved this case, which is the single sentence way to fill in data in the table, I wolud show them in a grid. So I have allthough the problem to show "Discription" in the column for IDTA with a ultradropdown. But how is it to handle for the seccond column "IDHerkunft". It will be hidden in the grid, but I need this additional key to get the correct discription shown in the IDTA-Column.
Is it possible or is it not the way to work with ultradropdowns for this case. May be I should change the select statement for showing the data - this would be the better way.
But for the combobox I need this two key-Values for showing the correct discription.
thanks for answer; I allthough asked by Infragistics direct by my support contract, but they didn't answer within 2 days.
I'm getting a bit confused here. You seem to be using the term dropdown and combox interchangeably, but they are not the same thing.
Is this an UltraDropDown or UltraCombo being used in a grid cell?
Or is this a standalone UltraCombo control on a form?
Either way, the ValueMember cannot specify multiple fields. That would not make sense, since the Value property of the Combo or the grid cell can only contain a single value, not multiple values.
It sounds to me like you need to have a field that combines the two fields into one. You could add an Unbound column to the Combo/Dropdown and use the InitializeRow event to populate this field with both key values as a single string, separated by a delimeter, like a comma. Then you could use an unbound column in the grid to store that string, parse it into two values and update the two key fields.