コード例 #1
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     foreach (WorkspaceBranchMapping mapping in originalMappings)
     {
         string[] row = new string[] { mapping.SourceServerPath, mapping.TargetServerPath };
         dataGridViewWorkSpace.Rows.Add(row);
         DataGridViewInvisibleButtonCell cell = dataGridViewWorkSpace[2, dataGridViewWorkSpace.Rows.Count - 1] as DataGridViewInvisibleButtonCell;
         //cell.IsVisible = false;
     }
 }
コード例 #2
0
        private void dataGridViewWorkSpcae_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            // Ignore clicks that are not on button cells.
            if (e.RowIndex < 0 || e.ColumnIndex != 2 || methodShowServerFolderBrowser == null)
            {
                return;
            }

            DataGridViewInvisibleButtonCell cell = dataGridViewWorkSpace[2, e.RowIndex] as DataGridViewInvisibleButtonCell;

            if (cell.IsVisible)
            {
                string currentPath = dataGridViewWorkSpace[0, e.RowIndex].Value.ToString();
                string newPath     = SelectServerFolder(currentPath);
                if (!string.IsNullOrWhiteSpace(newPath))
                {
                    dataGridViewWorkSpace[1, e.RowIndex].Value = newPath;
                }
            }
        }