Пример #1
0
        private void TableList_List_SelectedIndexChanged(object sender, EventArgs e)
        {         // item selected from list, select corresponding band in grid
            GridBandColumnCollection cols;

            string txt = (string)TableList.List.SelectedItem;

            TableList.Close();

            if (!BandCaptionDict.ContainsKey(txt))
            {
                return;
            }
            int leftCol = BandCaptionDict[txt];

            BandedGridView v = MoleculeGridPanel.BandedViewGrid.V as BandedGridView;

            if (v == null)
            {
                return;
            }

            cols = v.Bands[v.Bands.Count - 1].Columns;             // go to end first
            v.MakeColumnVisible(cols[cols.Count - 1]);
            cols = v.Bands[BandCaptionDict[txt]].Columns;          // then back to beginning
            v.MakeColumnVisible(cols[0]);

            return;
        }