Home > Net >  Dev DataControl controls how advBandedGridView vertical merger in the same cell?
Dev DataControl controls how advBandedGridView vertical merger in the same cell?

Time:10-10


As shown in figure, want to put the first column "supplier" of the same, like this effect under the


BandedGridView, unlike the GridView, nor cellMerge properties, need to traverse??? Great god answer ahhh

CodePudding user response:

BandedGridView, unlike the GridView, nor cellMerge properties, need to traverse??? Great god answer ahhh

CodePudding user response:

Is the background database in datatable guide data directly

CodePudding user response:

reference Miaonly reply: 3/f
you use Spire. XLS to Merge cells can also, with the Merge () horizontal/vertical can be merged,
 using Spire. Xls; 

The namespace Mergecell_XLS
{
Class Program
{
The static void Main (string [] args)
{
//create a workbook and load the document
Workbook Workbook=new Workbook ();
Workbook. LoadFromFile (@ "C: \ Users \ \ Administrator \ Desktop \ test XLSX", ExcelVersion. Version2010);
//get the first form
Worksheet sheet=workbook. Worksheets [0];

//merge cells (row, column)
Sheet. Range [r]. "A2, A4" Merge ();
Sheet. Range [r]. "C2, C3" Merge ();
Sheet. Range [r]. "the A5: A6" Merge ();
Sheet. Range [r]. "D2: D4" Merge ();
Sheet. Range [r]. "D5, D6" Merge ();
Sheet. Range [r]. "E3: E4" Merge ();
Sheet. Range [r]. "C1: D1" Merge ();
//save the document
Workbook. SaveToFile (" CellsMerge. XLSX, "ExcelVersion. Version2010);
}
}
}



Thank you very much! But the requirement is to achieve the winform, must use the Dev that controls, because to do and second picture the same, including the header, so can only use BandedGridView... Vertical merger and it is to the same content cell, changes in the data source is _ of PI PI

CodePudding user response:

This is my current the view source:

 

Public _click ()
{
InitializeComponent ();
SetGridControl ();
}

Private void SetGridControl ()
{
DbHelper. ReturnConn ();
DataTable dt=DbHelper. ExecSQL (" select suppliers, plan the arrival date, materials, units, plan incoming number, inspection, warehousing, has been put in storage, to be collected from chart. The dbo. Caigou; ");
AdvBandedGridView1. Bands. AddBand (" suppliers ");
AdvBandedGridView1. Bands. AddBand (" plan delivery date ");
AdvBandedGridView1. Bands. AddBand (" materials ");
AdvBandedGridView1. Bands. AddBand (" unit ");
AdvBandedGridView1. Bands. AddBand (" plan incoming number ");
AdvBandedGridView1. Bands. AddBand (" received quantity ");
AdvBandedGridView1. Bands [5]. Children. AddBand (" to ");
AdvBandedGridView1. Bands [5]. Children. AddBand (" to be put in storage ");
AdvBandedGridView1. Bands [5]. Children. AddBand (" has been put in storage ");
AdvBandedGridView1. Bands. AddBand (" uncollected amount ");
The grid. The DataSource=dt;
AdvBandedGridView1. Bands [0]. Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" suppliers "));
AdvBandedGridView1. Bands [1]. The Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" plan delivery date "));
AdvBandedGridView1. Bands [2]. The Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" materials "));
AdvBandedGridView1. Bands [3]. The Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" unit "));
AdvBandedGridView1. Bands [4]. The Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" incoming material of "));
AdvBandedGridView1. Bands [5]. Children [0]. Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" to "));
AdvBandedGridView1. Bands [5]. Children [1]. The Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" to be put in storage "));
AdvBandedGridView1. Bands [5]. Children [2]. The Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" has been put in storage "));
AdvBandedGridView1. Bands [6]. The Columns. The Add (advBandedGridView1. Columns. ColumnByFieldName (" to be collected "));

AdvBandedGridView1. OptionsView. ShowColumnHeaders=false;
}

CodePudding user response:

I don't know if you solved the problem I encountered the same problem with you and then I found the answer from the foreign websites is not directly with advBandedGridView changes BandedGridView their basic is consistent with the characteristics of the Band but BandedGridView support the cell and the GridView,
  •  Tags:  
  • C#
  • Related