DataGrid.FlatModeChanged Event

Occurs when the FlatMode has changed.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public event EventHandler FlatModeChanged
/** @event */
public void add_FlatModeChanged (EventHandler value)

/** @event */
public void remove_FlatModeChanged (EventHandler value)

JScript supports the use of events, but not the declaration of new ones.

For more information about handling events, see Consuming Events.

// Attach to event handler.
private void AttachReadOnlyChanged()
{
   this.myDataGrid.ReadOnlyChanged += new EventHandler(this.myDataGrid_ReadOnlyChanged);
}
// Check if the 'ReadOnly' property is changed.
private void myDataGrid_ReadOnlyChanged(object sender, EventArgs e)
{   
   string strMessage = "false";
   if(myDataGrid.ReadOnly == true)
      strMessage = "true";

   MessageBox.Show("Read only changed to "+strMessage,
      "Message",   MessageBoxButtons.OK,
      MessageBoxIcon.Exclamation);         
}
// Toggle the 'ReadOnly' property.
private void button2_Click(object sender, EventArgs e)
{
   if(myDataGrid.ReadOnly == true)
      myDataGrid.ReadOnly = false;
   else
      myDataGrid.ReadOnly = true;
}      

// Attach to event handler.
private void AttachReadOnlyChanged()
{
    this.myDataGrid.add_ReadOnlyChanged(new EventHandler(
        this.myDataGrid_ReadOnlyChanged));
} //AttachReadOnlyChanged

// Check if the 'ReadOnly' property is changed.
private void myDataGrid_ReadOnlyChanged(Object sender, EventArgs e)
{
    String strMessage = "false";
    if (myDataGrid.get_ReadOnly() == true) {
        strMessage = "true";
    }
    MessageBox.Show("Read only changed to " + strMessage, "Message", 
        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
} //myDataGrid_ReadOnlyChanged

// Toggle the 'ReadOnly' property.
private void button2_Click(Object sender, EventArgs e)
{
    if (myDataGrid.get_ReadOnly() == true) {
        myDataGrid.set_ReadOnly(false);
    }
    else {
        myDataGrid.set_ReadOnly(true);
    }
} //button2_Click 

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show: