.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

multiple delete selected ListView items

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :WPF
 

Hi All

I have multiple delete selected ListView items. If I select last item with any other combination selected items except first item and click delete all items gone. If I didn't select last item or select any other items include first item in that case all selected items deleted like I expected. How to fix that problem?

Thanks.




View Complete Post


More Related Resource Links

Retaining the selection color(default blue Color) for the selected items in ListView when focus is l

  
I am having a Listview in a form. I have added items(images) to the Listview. When i select the item(Image) in the listview , the item(image) is selected with Default selection Color(Blue). In the same form i have other form added to its container.When i tried to click on the controls of other form, the default selection color(blue) is changing to Grey color. For the lisview i am using property HideSelection = false. How i could maintain the default selection color(blue) even in focus leave of listview? Can any one please suggest me a solution or give me a piece of code. Thanks in Advance, Kumar

Retaining the selection color(default blue Color) for the selected items in ListView when focus is l

  
I am having a Listview in a form. I have added items(images) to the Listview. When i select the item(Image) in the listview , the item(image) is selected with Default selection Color(Blue). In the same form i have other form added to its container.When i tried to click on the controls of other form, the default selection color(blue) is changing to Grey color. For the lisview i am using property HideSelection = false. How i could maintain the default selection color(blue) even in focus leave of listview? Can any one please suggest me a solution or give me a piece of code. Thanks in Advance, mskumar.mcp

delete selected rows from ListView

  

Hi All.

My ListView has chechbox column and I would like to select some rows in ListView and delete them by click Delete button. That is code of Delete procedure.

  Private Sub DeleteSvcButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles DeleteSvcButton.Click  
  If Not IsNothing(Me.ListView1.SelectedValue) Then
   If ListView1.SelectedItems.Count > 0 Then
    For i As Integer = 1 To ListView1.SelectedItems.Count
     Dim TestDataRow As System.Data.DataRowView
     TestDataRow = ListView1.SelectedItems(i - 1)
     Service_Id = Me.ListView1.SelectedValue
    

delete multiple selected rows

  

Hi All

I have a ListView that is bound to a dataset. The user has ability to select multiple rows. I would like when a button is clicked, delete all selected items. For that I use a loop but get error message: Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead. The code looks

If ListView1.SelectedItems.Count > 0 Then
  For i As Integer = ListView1.SelectedItems.Count - 1 To 0 Step -1
   ListView1.Items.Remove(ListView1.SelectedItems(i))
  Next
End If

The error message point to line ListView1.Items.Remove(ListView1.SelectedItems(i))

How to fix that problem. I will appreciate for sample.

Thanks.


delete multiple selection from ListView

  

Hi All

My ListView has CheckBox column to select ListView items. I don't use SelectionMode="Multiple". I would like to select multiple items and delete them by click button. For that I use a loop

If ListView1.SelectedItems.Count > 0 Then
  For i As Integer = ListView1.SelectedItems.Count - 1 To 0 Step -1
    Me.ListView1.SelectedItems.Remove(i)
  Next
End If

Me.ServiceTableAdapter.Update(Me.TestDataSet.Service)

When I select items and click Delete button nothing was deleted. How fix and get multiple delete items from ListView.

Thanks.


SP2010: Ribbon: Editing multiple selected items

  

Hi there, we're using the Issues Tracking lists for a number of projects in SP2010.  I've created a solution that adds a few buttons to the ribbon that allows the user to select a few items, and then click the button to do something that affects all of those items, for example, set the "Assigned To" field to a specific value.  Using the EnabledScript tag for CommandUIHandler for the button, I'm able to disable/enable the button so that it only works if at least one item is used.

Two questions:

1) I've read that it may be better to use a "delegate control" for this instead of using a CommandUIHandler since it's just intended to work on a list and not a site - is that the case (and if so, how is that accomplished?)

2) More importantly, how would I actually post back changes to each item that the user selected?  I was thinking of popping up a model dialog that had an Assigned To People Picker box in it with an OK/Cancel, but I'm not sure what to use to post back changes to each item.

Any help would be appreciated - thanks,

Dex


run workflow against multiple selected items

  

Just wondering why you can only fire a workflow against one item at a time.  I have certain library items I need to run the same workflow against, but I can't select the ones I want and run the workflow.  I have to run it on one item at a time.

I'm sure there's a reason for this, but I'd just like to know what the reason is.


How can I get a list of selected items from a multiple-selection box in Infopath 2007

  
I have an Infopath 2007 form with a multiple-selection box.  The form has a receive data connection to a Sharepoint custom list which shows software available to staff.  The form allows the user to select any number of items from the list of software.  I want to be able to show a summary list and more importantly print a summary of just the items from the list that were selected.  I want to be able to hand my IT person a list of the software that user needs installed.   I am trying to figure out how to get this summary list so it can be printed out.  Any help would be appreciated.
Renee Boyd

