BuilderEditor

BuilderEditor ASP.NET component overview

BuilderEditor is a powerful and easy to use ASP.NET component that allows you to insert, update, delete and display data from a data source (e.g. database, Dataset).



How does the BuilderEditor ASP.NET component work?

The BuilderEditor component generates the data entry forms used to insert and edit data based on the data source schema. The data source schema is inferred from the data source to which the BuilderEditor component is bound at design-time (see Figure 1). If the data source doesn't exists at design-time, for example when it is typed directly in code, you can specify the data source schema directly using the Fields editor (see Figure 2).


Figure 1. Selecting the data source from which the schema will be inferred.


Figure 2. Using the Fields editor to specify the data source schema.

To generate the data forms used to display and edit data you need to select the data fields to be displayed or edited, respectively. For each selected data field you need to select the control that will be used for display, insert, update and validate data.


Figure 3. Specifying the values used to generate the data forms.


To execute data operation you need to interact with data events. This events include all the information (e.g. data keys, input control values) needed to execute data operations.

private void OnItemInserting(object sender, Mixba.BuilderEditor.BuilderEditorInsertEventArgs e)
{
	SqlConnection conn = new SqlConnection(sqlConnStr);
	SqlCommand command = new SqlCommand(
		"INSERT INTO USERS (FIRSTNAME, LASTNAME) VALUES (@FIRSTNAME, @LASTNAME)", conn);

	command.Parameters.Add("@FIRSTNAME", e.Values["FirstName"]);
	command.Parameters.Add("@LASTNAME", e.Values["LastName"]);			

	conn.Open();

	try
	{
		command.ExecuteNonQuery();
	}
	finally
	{
		conn.Close();
		conn.Dispose();				
		command.Dispose();
	}
}
											

Figure 4. Code for an insert data operation.


Configuring the BuilderEditor ASP.NET component

The BuilderEditor component allows you to specify the controls to be used to generate the data forms. You can use the standard web controls or third-party controls. To specify the controls used to display, insert, update and validate data you need to add them to the BuilderEditor configuration.


Figure 5. Adding new controls to the BuilderEditor configuration.


For each new control added to the BuilderEditor configuration you can specify its property values. It allows you to customize the controls to be created.


Figure 6. Specifying property values for a web control.