Hi
I am using the version 12.1. I have this kind of construction. Seems that the value list
does not have any affect.
When I try to change/add values for the column just what ever values are allowed.
regards
Jukka Aakula
const string sDilutionValueList = @"DilutionValueList";
if (!e.Layout.ValueLists.Exists(sDilutionValueList)) { ValueList svl = e.Layout.ValueLists.Add(sDilutionValueList); svl.ValueListItems.Add(1, "1"); svl.ValueListItems.Add(2, "2"); svl.ValueListItems.Add(3, "3"); } grdStandards.DisplayLayout.Bands[0].Columns[4].ValueList = e.Layout.ValueLists[sDilutionValueList];
Hi,
I'm afraid I do not understand what you are asking. Are you saying that the ValueList is not showing up in the grid at all? Do you see a DropDown button in the cell? Can you drop it down? Is the cell editable via the keyboard?
Hi Mike,
> Are you saying that the ValueList is not showing up in the grid at all?
Yes
> Do you see a DropDown button in the cell?
No
> Can you drop it down?
> Is the cell editable via the keyboard?
regards, Jukka Aakula
Hello Jukka,
I tried this and it always works fine for me so I attached my sample to this post for you. Please review it and feel free to let me know if I misunderstood you or if you have any other questions.
Thank you Boris!
That solution worked for me. I will try now to apply that for my solution.
Jukka
Did you have the time to look at this? Please let me know if you face any issues, I will be happy to assist you further on the matter!
Thank you for checking,
We decided to do the list based on an editor control / combo box instead.
Thank you very much, Boris, for your help !!
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
Earlier, you responded to Mike that the cell is editable, but it seems that right before assigning the 'ValueList' to the column, you are setting its cells' activation to 'NoEdit'. This makes it impossible to drop down the 'ValueList', since you are not able to enter into edit mode, i.e. you have a 'ValueList' assigned, but you are not able to "access" it.
Hi Boris,
I tried to add it in the code I am maintaining what you proposed like below. (The data set is chosen in a later phase of the code.)
But there is probably something missing because this has no affect.
private void grdStandards_InitializeLayout(object sender, InitializeLayoutEventArgs e) { grdStandards.DisplayLayout.Bands[0].Columns[0].Header.Caption = Texts.resCalibratorCol1; grdStandards.DisplayLayout.Bands[0].Columns[1].Header.Caption = Texts.resCalibCalibrator; grdStandards.DisplayLayout.Bands[0].Columns[2].Header.Caption = Texts.resCalibCurrentLot; grdStandards.DisplayLayout.Bands[0].Columns[3].Header.Caption = Texts.resCalibConcentration; grdStandards.DisplayLayout.Bands[0].Columns[4].Header.Caption = Texts.resCalibDilution;
grdStandards.DisplayLayout.Bands[0].Columns[0].Width = 45; grdStandards.DisplayLayout.Bands[0].Columns[1].Width = 115; grdStandards.DisplayLayout.Bands[0].Columns[2].Width = 115; grdStandards.DisplayLayout.Bands[0].Columns[3].Width = 120; grdStandards.DisplayLayout.Bands[0].Columns[4].Width = 90;
// Input masks grdStandards.DisplayLayout.Bands[0].Columns[0].CellActivation = Activation.NoEdit; grdStandards.DisplayLayout.Bands[0].Columns[0].TabStop = false; grdStandards.DisplayLayout.Bands[0].Columns[2].CellActivation = Activation.NoEdit; grdStandards.DisplayLayout.Bands[0].Columns[2].TabStop = false; grdStandards.DisplayLayout.Bands[0].Columns[3].CellActivation = Activation.NoEdit; grdStandards.DisplayLayout.Bands[0].Columns[3].TabStop = false; grdStandards.DisplayLayout.Bands[0].Columns[4].CellActivation = Activation.NoEdit; grdStandards.DisplayLayout.Bands[0].Columns[4].TabStop = false;
//set min and max values to Dilution 1+ column. this.grdStandards.DisplayLayout.Bands[0].Columns[4].MinValue = NumberFormat.GetIntegerMinValue(ViewAssayStdData.pxNumberFormats, "sDilRatio"); this.grdStandards.DisplayLayout.Bands[0].Columns[4].MaxValue = NumberFormat.GetIntegerMaxValue(ViewAssayStdData.pxNumberFormats, "sDilRatio");
<-- new code starts here
if (!e.Layout.ValueLists.Exists(sDilutionValueList)) { ValueList svl = e.Layout.ValueLists.Add(sDilutionValueList); svl.ValueListItems.Add(1, "1"); svl.ValueListItems.Add(2, "2"); svl.ValueListItems.Add(3, "3"); } this.grdStandards.DisplayLayout.Bands[0].Columns[4].ValueList = e.Layout.ValueLists[sDilutionValueList];
<-- new code stops here
cmbCalCalibrators.EditModeOverride = false; e.Layout.Bands[0].Columns[1].EditorControl = cmbCalCalibrators;
e.Layout.Bands[0].Columns[0].SortIndicator = SortIndicator.Ascending; }