2014-04-18 8 views
-1

나는이 Syncfusion Controls에 지긋 지긋하다. 보통의 Dataagridview와 비교하면 매우 어렵다. Syncfusion GridControl의 Datapropertyname은 어디에 있습니까? 그리드 컨트롤에 데이터를 바인딩하는 방법.Windows 응용 프로그램을 사용하여 C#의 SyncFusion GridControl에 데이터를 바인딩하는 방법은 무엇입니까?

gridControl1.ColStyles[3].DataSource = dt1; 
gridControl1.ColStyles[3].DisplayMember = "bcmp_Name"; gridControl1.ColStyles[3].ValueMember = "bcmp_Id"; 
gridControl1.ColStyles[3].DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Exclusive; 
gridControl1.ColStyles[5].DataSource = dt2; 
gridControl1.ColStyles[5].DisplayMember = "bcmp_Name"; 
gridControl1.ColStyles[5].ValueMember = "bcmp_Id"; 
gridControl1.ColStyles[5].DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Exclusive; 
gridControl1.ColStyles[7].DataSource = dt3; 
gridControl1.ColStyles[7].DisplayMember = "bcmp_Name"; gridControl1.ColStyles[7].ValueMember = "bcmp_Id"; 
gridControl1.ColStyles[7].DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Exclusive; 
gridControl1.ColStyles[9].DataSource = dt4; 
gridControl1.ColStyles[9].DisplayMember = "bcmp_Name"; 
gridControl1.ColStyles[9].ValueMember = "bcmp_Id"; 
gridControl1.ColStyles[9].DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Exclusive; 
gridControl1.TableStyle.DataSource = Chldtbl; 

위의 코드를 사용하면 바인딩 할 수 없기 때문에 링크 중 하나에 연결할 수 없습니다.

+0

내가 잘 이러한 컨트롤을 잘 모르겠지만, 당신이 * 스타일에 결합되는 것 같습니다 오히려 * 데이터보다 *. 'gridControl1.DataSource' 속성이 있습니까? –

+0

@EvanL 당신은 내가 윈도우즈 컨트롤을 가진 famliar가 아니라고 생각합니다. 나는 잘 압니다. DataGridView에 대해 우리는 DataGridView.DataSource를 작성하지만 여기에는 기회가 없습니다. 그와 같이 주어진 것입니다. – Anjali

+0

분명히 여기에 언어 장벽이 있습니다. 나는 **이 컨트롤을 모른다는 ** ** 나는 말하고 있었다. 그리고 그 재산이 있는지 물어 보았습니다. 분명히 그렇지 않습니다. 미안해, 너를 더 도울 수 없어. –

답변

0

잘못된 그리드 컨트롤을 사용하고있는 것 같습니다. 직접 데이터 바인딩에는 Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl 또는 Syncfusion.Windows.Forms.Grid.GridDataBoundGrid 컨트롤을 사용하십시오.

실제로 Syncfusion.Windows.Forms.Grid.GridControl을 사용하려는 경우 가상 모드에서 사용할 수 있습니다. QueryColCount, QueryRowCount, QueryCellInfoQueryCellFormattedText 이벤트를 확인하십시오. QueryCellInfo은 스타일과 값을 설정해야하는 곳입니다. 양방향 바인딩을 수행하려면 SaveCellInfo 이벤트도 참조하십시오.

0

Doug에 의해 제안 된 것처럼 데이터 바인딩을위한 가장 좋은 방법은 GridGrouping 또는 GridDataBound 컨트롤을 사용하는 것입니다. 그래도 GridControl을 사용하려면 데이터 바인딩에 PopulateValues ​​메서드를 사용하는 것이 좋습니다. 자세한 내용은 아래 코드 스 니펫 및 UG 링크를 참조하십시오.

C#: 
this.gridControl1.BeginUpdate(); 
this.gridControl1.RowCount = this.numArrayRows; 
this.gridControl1.ColCount = this.numArrayCols; 



// Call PopulateValues Method to move values from a given data source (this.initArray) into the Grid Range specified. 
this.gridControl1.Model.PopulateValues(GridRangeInfo.Cells(1, 1, this.numArrayRows, this.numArrayCols), this.intArray); 
this.gridControl1.EndUpdate(); 
this.gridControl1.Refresh(); 

UG 링크 : http://help.syncfusion.com/ug/windows%20forms/grid/documents/thegridcontrolpopula.htm

은 또한 당신이 당신의 그리드에 데이터를 바인딩 가상 그리드를 사용할 수있다. 가상 그리드는 대용량 데이터를 매우 빠르게 표시 할 수 있습니다. Virtual Grid에 대한 자세한 내용은 아래의 UG 링크를 참조하십시오.

UG 링크 : * http://help.syncfusion.com/ug/windows%20forms/grid/documents/virtualgrids.htm

안부, 아니시