How to drag and drop a file into DataGridView? [modified]
-
I would like to drag and drop a row in DataGridView on .net framework 2.0 the row is a file detail from window explorer.
private void dGV_fileUpload_DragDrop(object sender, DragEventArgs e) { Object fileName = (Object)e.Data.GetData(typeof(????)); FileInfo file = new FileInfo(fileName); DataGridViewRow row = new DataGridViewRow(); row.CreateCells(dGV_fileUpload); row.Cells[0].Value = file.Name; row.Cells[1].Value = GetFileSize(file.Length); row.Cells[2].Value = file.LastAccessTime.ToString(); this.dGV_fileUpload.Rows.Add(row); }
modified on Wednesday, September 24, 2008 5:44 AM
-
I would like to drag and drop a row in DataGridView on .net framework 2.0 the row is a file detail from window explorer.
private void dGV_fileUpload_DragDrop(object sender, DragEventArgs e) { Object fileName = (Object)e.Data.GetData(typeof(????)); FileInfo file = new FileInfo(fileName); DataGridViewRow row = new DataGridViewRow(); row.CreateCells(dGV_fileUpload); row.Cells[0].Value = file.Name; row.Cells[1].Value = GetFileSize(file.Length); row.Cells[2].Value = file.LastAccessTime.ToString(); this.dGV_fileUpload.Rows.Add(row); }
modified on Wednesday, September 24, 2008 5:44 AM
This might help: Drag and Drop[^]
Giorgi Dalakishvili #region signature my articles My blog[^] #endregion