Binding mmDataList to Untyped Data
- Create a business object method that retrieves data you want to bind to the mmDataList.
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 mmDataList control on your web form. In the popup menu select Auto Format...:

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

- In the mmDataList's smart tag popup menu, select Edit Templates:

The default template is ItemTemplate:

- Drag and drop MM .NET controls on the mmDataList control Item Template for each item you want to display in the mmDataList. For example:

In this example there are four labels in the Item Template. This is because the Item Template is a read-only view of the data.
- For each control you want to data bind, click the control's smart tag and in the popup menu select Edit DataBindings...:

- In the DataBindings dialog's Code expression text box, enter an Eval("<MemberName>") statement that contains the name of the data member you want to bind the user interface control to. For example:

Afterwards, click OK to close the dialog.
- When you are done specifying the data binding for the user interface conrols, click the mmDataList's smart tag and select End Template Editing:

- With the mmDataList 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 mmDataList control filled with the data you specified:

© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 09/29/11
Comment or report problem with topic
