M# Tutorials

Learn to build .NET applications with M#. Our step-by-step tutorials will get you up-to-speed rapidly.
If you already know ASP.NET and C#, you can master M# in a week or two.

List Button

In chapter 7 we discussed module button which are available on each module in a separate section. In this lesson we will discuss buttons inside lists. For this lesson we will use a normal list module on our "Employee" entity and will learn to handle list buttons. One very important benefit of creating a button inside list is that you can access the list data item, which is then used to perform relative actions e.g. navigating to details of order item, incrementing or decrementing of order quantity etc.

In order to create a button, focus inside the "Elements" section of the module, M# opens a menu with the list of elements

The different types of buttons are explained below:

Button Edit

M# provides this button to implement edit functionality for a data item. Selecting this option creates an image button inside the list and allows you to add server or client side button actions.


Button Delete

On selecting this option, M# creates an image button with some default actions in the list, as shown below:

Note: "Delete item and Reload" actions inside "Delete Command" button are standard M# buttons actions which enables the deleting of a record in the list. Please read Introduction to Actions for more details on button actions.

M# generates "RowCommand" event of ASP.NET grid list and adds a new command as the name of the button.


Move Up and Move Down Buttons

These buttons are used to change the sort order of the records displayed in the grid view. In order to use this button, the underlying Module entity must have an implementation of "ISortable" interface.

Note: Please read tutorial ISortable and Sorting for more details on ISortable interface and sorting methods. Please read Introduction to Actions for more details on button actions.

Custom Buttons

The first option in the previously highlighted buttons list is used to add custom button. On selecting this option M# opens a C# editor window in order to declare the name of the button.

Converting element into list button

M# also facilitates you to convert any list element into a button. You just need to click the "Link" option opposite to the element and M# converts the element into button with some pre-populated properties

All list buttons button have almost all the same properties explained in the lesson "Module Buttons" in chapter 7 also shown in the screenshot below. The list related properties are explained below:

List Button specific Attributes

Header Text

This attribute is used to define the header text of list button.

Header Template

This attribute is used to add the header template of the list button.

Footer Template

This attribute is used to add the footer template of the list button.

Export to Excel

This property determines whether this list button should trigger an exported excel file(For more information, please read lesson Generating Excel & CSV Files in chapter 5).

Excel Template

This attribute is used to specify the template used in exporting excel or CSV files(For more information, please read lesson Generating Excel & CSV Files in chapter 5).