源码:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace WindowsFormsSample
{
/// <summary>
/// Summary description for frmSample9.
/// </summary>
[Sample("SourceGrid - Extensions", 9, "Data Binding - DataGrid SQL Binding")]
public class frmSample9 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox txtConnectionString;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtSqlQuery;
private System.Windows.Forms.Button btLoad;
private System.Windows.Forms.Label lbRowsNumber;
private SourceGrid.DataGrid dataGrid;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckBox chkEdit;
private System.Windows.Forms.CheckBox chkMultiSelection;
private System.Windows.Forms.CheckBox chkAllowNew;
private CheckBox chkAllowDelete;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public frmSample9()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.txtConnectionString = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtSqlQuery = new System.Windows.Forms.TextBox();
this.btLoad = new System.Windows.Forms.Button();
this.lbRowsNumber = new System.Windows.Forms.Label();
this.dataGrid = new SourceGrid.DataGrid();
this.label3 = new System.Windows.Forms.Label();
this.chkEdit = new System.Windows.Forms.CheckBox();
this.chkMultiSelection = new System.Windows.Forms.CheckBox();
this.chkAllowNew = new System.Windows.Forms.CheckBox();
this.chkAllowDelete = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// txtConnectionString
//
this.txtConnectionString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))