Back to LittleRaft

This is a sample of switching the modes of rows within a table. The table is entirely created in code behind, and is placed in a PlaceHolder control on the page. Coding the table makes it possible to create a grid type control that has limitless functionality possibilities.

The whole thing sits in an AJAX UpdatePanel so that only the table refreshes.

Although this sample only shows changes in text and buttons, any number of controls, both standard and custom, can appear in the table, with all sorts of functionality. Individual rows and cells and controls, as well as specifically chosen groups, can be extended with custom attributes and easily linked with javascript on the client side. This sample is limited to the basic structure of switching modes.

In this sample, only the selected row is placed into a different mode. However, it would be relatively easy to extend the functionality to a number of rows, or to use checkboxes, combined with selection buttons placed outside the table, to affect mode changes on multiple rows at once.

Mode 1 = Selected row is in mode 1 and can switch to default or other modes. All other rows in default mode, with mode buttons enabled.
Mode 2 = Selected row is in mode 2 and can only switch to default. All other rows in default mode, with mode buttons enabled.
Mode 3 = Selected row is in mode 3 and can only switch to default. All other rows in default mode, with mode buttons disabled.
Mode 4 = Like mode 2, except that the number of columns is reduced, noted with the change of background color.

TextMode 1Mode 2Mode 3Mode 4
In Default Mode
In Default Mode
In Default Mode
In Default Mode
In Default Mode