示例#1
0
        protected virtual void DisplayModels(IList <TSGridRowModel> models)
        {
            var maxRows = !MaxRows.HasValue ? models.Count :
                          MaxRows.HasValue && models.Count > MaxRows.Value ?
                          MaxRows.Value :
                          models.Count;

            for (int i = 0; i < maxRows; i++)
            {
                if (!_rows.ContainsKey(i))
                {
                    var newRow = new TSGridRow()
                    {
                        Model = new TSGridRowModel()
                        {
                            Index = i
                        },
                        Dock             = DockStyle.Top,
                        ValueColumnWidth = ValueColumnWidth
                    };
                    _rows.Add(i, newRow);
                    pnlGridRows.Controls.Add(newRow);
                    newRow.BringToFront();
                }

                var row = _rows[i];

                row.Model = models[i];
            }
        }
示例#2
0
        private void addItem(int index)
        {
            //ListViewItem item = getListViewItem(index);
            //this.Items.Insert(index, item);
            TSGridRow item = getTSGridRow(index);

            pnlGrid.Controls.Add(item);
        }
示例#3
0
 private void updateItem(int index)
 {
     if (index >= 0 &&
         index < this.Items.Count)
     {
         //ListViewItem item = getListViewItem(index);
         //this.Items[index] = item;
         TSGridRow item = getTSGridRow(index);
         this.Items[index] = item;
         //pnlGrid.Controls[index] = item;
     }
 }