Exemple #1
0
            private void AssignNewGrid(int nRowIndex, SHItemAddRemoveBase item)
            {
                m_Grid.Rows[nRowIndex].Tag = item;

                m_Grid[nRowIndex, 0] = new SourceGrid.Cells.Cell(item.GetItemType(), typeof(SHItemAddRemoveType));
                m_Grid[nRowIndex, 1] = new SourceGrid.Cells.Cell(item.id, typeof(int));
                m_Grid[nRowIndex, 2] = new SourceGrid.Cells.Cell(item.amount, typeof(int));

                //m_Grid[r + 1, 0].Editor.EnableEdit = false;
                m_Grid[nRowIndex, 0].AddController(new ItemValueChangedEvent(this));
                m_Grid[nRowIndex, 1].AddController(new ItemValueChangedEvent(this));
                m_Grid[nRowIndex, 2].AddController(new ItemValueChangedEvent(this));
            }
Exemple #2
0
            public void AssignGridRow(SourceGrid.GridRow gridRow, SHItemAddRemoveBase item)
            {
                if (gridRow == null || item == null)
                {
                    return;
                }

                (gridRow.Grid.GetCell(gridRow.Index, 0) as SourceGrid.Cells.Cell).Value = item.GetItemType();
                (gridRow.Grid.GetCell(gridRow.Index, 1) as SourceGrid.Cells.Cell).Value = item.id;
                (gridRow.Grid.GetCell(gridRow.Index, 2) as SourceGrid.Cells.Cell).Value = item.amount;
            }