CodePudding user response:
Code is as follows, with designer words found on other blogs can be achieved, but converted into don't know how...
//the view editor to prevent trigger other events
The BeginUpdate ();
//data editing
The BeginDataUpdate ();
View. The Bands. The Clear ();
View. The Columns. The Clear ();
//create the first column
GridBand bandNCCode=view. Bands. AddBand (" product number ");
GridBand bandNCName=view. Bands. AddBand (" product name ");
GridBand bandInToday=view. Bands. AddBand (" library today ");
//the first column binding field
BandNCCode. Columns. The Add (new BandedGridColumn () {FieldName="bandNCCode", Visible=true});
BandNCName. Columns. The Add (new BandedGridColumn () {FieldName="bandNCName", Visible=true});
//create the second column
GridBand bandInCT=bandInToday. Children. AddBand (" factory ");//put in storage today
GridBand bandInCTM=bandInToday. Children. AddBand (" factory mentioned amount ");
GridBand bandInYT=bandInToday. Children. AddBand (" court ");
GridBand bandInYTM=bandInToday. Children. AddBand (" hospital lift amount ");
//the second column binding field
BandInCT. Columns. The Add (new BandedGridColumn () {FieldName="bandInCT", Visible=true});
BandInCTM. Columns. The Add (new BandedGridColumn () {FieldName="bandInCTM", Visible=true});
BandInYT. Columns. The Add (new BandedGridColumn () {FieldName="bandInYT", Visible=true});
BandInYTM. Columns. The Add (new BandedGridColumn () {FieldName="bandInYTM", Visible=true});
//at the bottom of the summation
View. OptionsView. ShowFooter=true;
String [] sum={" bandInCT ", "bandInCTM", "bandInYT", "bandInYTM"};
Foreach (var I in sum)
{
The Columns [I]. SummaryItem. SummaryType=DevExpress. Data. SummaryItemType. Sum;
The Columns [I]. SummaryItem. DisplayFormat="{0}";
}
//end data editing
The EndDataUpdate ();
//end view of editing
The EndUpdate ();