2011-04-05 63 views
0

我有一個gridview,我想總結一下數據,我發現一些代碼可以幫助我在以下網站上做到這一點:http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm當我使用VB.Net時,GridViewHelper無法在VS 2010中識別

事情是,當我試圖轉換並在我的程序中使用它,GridViewHelper只是拒絕被識別,所以,現在我卡住了。請讓我知道在VB中實現相同的正確過程。謝謝!

+1

你得到了什麼錯誤?我無法理解你的意思,「GridViewHelper只是拒絕被識別」 – Anuraj 2011-04-05 04:57:47

+0

請顯示你的代碼。 – naveen 2011-04-05 04:59:21

+0

@Anuraj,@yetanothercoder:以下是我使用過的代碼,每一行都加下劃線,錯誤是「未定義」或「不是成員」錯誤。 '公用Sub GridViewHelper(BYVAL GRD作爲GridView中,BYVAL useFooterForGeneralSummaries由於布爾,BYVAL groupSortDirection作爲SortDirection) Me.mGrid = GRD Me.useFooter = useFooterForGeneralSummaries Me.groupSortDir = groupSortDirection Me.mGeneralSummaries =新GridViewSummaryList() 我。 mGroups =新的GridViewGroupList() Me.mGrid.RowDataBound + =新的GridViewRowEventHandler(RowDataBoundHandler) End Sub' – CodingInCircles 2011-04-05 05:13:38

回答

0

這看起來像轉換器有一些問題。嘗試重命名方法

Public Sub GridViewHelper(ByVal grd As GridView, ByVal useFooterForGeneralSummaries As Boolean, ByVal groupSortDirection As SortDirection) 

像下面

Public Sub New(ByVal grd As GridView, ByVal useFooterForGeneralSummaries As Boolean, ByVal groupSortDirection As SortDirection) 

因爲在C#構造函數是類的名字本身,而是在VB.Net其唯一新。

+0

更改您的用戶名呃?轉換器確實說了新的,但是當這不起作用時,我嘗試了GridViewHelper,這也不起作用。沒有什麼是。該怎麼辦? – CodingInCircles 2011-04-05 06:18:05

+0

我沒有改變它。但一切看起來都對我好。 – Anuraj 2011-04-05 06:24:39

+0

那麼會有什麼問題?我應該添加一個參考或其他東西? – CodingInCircles 2011-04-05 06:53:17

相關問題