Provides a customizable grid for displaying data.
public class GridView: Control
The following table lists the members exposed by the GridView object. Click a tab on the left to choose the type of member you want to view.
Methods
Method Description BeginUpdate Sets the GridView in edit mode. BringToFront Brings the control to the front of the z-order. (Inherited from Control) CancelEdit Cancels edit mode that was set to the GridView. CollapseRow Contains Returns a value indicating whether the specified control is a child of the control. (Inherited from Control) CreateControl Forces the creation of the control, including the creation of the handle and any child controls. (Inherited from Control) CreateControlSkin Creates the skin for the Control. (Inherited from Control) CreateControlSkinInstance Creates a ControlSkin instance for the Control. (Inherited from Control) CreateControlsInstance Creates a new instance of the control collection for the control. (Inherited from Control) CreateHandle Creates a handle for the control. (Inherited from Control) DestroyHandle Destroys the handle associated with the control. (Inherited from Control) Dispose Overloaded. (Inherited from Component) EndAsyncRowsRequest Ends the request from the BeginAsyncRowsRequest event and fills the requested data into the GridView. EndEdit Ends the edit operation of the GridView. EndUpdate Overloaded. Ends the edit mode that is currently set to the GridView. EndValidating Ends the validating of the GridView. Equals Overloaded. Compares two objects to determine if they are equal. (Inherited from Object) ExpandRow FindForm Returns the form that the control is on. (Inherited from Control) Focus Sets input focus to the control. (Inherited from Control) GetChildAtPoint Returns the child control that is located at the specified coordinates. (Inherited from Control) GetContainerControl Returns the next ContainerControl up the control's chain of parent controls. (Inherited from Control) GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object) GetNextControl Returns the next control forward or back in the tab order of child controls. (Inherited from Control) GetStyle Returns the value of the specified control style bit for the control. (Inherited from Control) GetTopLevel Determines if the control is a top-level control. (Inherited from Control) GetType Gets the Type of the current instance. (Inherited from Object) GridView Initializes a new instance of GridView. Hide Hides the control from the user. (Inherited from Control) InitLayout Initializes the layout state of the control after it has been added to another container. (Inherited from Control) InternalMethod Inherited from Control. Invalidate Overloaded. Invalidates the control. This will cause a paint event to be sent later to the control. (Inherited from Control) InvokeGotFocus Raises the GotFocus event for the specified control. (Inherited from Control) InvokeLostFocus Raises the LostFocus event for the specified control. (Inherited from Control) InvokeOnClick Raises the Click event for the specified control. (Inherited from Control) InvokePaint Raises the Paint event for the specified control. (Inherited from Control) InvokePaintBackground Invoke the Control.OnPaintBackground method for the specified control. (Inherited from Control) IsInputChar Determines if a character is an input character that the control recognizes. (Inherited from Control) IsInputKey Overriden. Determines whether the specified key is a regular input key or a special key that requires preprocessing. IsMnemonic Determines if the specified character is the mnemonic character assigned to the control in the specified string. (Inherited from Control) NotifyCurrentCellFormattedValueChanged Notifies the GridView that the formatted value of the current cell has changes. OnAsyncWaitRowNeeded Raises the AsyncWaitRowNeeded event. OnBackColorChanged Raises the BackColorChanged event. (Inherited from Control) OnBeginAsyncRowsRequest Raises the BeginAsyncRowsRequest event. OnCausesValidationChanged Raises the CausesValidationChanged event. (Inherited from Control) OnCellBeginEdit Raises the CellBeginEdit event. OnCellDoubleClick Raises the CellDoubleClick event. OnCellEndEdit Raises the CellEndEdit event. OnCellMouseDown Raises the CellMouseDown event. OnCellMouseEnter Raises the CellMouseEnter event. OnCellMouseLeave Raises the CellMouseLeave event. OnCellMouseMove Raises the CellMouseMove event. OnCellMouseUp Raises the CellMouseUp event. OnCellValidated Raises the CellValidated event. OnCellValidating Raises the CellValidating event. OnCellValueChanged Raises the CellValueChanged event. OnClick Raises the Click event. (Inherited from Control) OnClientSizeChanged Inherited from Control. OnColumnNameChanged Raises the ColumnNameChanged event. OnColumnStateChanged Raises the ColumnStateChanged event. OnColumnsAdded Raises the ColumnsAdded event. OnColumnsRemoved Raises the ColumnsRemoved event. OnControlAdded Raises the ControlAdded event. (Inherited from Control) OnControlRemoved Raises the ControlRemoved event. (Inherited from Control) OnCreateControl Overriden. Raises the CreateControl event. OnCurrentCellFormattedValueChanged Raises the CurrentCellFormattedValueChanged event. OnCursorChanged Raises the CursorChanged event. (Inherited from Control) OnDockChanged Raises the DockChanged event. (Inherited from Control) OnDoubleClick Overriden. Raises the DoubleClick event. OnEnabledChanged Raises the EnabledChanged event. (Inherited from Control) OnEnter Raises the Enter event. (Inherited from Control) OnFontChanged Raises the FontChanged event. (Inherited from Control) OnForeColorChanged Raises the ForeColorChanged event. (Inherited from Control) OnGotFocus Raises the GotFocus event. (Inherited from Control) OnHandleCreated Overriden. Raises the HandleCreated event. OnHandleDestroyed Overriden. Raises the HandleDestroyed event. OnKeyDown Overriden. Raises the KeyDown event. OnKeyPress Raises the KeyPress event. (Inherited from Control) OnKeyUp Raises the KeyUp event. (Inherited from Control) OnLayout Raises the Layout event. (Inherited from Control) OnLeave Raises the Leave event. (Inherited from Control) OnLocationChanged Raises the LocationChanged event. (Inherited from Control) OnLostFocus Raises the LostFocus event. (Inherited from Control) OnMouseDown Overriden. Raises the MouseDown event. OnMouseEnter Raises the MouseEnter event. (Inherited from Control) OnMouseLeave Overriden. Raises the MouseLeave event. OnMouseMove Overriden. Raises the MouseMove event. OnMouseUp Overriden. Raises the MouseUp event. OnMouseWheel Raises the MouseWheel event. (Inherited from Control) OnMove Raises the Move event. (Inherited from Control) OnNCPaint Overriden. Occurs when the non-client area of the control needs to be redrawn. OnPaint Overriden. Raises the Paint event. OnPaintBackground Paints the background of the control. (Inherited from Control) OnParentChanged Overriden. Raises the ParentChanged event. OnParentEnabledChanged Raises the EnabledChanged event when the Enabled property value of the control's container changes. (Inherited from Control) OnParentVisibleChanged Raises the VisibleChanged event when the Visible property value of the control's container changes. (Inherited from Control) OnResize Raises the Resize event. (Inherited from Control) OnRowNeeded Raises the RowNeeded event. OnRowStateChanged Raises the RowStateChanged event. OnRowValidated Raises the RowValidated event. OnRowValidating Raises the RowValidating event. OnSizeChanged Raises the SizeChanged event. (Inherited from Control) OnSkinChanged Raises the SkinChanged event. (Inherited from Control) OnStyleChanged Raises the StyleChanged event. (Inherited from Control) OnTabIndexChanged Raises the TabIndexChanged event. (Inherited from Control) OnTabStopChanged Raises the TabStopChanged event. (Inherited from Control) OnTextChanged Raises the TextChanged event. (Inherited from Control) OnValidated Raises the Validated event. (Inherited from Control) OnValidating Overriden. Raises the Validating event. OnVisibleChanged Raises the VisibleChanged event. (Inherited from Control) PerformLayout Overloaded. Forces the control to apply layout logic to all its child controls. (Inherited from Control) PointToClient Computes the location of the specified screen point into client coordinates. (Inherited from Control) PointToScreen Computes the location of the specified client point into screen coordinates. (Inherited from Control) ProcessDialogChar Processes a dialog character. (Inherited from Control) ProcessDialogKey Overriden. Processes a dialog key. ProcessEditingControlKeyDown Processes keys used for control editing in the GridView. ProcessMnemonic Processes a mnemonic character. (Inherited from Control) RecreateHandle Forces the re-creation of the handle for the control. (Inherited from Control) RectangleToClient Computes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control) RectangleToScreen Computes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control) ReferenceEquals Determines whether the specified Object instances are the same instance. (Inherited from Object) Refresh Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control) ResetBackColor Resets the BackColor property to its default value. (Inherited from Control) ResetCursor Resets the Cursor property to its default value. (Inherited from Control) ResetFont Resets the Font property to its default value. (Inherited from Control) ResetForeColor Resets the ForeColor property to its default value. (Inherited from Control) ResetSkin Resets the Skin property to its default value. (Inherited from Control) ResetText Resets the Text property to its default value. (Inherited from Control) ResumeLayout Overloaded. Resumes normal layout logic. (Inherited from Control) Select Overloaded. Activates the control. (Inherited from Control) SelectNextControl Activates the next control. (Inherited from Control) SendToBack Sends the control to the back of the z-order. (Inherited from Control) SetBackgroundStyle Sets the background style for the GridView. SetBounds Overloaded. Sets the bounds of the control to the specified location and size. (Inherited from Control) SetBoundsCore Overriden. Performs the work of setting the specified bounds of this control. SetClientSizeCore Sets the size of the client area of the control. (Inherited from Control) SetNCSizeCore Sets the non-client area of the control. (Inherited from Control) SetNewRowCreator SetStyle Sets the specified style bit to the specified value. (Inherited from Control) SetTopLevel Sets the control as the top-level control. (Inherited from Control) SetVisibleCore Sets the control to the specified visible state. (Inherited from Control) Show Displays the control to the user. (Inherited from Control) SuspendLayout Temporarily suspends the layout logic for the control. (Inherited from Control) ToString Returns a String that represents the current Object. (Inherited from Object) Update Causes the control to redraw its client area if it was invalidated. (Inherited from Control) UpdateBounds Overloaded. Updates the bounds of the control with the current size and location. (Inherited from Control) UpdateZOrder Updates the control in its parent's z-order. (Inherited from Control) Properties
Property Description AllowUserToOrderColumns Gets or sets a value indicating whether the user is allowed to exchange position of columns by clicking and dragging the column header. AllowUserToResizeColumns Gets or sets a value indicating whether the user is allowed to resize columns. Anchor Gets or sets which edges of the control are anchored to the edges of its container. (Inherited from Control) AsyncBufferMode Gets or sets a value indicating the buffering mode of the GridView. AsyncBufferSize Gets or sets the size of the buffer which contains rows will be displayed on the the GridView in the AsyncMode. AsyncMode Gets or sets a value indicating whether the loading data of the GridView is processed synchronously or asynchronously. BackColor Gets or sets the background color for the control. (Inherited from Control) BackVisual Gets the visual of the control. (Inherited from Control) BorderStyle Gets or sets the border style for the GridView. Bottom Gets the distance between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control) BottomFrozenRowsCount Gets or sets amount of rows to be frozen at the bottom of the GridView. Bounds Gets or sets the size and location of the control including its nonclient elements. (Inherited from Control) CanFocus Gets a value indicating whether the control can receive focus. (Inherited from Control) CanSelect Gets a value indicating whether the control can be selected. (Inherited from Control) Capture Gets or sets a value indicating whether the control has captured the mouse. (Inherited from Control) CausesValidation Gets or sets a value indicating whether the control causes validation for any controls that require validation when it receives focus. (Inherited from Control) ClientRectangle Gets the rectangle that represents the client area of the control. (Inherited from Control) ClientSize Gets or sets the height and width of the client area of the control. (Inherited from Control) ColumnCount Gets the number of columns that is already created in the GridView. ColumnHeadersHeight Gets or sets the height of the row that contains the column headers of the GridView. ColumnHeadersVisible Gets or sets a value indicating whether the row that contains column headers is visible. Columns Gets a GridViewColumnCollection that contains all the columns of the GridView. Container Gets the IContainer that contains the Component. (Inherited from Component) ContainsFocus Gets a value indicating whether the control or one of its child controls currently has the input focus. (Inherited from Control) ControlSkin Gets the ControlSkin of the control. (Inherited from Control) Controls Gets the collection of controls contained within the control. (Inherited from Control) Created Gets a value indicating whether the control has been created. (Inherited from Control) CurrentCell Gets or sets the currently active cell of the GridView. CurrentCellAddress Gets the indexes of row and column of the currently active cell. Cursor Overriden. Gets or sets the cursor which is displayed when the mouse pointer is over the control. DefaultBackColor Gets the default background color of the control. (Inherited from Control) DefaultCellStyle Gets the default cell style of the GridView. DefaultColumnHeaderStyle Gets the default style of the column header of the GridView. DefaultColumnWidth Gets or sets the default column width of the GridView. DefaultFont Gets the default font of the control. (Inherited from Control) DefaultForeColor Gets the default foreground color of the control. (Inherited from Control) DefaultMinimumColumnWidth Gets or sets the default minimum width of the column. DefaultMinimumRowHeight Gets or sets the default minimum height of the row. DefaultRowHeaderStyle Gets the default style of the row header of the GridView. DefaultRowHeight Gets or sets the default row height of the GridView. DefaultSize Overriden. Gets the default size of the control. DefaultSkin Gets or sets the default skin of the control. (Inherited from Control) DisplayRectangle Gets the rectangle which represents the display area of the control. (Inherited from Control) Disposing Gets a value indicating whether the control is in the process of being disposed of. (Inherited from Control) Dock Gets or sets which edge of the parent container a control is docked to. (Inherited from Control) DockBottomFrozenRows Gets or sets a value indicating whether the bottom frozen rows to be docked at the bottom of the GridView. DockRightFrozenColumns Gets or sets a value indicating whether the right frozen columns to be docked at the bottom of the GridView. Enabled Gets or sets a value indicating whether the control can react to user interaction. (Inherited from Control) FixedColumnWidth Gets a value indicating whether the width of column is fixed. FixedRowHeight Gets a value indicating whether the height of row is fixed. Focused Gets a value indicating whether the control has input focus. (Inherited from Control) Font Gets or sets the font of the text which is displayed by the control. (Inherited from Control) ForeColor Gets or sets the foreground color of the control. (Inherited from Control) Handle Gets the native handle that the control is bound to. (Inherited from Control) HasChildren Gets a value indicating whether the control has one or more child controls. (Inherited from Control) Height Gets or sets the height of the control. (Inherited from Control) IsCurrentCellDirty Gets a value indicating whether the current cell has uncommitted changes. IsCurrentCellInEditMode Gets a value indicating whether the currently active cell is being edited. IsCurrentRowDirty Gets a value indicating whether the current row has uncommitted changes. IsDisposed Gets a value indicating whether the control has been disposed of. (Inherited from Control) IsHandleCreated Gets a value indicating whether the control has a handle associated with it. (Inherited from Control) Left Gets or sets the horizontal coordinate of a control's left edge. (Inherited from Control) LeftFrozenColumnsCount Gets or sets amount of columns to be frozen at the left side of the GridView. Location Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. (Inherited from Control) MaskVisual Gets the Visual which is the mask of the control. (Inherited from Control) ModifierKeys Gets a value indicating when one of the modifier keys (SHIFT, CTRL, and ALT) is pressed. (Inherited from Control) MouseButtons Gets a value indicating when one of the mouse buttons is clicked. (Inherited from Control) MousePosition Gets the position of the mouse cursor in global coordinates. (Inherited from Control) MultiSelect Gets or sets a value indicating whether the GridView is allowed to be selected more than one cell, row or column. NCVisual Gets the non-client visual element of the control. (Inherited from Control) Name Gets or sets the name of the control. (Inherited from Control) NewRowCreator OverlayVisual Gets a visual placed over everything. (Inherited from Control) Parent Gets or sets the parent container of the control. (Inherited from Control) Parked Gets a value indicating whether the control is parked. (Inherited from Control) RealTimeColumnResize Gets or sets a value indicating whether the resizing of column is showed immediately when the mouse is dragging. RecreatingHandle Gets a value indicating whether the control is currently re-creating its handle. (Inherited from Control) Right Gets the distance between the right edge of the control and the left edge of its container. (Inherited from Control) RightFrozenColumnsCount Gets or sets amount of columns to be frozen at the right side of the GridView. RowCount Gets the number of rows that is already created in the GridView. RowHeadersVisible Gets or sets a value indicating whether the column that contains row headers is visible. RowHeadersWidth Gets or sets the width of the column that contains the headers row of the GridView. Rows Gets a GridViewRowCollection that contains all the columns of the GridView. SelectedRowIndex Gets the index of the current row is being selected. SelectedRows Gets a GridViewSelectedRowCollection that contains the currently selected row of the GridView. SelectionMode Gets or sets the specified selection mode of the GridView. ShowHorizontalScrollBar Gets or sets a value indicating whether the horizontal scrollbar is added to the GridView. ShowVerticalScrollBar Gets or sets a value indicating whether the vertical scrollbar is added to the GridView. Site Gets or sets the ISite of the Component. (Inherited from Component) Size Gets or sets the height and width of the control. (Inherited from Control) Skin Gets or sets the skin of the control. (Inherited from Control) SystemMenu Gets or sets the SystemMenu of the control. (Inherited from Control) TabIndex Gets or sets the tab order of the control within its container. (Inherited from Control) TabStop Gets or sets a value indicating whether the user can use the TAB key to focus to the control. (Inherited from Control) Tag Gets or sets the object that contains data about the control. (Inherited from Control) Text Gets or sets the text which is associated with the control. (Inherited from Control) Top Gets or sets the vertical coordinate of the control's top edge. (Inherited from Control) TopFrozenRowsCount Gets or sets amount of rows to be frozen at the top of the GridView. TopLevelControl Gets the parent control that is not parented by another Windows Forms control. (Inherited from Control) Visible Gets or sets a value indicating whether the control is visible. (Inherited from Control) Visual Gets the visual element of the control. (Inherited from Control) Width Gets or sets the width of the control. (Inherited from Control) Events
Event Description AsyncWaitRowNeeded Appears when the GridView is waiting to load the GridViewRow in the AsyncMode. BackColorChanged Handles the changes of the BackColor property. (Inherited from Control) BeginAsyncRowsRequest Appears when the GridView begins to load the requested rows in the AsyncMode. CausesValidationChanged Handles the changes of the CausesValidation property. (Inherited from Control) CellBeginEdit Appears when edit mode starts for the selected cell. CellDoubleClick Appears when a cell is double clicked. CellEndEdit Appears when edit mode stops for the currently selected cell. CellMouseDown Appears when the user presses a mouse button while the mouse pointer is within the boundaries of a cell. CellMouseEnter Appears when the mouse pointer enters a cell. CellMouseLeave Appears when the mouse pointer leaves a cell. CellMouseMove Appears when the mouse pointer moves over the GridView. CellMouseUp Appears when the user releases a mouse button while over a cell. CellValidated Appears after the cell has finished validating. CellValidating Appears when a cell loses input focus, enabling content validation. CellValueChanged Appears when the value of a cell changes. Click Handles the click event when the control is clicked. (Inherited from Control) ClientSizeChanged Inherited from Control. ColumnNameChanged Appears when the value of the Name is changed. ColumnStateChanged Appears when a column changes state. ColumnsAdded Appears when a column is added to the GridView. ColumnsRemoved Appears when a column is removed from the GridView. ControlAdded Handles the addition of a new control when it is added to the Control.ControlCollection. (Inherited from Control) ControlRemoved Handles the remove of a control from the Control.ControlCollection. (Inherited from Control) CurrentCellFormattedValueChanged Appears when the formatted value of the current cell has changes. CursorChanged Handles the changes of the Cursor property. (Inherited from Control) Disposed Adds an event handler to listen to the Disposed event on the component. (Inherited from Component) DockChanged Handles the changes of the Dock property. (Inherited from Control) DoubleClick Handles the double-clicked event of the control. (Inherited from Control) EnabledChanged Handles the changes of the Enabled property. (Inherited from Control) Enter Handles the entered event of the control. (Inherited from Control) FontChanged Handles the changes of the Font property. (Inherited from Control) ForeColorChanged Handles the changes of the ForeColor property. (Inherited from Control) GotFocus Handles the focus reception of the control. (Inherited from Control) HandleCreated Handles the creation of a handle for the control. (Inherited from Control) HandleDestroyed Handles the control's handle which is in the process of being destroyed. (Inherited from Control) KeyDown Handles the pressed key event when a key is pressed and the control has focus. (Inherited from Control) KeyPress Handles the pressed key event when a key is pressed and the control has focus. (Inherited from Control) KeyUp Handles the release key event when a key is released and the control has focus. (Inherited from Control) Layout Handles the changes of control when it should reposition its child controls. (Inherited from Control) Leave Handles the input focus when it leaves the control. (Inherited from Control) LocationChanged Handles the changes of the Location property. (Inherited from Control) LostFocus Handles the focus on the control when it loses focus. (Inherited from Control) MouseDown Handles the mouse event when the mouse pointer is over the control and a mouse button is pressed. (Inherited from Control) MouseEnter Handles the mouse event when the mouse pointer enters the control. (Inherited from Control) MouseLeave Handles the mouse event when the mouse pointer leaves the control. (Inherited from Control) MouseMove Handles the mouse event when the mouse pointer is moved over the control. (Inherited from Control) MouseUp Handles the mouse event when the mouse pointer is over the control and a mouse button is released. (Inherited from Control) MouseWheel Handles the mouse event when the mouse wheel moves while the control has focus. (Inherited from Control) Move Handles the motion of the control when it is moved. (Inherited from Control) Paint Handles the paint event of the control when it is redrawn. (Inherited from Control) ParentChanged Handles the changes of the Parent property. (Inherited from Control) Resize Handles the size changes of the control when it is resized. (Inherited from Control) RowNeeded Appears when the GridView needed to load the GridViewRow in the AsyncMode. RowStateChanged Appears when a row changes state. RowValidated Appears after a row has finished validating. RowValidating Appears when a row is validating. SizeChanged Handles the changes of the Size property. (Inherited from Control) SkinChanged Handles the changes of the Skin property. (Inherited from Control) StyleChanged Handles the changes of the control style. (Inherited from Control) TabIndexChanged Handles the changes of the TabIndex property. (Inherited from Control) TabStopChanged Handles the changes of the TabStop property. (Inherited from Control) TextChanged Handles the changes of the Text property. (Inherited from Control) Validated Handles the validation of the control when it is finished validating. (Inherited from Control) Validating Handles the validation of the control when it is validating. (Inherited from Control) VisibleChanged Determines the value of the VScroll property. (Inherited from Control)
Object
// This sample demonstrates how to use the GridView class. It also illustrates some specific points of this one.
using System;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using NETiKA.Grid;
public class MyForm : System.Windows.Forms.Form
{
private GridView gridView = null;
private Button button = null;
public MyForm()
{
InitializeComponent();
init_grid( 5, 5, 390, 250 );
}
private void InitializeComponent()
{
// Create a new GridView for displaying data.
gridView = new GridView();
// Set some frozen rows and columns.
gridView.TopFrozenRowsCount = 2;
gridView.BottomFrozenRowsCount = 2;
gridView.LeftFrozenColumnsCount = 1;
// Allow the user exchanges columns.
gridView.AllowUserToOrderColumns = true;
button = new Button();
button.Location = new Point(5,260);
button.Size = new Size(100,25);
Controls.Add(button
);Controls.Add(gridView);
ResumeLayout();
}
private void init_grid( int x, int y, int w, int h )
{
gridView.Location= new Point(x,y);
gridView.Size= new Size(w,h);
// Some events related to the grid.
gridView.CellMouseDown += new GridViewCellMouseEventHandler(ongrid_mouse_down);
// gridView.CellBeginEdit += new GridViewCellCancelEventHandler(oncell_edit);
// gridView.CellValidating += new GridViewCellValidationEventHandler(cell_validating);
// gridView.CellDoubleClick += new GridViewCellEventHandler(on_doubleclick);
// gridView.CellEndEdit += new GridViewCellEventHandler(oncell_end_edit);
// gridView.CellMouseEnter += new GridViewCellEventHandler(ongrid_mouse_enter);
// gridView.CellMouseLeave += new GridViewCellEventHandler(oncell_mouse_leave);
// gridView.CellMouseMove += new GridViewCellMouseEventHandler(oncell_mouse_move);
// gridView.CellMouseUp += new GridViewCellMouseEventHandler(oncell_mouse_up);
// gridView.CellStateChanged += new GridViewCellStateChangedEventHandler(oncell_state_changed);
// gridView.CellValidated += new GridViewCellEventHandler(oncell_validated);
// gridView.CellValidating += new GridViewCellValidationEventHandler(oncell_validating);
// gridView.CellValueChanged += new GridViewCellEventHandler(oncell_value_changed);
// gridView.ColumnStateChanged += new GridViewColumnStateChangedEventHandler(oncolumn_state_changed);
// gridView.ColumnsAdded += new GridViewColumnsAddedEventHandler(oncolumn_added);
// gridView.ColumnsRemoved += new GridViewColumnsRemovedEventHandler(oncolumn_removed);
int n_cols= 4;
for( int i= 0; i < n_cols; ++i )
{
GridViewColumn c= new GridViewColumn();
gridView.Columns.Add( c, false );
{
case 0 : c.HeaderCell.Value = "Column-"+(i+1);break;
case 1 : c.HeaderCell.Value = "Column-"+(i+1);break;
case 2 : c.HeaderCell.Value = "Column-"+(i+1);break;
case 3 : c.HeaderCell.Value = "Column-"+(i+1);break;
}
}
int n_rows= 100;
for( int i= 0; i < n_rows; ++i )
{
GridViewRow r= new GridViewRow();
for( int j= 0; j < n_cols; ++j )
{
GridViewTextBoxCell c= new GridViewTextBoxCell();
c.Style = new GridViewCellStyle();
c.Style.BackColor = Color.Gray;
c.Style.ForeColor = Color.AliceBlue;
}
}
}
private void