Thursday, June 4, 2015

GroupIndex="0"

...put inline in a dx:GridViewDataColumn at a dx:ASPxGridView will allow the column to sit as a row above the other columns and allow the other columns to be expandable/collapsible content. There may be more than one expandable/collapsible rows of columns in the DevExpress grid too as we are now "grouping by" the GroupIndex row. A negative one is the default value for this setting in lieu of the zero. By default, the rows of columns will be collasped. The way around this is with a DataBound event which you'd wire up like so:

Foo.DataBound += Foo_DataBound;

 
 

Make the event do this:

protected void Foo_DataBound(object sender, System.EventArgs e)
{
   ((ASPxGridView)sender).ExpandAll();
}

 
 

In contrast, this will open by default the DetailRows content in a ASPxGridView.

protected void Foo_DataBound(object sender, System.EventArgs e)
{
   ((ASPxGridView)sender).DetailRows.ExpandAllRows();
}

 
 

...er, wait. A better way to make the rows expanded may be at the web form side like this:

<SettingsBehavior AutoExpandAllGroups="True"></SettingsBehavior>

 
 

The other way comes with some wackiness in which if one collaspes a row the others all spring open. Boo.

No comments:

Post a Comment