Find and remove items from Datagridview

Posted on 2011-10-14
Last Modified: 2012-05-12
Is it possible to search for a specific text in a colum / row and then remove it automatically without any additional buttons. Please provide novice instructions or code help thanks.
Question by:Jack_Jones
    LVL 19

    Expert Comment

    by:Shahan Ayyub

    Do you wish to remove the whole row(if text found in row(or cell of a row)) or emptied the cell(if found in the cell) ?

    Also are you using bound datagridview ?
    LVL 1

    Author Comment

    it's a bound datagridview, and the whole row would be deleted. Bound by the datagridview receives it's data from a database.
    LVL 83

    Accepted Solution


    reportData.DefaultView.RowFilter = "Description='" & txtDescription.Text & "'"
    if reportData.DefaultView.Count = 1 Then
    End If
    LVL 1

    Author Closing Comment

    Thank you CodeCruiser ;)

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    A short article about a problem I had getting the GPS LocationListener working.
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now