簡體   English   中英

自定義WebPart和C#中的SharePoint列表控件

[英]SharePoint List Control in a custom WebPart and C#

所有,

我試圖用Visual Studio 2010 C#中的SPList控件替換我擁有的DataGrid,但是此控件在哪里存在,如何使用它?

有例子嗎?

法案。

沒有SPList控件, SPList是一個類。

您正在談論的是ListViewWebPart ,這是一個用於顯示列表的Web部件。 這是SharePoint使用的。

您可以按照此處所述動態使用它:
http://weblogs.asp.net/jan/archive/2005/06/22/414283.aspx

也許您的意思是SPGridView控件。 這里有一個SharePoint 2007的示例: http : //blogs.msdn.com/b/powlo/archive/2007/02/25/displaying-custom-data-through-sharepoint-lists-using-spgridview-and-spmenufield。 aspx

我尚未在SP2010中使用它,但我想它仍然存在,並且大致相同。

有很多選擇:

  • 使用共享點設計器“設計”您的Web部件(用於通常基於DataFormWebPart或SP2010中的XsltListViewWebPart的數據)。 完成后,導出.webpart文件並將其導入到sharepoint。

  • 在Visual Studio 2010中,創建一個可視Web部件,並在其上使用標准ASP.NET ListView或GridView。

  • 在Visual Studio中,對Web部件進行編程,並重寫CreateChildControls方法,並通過代碼添加SPGridView,ListViewWebPart等。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM