原創(chuàng)|其它|編輯:郝浩|2012-10-23 09:36:02.000|閱讀 300 次
概述:本文通過一個具體事例來給大家演示,如何實現(xiàn)DevExpress顯示與單元格相關(guān)的數(shù)據(jù)庫數(shù)據(jù)。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
示例圖如下:
我們點擊第一列1994年下面的第三行單元格數(shù)據(jù),就會顯示出與這個單元格相關(guān)聯(lián)的數(shù)據(jù)庫數(shù)據(jù):
代碼如下:
C#
using DevExpress.XtraPivotGrid; private void pivotGridControl1_CellDoubleClick(object sender, PivotCellEventArgs e) { // Create a new form. Form form = new Form(); form.Text = "Records"; // Place a DataGrid control on the form. DataGrid grid = new DataGrid(); grid.Parent = form; grid.Dock = DockStyle.Fill; // Get the recrd set associated with the current cell and bind it to the grid. grid.DataSource = e.CreateDrillDownDataSource(); form.Bounds = new Rectangle(100, 100, 500, 400); // Display the form. form.ShowDialog(); form.Dispose(); }
VB
Imports DevExpress.XtraPivotGrid Private Sub pivotGridControl1_CellDoubleClick(ByVal sender As Object, _ ByVal e As PivotCellEventArgs) Handles pivotGridControl1.CellDoubleClick ' Create a new form. Dim form As Form = New Form form.Text = "Records" ' Place a DataGrid control on the form. Dim grid As DataGrid = New DataGrid grid.Parent = form grid.Dock = DockStyle.Fill ' Get the recrd set associated with the current cell and bind it to the grid. grid.DataSource = e.CreateDrillDownDataSource() form.Bounds = New Rectangle(100, 100, 500, 400) ' Display the form. form.ShowDialog() form.Dispose() End Sub
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)