To do that you need a hook on the ModelAdmin 'Search' TableListField, so you can use its setFieldListCsv() method. One way to accomplish that is by extending the ModelAdmin_CollectionController class and subclassing its getResultsTable() method, that returns the TableListField.
So suppose you have a Product class like this:
class Product extends DataObject{
static $db = array (
'Name' => 'Varchar(255)',
'Price' => 'Varchar(255)',
'Code' => 'Varchar(255)'
);
static $summary_fields = array(
'Name'
);
...
}
Now your ModelAdmin might look like this:
class ProductAdmin extends ModelAdmin {
public static $managed_models = array(
'Product'
);
static $url_segment = 'products';
static $menu_title = 'Products';
// tell ModelAdmin to use your custom CollectionController
public static $collection_controller_class = "ProductAdmin_CollectionController";
}
Next create the CollectionController like this:
class ProductAdmin_CollectionController extends ModelAdmin_CollectionController {
function getResultsTable($searchCriteria) {
$tf = parent::getResultsTable($searchCriteria);
$tf->setFieldListCsv(array(
'Name' => 'Name',
'Price' => 'Price',
'Code' => 'code'
));
return $tf;
}
}