Custom webparts that look professional OOTB which has sort header and other reference links
Custom webpart which has sort header and other reference links
Hi the normal OOTB standard webparts to look at listitems look nice ie have nice header , the ability to sort from the headers. I want to incorporate this in my custom webpart based on custom list and also want the following
1. For a list item there is a workflow progress field , I want a hyperlink for the particular listitem. I see it points to wrkStat.aspx but how do i get the rest of the querystring has it says List=??????&WorkflowInstanceId=?????
2. For a list item I am reading it has the username column, it has a hyperlink userdisp.aspx?id=?????? , how do i get the ID of the person based on a user column.
3. I want a webpart which automatically refreshes say every 5mins
回答
Hi,
If I understand correctly, you need to display list-data similar to OOTB SharePoint UI, and SharePoint uses ListViewWebpart, however you can use SPGridView in your Custom webparts.
Look at these articles for SpGridView Development:
http://msdn.microsoft.com/en-us/library/bb466219.aspx
Also some explanation according to your question based on this control:
1. Sorting and menu field: With this control, you can easily achieve this with its AllowSorting property and SPMenuField creation, please take care “Add menu” section in this article.
2. Webpart auto refresh: Did you need to refresh the page or only this webpart?
This thread may give you help:
3. UserID: You can get it from SPFieldUserValue.User.ID property.
Like this:
----------------------------------------------------------
SPListItem userVal = properties.ListItem;
object userField = item["userValField "];
SPFieldUserValue u = new SPFieldUserValue(web, userField.ToString());
int id= u.User.Id
----------------------------------------------------------
Hope this can help.
Best Regards,
-Aaron
- 回答の候補に設定Kris Wagner - MCP, MCTS 2009年11月29日 3:21
- 回答としてマークAaron Han - MSFTモデレータ2009年12月4日 1:39
すべての返信
Hi,
If I understand correctly, you need to display list-data similar to OOTB SharePoint UI, and SharePoint uses ListViewWebpart, however you can use SPGridView in your Custom webparts.
Look at these articles for SpGridView Development:
http://msdn.microsoft.com/en-us/library/bb466219.aspx
Also some explanation according to your question based on this control:
1. Sorting and menu field: With this control, you can easily achieve this with its AllowSorting property and SPMenuField creation, please take care “Add menu” section in this article.
2. Webpart auto refresh: Did you need to refresh the page or only this webpart?
This thread may give you help:
3. UserID: You can get it from SPFieldUserValue.User.ID property.
Like this:
----------------------------------------------------------
SPListItem userVal = properties.ListItem;
object userField = item["userValField "];
SPFieldUserValue u = new SPFieldUserValue(web, userField.ToString());
int id= u.User.Id
----------------------------------------------------------
Hope this can help.
Best Regards,
-Aaron
- 回答の候補に設定Kris Wagner - MCP, MCTS 2009年11月29日 3:21
- 回答としてマークAaron Han - MSFTモデレータ2009年12月4日 1:39