Bugzilla – Attachment 270532 Details for
Bug 472968
DataGridViewRowCollection.Insert is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
Another example
dgrid1.cs (text/plain), 2.29 KB, created by
Mario Carrion
on 2009-02-05 18:04:17 UTC
(
hide
)
Description:
Another example
Filename:
MIME Type:
Creator:
Mario Carrion
Created:
2009-02-05 18:04:17 UTC
Size:
2.29 KB
patch
obsolete
>using System; >using System.Collections.Generic; >using System.Linq; >using System.Windows.Forms; >using System.Drawing; > >namespace DataGrid >{ > static class Program > { > [STAThread] > static void Main() > { > Application.EnableVisualStyles(); > Application.SetCompatibleTextRenderingDefault(false); > Application.Run(new ExampleForm()); > } > > public class ExampleForm : Form > { > public ExampleForm() > : base() > { > Size = new Size(600, 300); > > DataGridView view = new DataGridView(); > view.Size = new Size(400, 200); > view.AllowUserToAddRows = false; > view.Location = new Point(20, 20); > > DataGridViewTextBoxColumn textColumn = new DataGridViewTextBoxColumn(); > textColumn.HeaderText = "text column"; > view.Columns.Add(textColumn); > > Button button = new Button(); > button.Text = "Add row"; > button.Size = new Size(100, 25); > button.Location = new Point(450, 10); > button.Click += delegate(object sender, EventArgs args) > { > DataGridViewRow row = new DataGridViewRow (); > DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell(); > cell.Value = view.Rows.Count; > row.Cells.Add (cell); > view.Rows.Add (row); > }; > > Button insert1 = new Button(); > insert1.Text = "Toggle 1st"; > insert1.Size = new Size(100, 25); > insert1.Location = new Point(450, 35); > insert1.Click += delegate(object sender, EventArgs args) > { > DataGridViewRow row = new DataGridViewRow(); > DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell(); > cell.Value = "insert 1"; > row.Cells.Add(cell); > view.Rows.Insert(1, row); > }; > > view.Rows.Add(new DataGridViewRow()); > > Controls.Add(insert1); > Controls.Add(view); > Controls.Add(button); > } > > } > } >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 472968
:
270515
|
270516
|
270519
| 270532 |
270536
|
270550