Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2114
Manual link the controls to grid cells of the ActiveRow
posted

Hello

I try to link some controls to the grid cells, but this does not work pretty good.

My task is to have a readonly Grid, with the only one Active/Selected Row that will be represented in the editing controls.

Once user changes the active Row, the values are reflected in the controls. Once the controls are modified, the modifications are reflected in the grid.

Each control (usually UltraWInCombo) should have a visible Text, and invisible Value members.

Similar, each grid cell should have a Value, and Text members. When user changes the text from combo, the respective combo Value is set into the grid Cell Value, and that cell Text is updated accordingly.

I attached a sample project that I try to simulate.

Actually, my sample seems to work, but the problem is when the user selects a already filled row, the values are not displayed correctly in the controls.

Here is the code

        private void ActiveRowToControls()
        {
            var r = myGrid.ActiveRow;
            if (r == null) return;

            txtNick.Text = r.Cells[Cols.Nick].OriginalValue.ToString();
            cmbCountry.Value = r.Cells[Cols.Country].OriginalValue;
            cmbCity.Value = r.Cells[Cols.City].OriginalValue;
            txtBirthDate.Text = r.Cells[Cols.BirthDate].OriginalValue.ToString();
        }

 

I tried with Value, but this is worse - controls texts dissapears.

PS.

! As I use v6.3 of the library, I have no RowEditTemplate and the ControlContainerEditor.

ResizeBindInfragisticsGrid.zip
Parents
  • 469350
    Offline posted

    Hi,

    I tried running your sample, but there does not appear to be any data in the grid, so I'm not sure what to do with it.

    If you want the grid cell value to match up to the UltraCombo value, then the grid column and the UltraCombo would need to be populated with the same list. Otherwise, the Value in the grid cell which is translated into the DisplayText will not be valid for the UltraCombo.

Reply Children
No Data