Exemplo n.º 1
0
        void test1_clicked(object sender, EventArgs e)
        {
            //CurrencyManager mgr = (CurrencyManager)dataGrid.BindingContext[dsSource.Tables["Users"]];
            //mgr.Position=rowtoedit;
            Console.WriteLine("there are {0} tablestyles", dataGrid.TableStyles.Count);
            Console.WriteLine("there are {0} columns in the programes Users", dataGrid.TableStyles["Users"].GridColumnStyles.Count);
            DataGridTextBoxColumn dgc = (DataGridTextBoxColumn)dataGrid.TableStyles["Users"].GridColumnStyles[1];

            dataGrid.BeginEdit(dgc, 1);

            Console.WriteLine("dgc.TextBox bounds = {0} and is {1}, parent = {2}", dgc.TextBox.Bounds, dgc.TextBox.Visible ? "visible" : "not visible", dgc.TextBox.Parent == null ? "null" : dgc.TextBox.Parent.GetType().ToString());

            dgc.TextBox.Text = "testing!";

            // Insert code to edit the value.
            dataGrid.EndEdit(dgc, 1, false);
        }