Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Activating last grid TextBox on form re-activate
Message
From
31/10/2008 16:40:32
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Activating last grid TextBox on form re-activate
Environment versions
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01358796
Message ID:
01358796
Views:
63
How to allow user to continue data enty to same grid cell after form is activated again.

Steps to reproduce:

1. Run code.
2. Enter some data to grid
3. Click other form caption
4. Click original form caption
5. Enter some characters

Observed: entered characters are ignored

Expected: entered characters must appear in last cell before form activation

How to fix ?
using System.Windows.Forms;

public class Test
{
    static void Main()
    {
        Application.Run(new MainForm());
    }
}

class MainForm : Form
{
    public MainForm()
    {
        WindowState = FormWindowState.Maximized;
        IsMdiContainer = true;
        Form frm = new Childform();
        frm.MdiParent = this;
        frm.Show();
        Form frm2 = new Childform();
        frm2.MdiParent = this;
        frm2.Show();
        frm2.Left = 2000;
    }
}

class Childform : Form
{
    public Childform()
    {
        var grid = new DataGridView();
        grid.Columns.Add(new DataGridViewTextBoxColumn());
        grid.EditMode = DataGridViewEditMode.EditOnEnter;
        Controls.Add(grid);
    }
}
Andrus
Next
Reply
Map
View

Click here to load this message in the networking platform