DataGrid::FlatMode Property
.NET Framework (current version)
Gets or sets a value indicating whether the grid displays in flat mode.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Booleantrue if the grid is displayed flat; otherwise, false. The default is false.
The following code example examines the FlatMode property and notifies the user of its status.
// Attach to event handler. private: void AttachFlatModeChanged() { this->myDataGrid->FlatModeChanged += gcnew EventHandler( this, &MyDataGridClass_FlatMode_ReadOnly::myDataGrid_FlatModeChanged ); } // Check if the 'FlatMode' property is changed. void myDataGrid_FlatModeChanged( Object^ /*sender*/, EventArgs^ /*e*/ ) { String^ strMessage = "false"; if ( myDataGrid->FlatMode == true ) strMessage = "true"; MessageBox::Show( "Flat mode changed to " + strMessage, "Message", MessageBoxButtons::OK, MessageBoxIcon::Exclamation ); } // Toggle the 'FlatMode'. void button1_Click( Object^ /*sender*/, EventArgs^ /*e*/ ) { if ( myDataGrid->FlatMode == true ) myDataGrid->FlatMode = false; else myDataGrid->FlatMode = true; }
.NET Framework
Available since 1.1
Available since 1.1
Show: