Binding mmGridView to Untyped Data
- Create a business object method that retrieves data you want to bind to the mmGridView.
For example, in C#:
/// <summary> /// Get all employees /// </summary> /// <returns>DataTable containing employees</returns> public DataTable GetAllEmployees() { DataSet ds = this.GetDataSet("SELECT * FROM Employees"); return ds.Tables[this.TableName]; }And in VB .NET:
''' <summary> ''' Get all employees ''' </summary> ''' <returns>DataTable containing employees</returns> Public Function GetAllEmployees() As DataTable Dim ds As DataSet = Me.GetDataSet("SELECT * FROM Employees") Return ds.Tables(Me.TableName) End Function - Register the business object in the web form's Load handler then call the business object method that retrieves the data
For example, in C#:
public partial class _Default : mmBusinessWebPage { protected Employee oEmployee; /// <summary> /// Page Load handler /// </summary> /// <param name="sender">Event source</param> /// <param name="e">Event args</param> protected void Page_Load(object sender, EventArgs e) { this.oEmployee = (Employee)this.RegisterBizObj(new Employee()); if (!IsPostBack) { this.oEmployee.GetAllEmployees(); } } }And in VB .NET:
Public Class _Default Inherits mmBusinessWebPage Protected oEmployee As Employee ''' <summary> ''' Page Load handler ''' </summary> ''' <param name="sender">Event source</param> ''' <param name="e">Event args</param> Protected Sub Page_Load(sender As Object, e As EventArgs) Me.oEmployee = CType(Me.RegisterBizObj(New Employee()), Employee) If Not IsPostBack Then Me.oEmployee.GetAllEmployees() End If End Sub End Class
- Display the web form in design mode, then drag and drop the mmGridView control on your web form. In the popup menu select Auto Format...:

- In the Auto Format dialog, select a format for your mmGridView, then click OK:

- In the mmGridView's smart tag popup menu, select Edit Columns:

- In the Fields dialog uncheck the Auto-generate fields check box. Next, add the desired columns to the mmGridView and (at the minimum) for each column set the HeaderText property to the text you want to appear in the column header and the DataField property to the member you want to bind to. For example:

- When you are done specifying the columns, click OK to close the dialog.
- With the mmGridView control selected, go to the Properties Window select the BindingSource property, click its associated ellipses button [...] and select the business object you registered in the web form.
- If you are binding to the business object's default DataTable you can skip to the next step. If you are binding to a different DataTable, set the BindingSourceMember to the name of that DataTable. If you are binding to a DataView, set the BindingSourceMember property to the name of the DataTable.DataView you are binding to. For details, see Data Binding Web Forms Data Grids.
You should now be able to run your web page and see the mmGridView control filled with the data you specified:

© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 12/07/05
Comment or report problem with topic
