Data Grid

Conditionally Format DataGrid Column Text

Code Customization
Conditionally Format DataGrid Column Text (Not Applicable To Mobile and Gallery Page)

This customization sets the color of an ASP DataGrid cell based on its value. In this example, you will add the DataGrid to the bottom of a table control.

This customization will be added in:

..\<Application Name>\<Table Name>\Show<Table Name>Table.aspx.cs

For example: C:\MyApp1\Customers\ShowCustomersTable.aspx.cs


Step 1:  In Iron Speed Designer, switch to Layout Editor then select a table control.

Step 2:  Highlight any desired empty cell at the bottom of the table control.

Step 3:  Add the following HTML code to the cell using Cell Editor.

     <asp:datagrid id="myDataGrid" OnItemDataBound= "MyItemDataBound" runat="server">
         <HeaderStyle BackColor = "#336699" ForeColor = "#ffffff" Font-Bold = "true" />
         <AlternatingItemStyle BackColor = "#eeeeee" />

Step 4:  Use this wizard to add code customization.

Step 5:  Build and run the application.

Customizations included in this wizard are provided as a sample to demonstrate a feature, and may work only in specific situations. The Iron Speed Designer support team cannot assist in the resolution of problems which may occur as a result of customizing your application or modifying a customization to fit a particular purpose.

Terms of Service Privacy Statement