Configure BDC column to have multiple values selected

  

How do I Configure BDC column to have multiple values selected and make multiple entities data available in the same column.  Currently it supports only single value for an item.  This requirement is crucial need some solution immediately.


Delete list items en masse?

  
Is there a way to delete list items en masse from a SP list?  I am on MOSS 2007.  In order to use a particular site as a site template I had to save with content and I don't want the content.

How do you create a custom BDC data field that allows for multiple selected values?

  
I need help creating a custom data field using the BDC column as a base.  We need to allow for multiple selected values instead of just a single one.  I can't find anything on the net which shows how to do this.

Session State for Listview Items?

  
Hi, I have a listview control, in it each item will have a checklist eg - Pass / Fail which will then have a label displaying the selected value. I also have datapager wired up to the listview. When i toggle between the datapages and toggle back, any result previously submitted will be wiped. I am thinking i should be using session state to temporarily store then info, and then once the session is finished use a submit button to send all values and ids into an xml. 1. Is this the right way of approaching the situation? 2. How would i specify session state for listview items, eg would i angle it through a itemdatabound event or the application itself?   Any assistance and advice would be appreciated as i have only started looking at state management and xml storage.  

How to Delete from a SortedList using Listview Control

  
I'm new to Asp.net, and I looked at an example of using a listbox's selected index to delete from a sortedlist. I'd like to write something that would get the selected index from a different control, like a listview, and then delete from the sortedlist. I've read up on a few examples on how to bind data from a sortedlist to a listview, but I've not seen an example of how to get the index once the data is displayed! Can this be done? Thanks for any response!

using CDATA to delete items

  
Hi, I'm trying to use CDATA to mimic the contextual menu on sharepoint item, and I'm stuck in the delete process.  Can anyone tell me what's wrong with my delete URL call? (keep getting "Action cannot be completed" Error!) Thanks <HTML><![CDATA[<select  name="menu" onChange="location=this.options[this.selectedIndex].value;"> <option value="/sites/template/_vti_bin/owssvr.dll?CS=65001&Cmd=Delete&List=]]></HTML><ListProperty Select="Name" /><HTML><![CDATA[&ID=]]></HTML><Field Name="ID" /><HTML><![CDATA[&owsfileref=]]></HTML><Field Name="FileRef" /><HTML><![CDATA[&NextUsing=]]></HTML><Field Name="ows_Url" /><HTML><![CDATA[">Delete</option> </select></form>]]></HTML>

Receive/Delete Multiple FTP Files based on condition using SCRIPT(VB) TASK

  
I am trying to receive and delete multiple FTP files from a remote FTP server using Script task Below is the code   Dim FTPConnMgr As ConnectionManager FTPConnMgr = Dts.Connections("FTP Connection Manager") Dim FTPClientConn As FtpClientConnection = New FtpClientConnection(FTPConnMgr.AcquireConnection(Nothing)) Dim FileTimeStampNew As String = "20100913021807" Dim remoteFileNames(0) As String remoteFileNames(0) = Dts.Variables("FtpRemoteDirectory").Value & "*" & FileTimeStampNew & ".*" 'Below hardcoded FileName works good. But the problem is there are lots of file in the FTP folder that I dont want to receive 'remoteFileNames(0) = Dts.Variables("FtpRemoteDirectory").Value & "Company_alpha_Full_20100913021807.xml" Dim localPath As String = Dts.Variables("FtpLocalDirectory").Value FTPClientConn.Connect() FTPClientConn.ReceiveFiles(remoteFileNames, localPath, False, False) FTPClientConn.Close() Dts.TaskResult = ScriptResults.Success End Sub End Class If i specifically mention the RemotefileNames this works fine but, when I say *.* it executes succefully but doesn't receives the file. Please advice how to receive multiple file based on a variable BR, AWM

VS2008 and C#: How to create a short cut for a selected item in a ListView/TreeView ?

  
How to create a short cut for a selected item from a ListView/TreeView ? Is it possible to provide a smaple code ? Thanks,

External List - Access Selected Items

  
Hello, The situation;- An external list in SP 2010 from SQL A custom ribbon/button that calls via JS a Dialog box(Application page) and passes the selected items IDs Some code behind to process items after confirmation from user. Question is how to access the selected items in the code behind. As far as I can tell the JS 'getselecteditems' only returns the list ID, which in the case of a standard list is fine, but with an External list returns something like '_B00234' - how do I use this or how to return a more meaningfull ID? (I would rather work in my confort zone VB/C# than JS to process items) casey
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend