Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Select more than one item in list

  Asked By: Judson    Date: Mar 06    Category: Sharepoint    Views: 1951

I must select in SharePoint list more than one item, then give some data from this items to InfoPath form (in other SP list) and run workflow with this form.

But I don´t see any possibility to select multiple items in SharePoint list / library (I mean user selecting in GUI) (something like www.codeproject.com/.../Multi-select_Dataagrid.asp , but in SharePoint environment, with SP list / library).

How can I do this in SP? I must prepare some more general solution, not for only one list.

I thought that I will make ASP page, which will read actual content, filter and columns from actual view of list, and I will render this page to SharePoint. But this is maybe very complicated solution (hard work-around) and I don´t know if it´s possible to make my whole solution with this approach.



Did someone try this before? Could you help me, please?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Ivette Burris     Answered On: Mar 06

You can add CheckBox in SPGridView as follows:



<SharePointPGridView
id="GridViewItemList"
runat="server"
AutoGenerateColumns="false"
AllowSorting="true"
AllowGroupCollapse="true"
AllowPaging="true"
AllowFiltering="true"
FilterDataFields=",Name,Status"
FilteredDataSourcePropertyName="FilterExpression"
FilteredDataSourcePropertyFormat="{1} = '{0}'"
PageSize="10"
EmptyDataText="No Data Found"
>
<Columns>
<asp:TemplateField ItemStyle-CssClass="ms-cbp" ItemStyle-VerticalAlign="Top" ItemStyle-Width="20px">
<HeaderTemplate>
<INPUT type="checkbox" name=selectall style="margin-top:-1px; margin-bottom:-1px;" onClick="SelectAll();" id="idSelectAll" title="Select All">
</HeaderTemplate>
<ItemTemplate>
<INPUT type="checkbox" name=templateIds class="padding-right: 15px;padding-top: 0px;padding-bottom: 0px" value="<%# SPHttpUtility.HtmlEncode((string)DataBinder.Eval(Container.DataItem, "GUID")) %>"
onClick="document.forms.<%=Form.ClientID%>.selectall.checked=false;"
title="<%# SPHttpUtility.HtmlEncode(((string)DataBinder.Eval(Container.DataItem, "Name"))) %>">
<INPUT type="hidden" name=ListGUID value="<%# SPHttpUtility.UrlKeyValueEncode((string)DataBinder.Eval(Container.DataItem, "GUID")) %>">
</ItemTemplate>
</asp:TemplateField>
<SharePointPMenuField
ItemStyle-Width="200px"
HeaderText="Alert Template Name"
MenuTemplateId="AlertContextMenu"
TextFields="Name"
SortExpression="Name"
TokenNameAndValueFields="GUID=GUID">
</SharePointPMenuField>
<asp:TemplateField
ItemStyle-Width="100px"
HeaderText="Status"
SortExpression="Status">
<ItemTemplate>
<%# SPHttpUtility.HtmlEncode(DataBinder.Eval(Container.DataItem, "Status").ToString())%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField
HeaderText=""
Visible=false
DataField=GUID
>
</asp:BoundField>
</Columns>
</SharePointPGridView>

<SharePoint:MenuTemplate runat="server" id="AlertContextMenu">
<SharePoint:MenuItemTemplate runat="server" id="AttachCustomAlertHandler" Text="Attach custom alert handler" />
<!--<SharePoint:MenuSeparatorTemplate id="MenuSeparator1" runat="server" />-->
<SharePoint:MenuItemTemplate runat="server" id="DetachCustomAlertHandler" Text="Detach custom alert handler"/>
</SharePoint:MenuTemplate>

 
Didn't find what you were looking for? Find more on Select more than one item in list Or get search suggestion and latest updates.




Tagged: