Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6467809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:49:51+00:00 2026-05-25T05:49:51+00:00

How can I clear data in a GridView? is appeared GridView1.DataSource = null; GridView1.DataBind();

  • 0

How can I clear data in a GridView? is appeared

     GridView1.DataSource = null;
     GridView1.DataBind();

I want to Know difference of

     GridView1.Clear();

two function of GridView1.Clear() and GridView1.DataSource = null.I have no error which clear of syntax of GridView1.Clear().

Public Sub Clear()
    Data.Dispose()
    Data = New DataSet
    MyBase.DataSource = Nothing
End Sub

I wrote new class of gridview Inherits System.Windows.Forms.DataGridView.Vb class called my clear function in its class.Sorry,gridview.Clear() is not have.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T05:49:52+00:00Added an answer on May 25, 2026 at 5:49 am

    I don’t see any Clear() method listed for GridView Methods.

    If you want to clear the current rows in a GridView, the answer you linked to above is the way to do it:

    'VB.NET
    GridView1.DataSource = Nothing
    GridView1.DataBind()
    
    //C#
    GridView1.DataSource = null;
    GridView1.DataBind();
    

    If the above isn’t working for you, please update your question with the code and what error, if any, you’re seeing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know you can clear options by doing the following: dropDownList.options.length = 0; Is
I hope I can make myself clear in English and in what I want
in my application im exporting gridview data to excel sheet now i want save
I have built a dynamic gridview using the following code grdVariants.Columns.Clear(); int i =
I have data source and table that I can bind to my controls and
I have a DataGridView with two DataGridViewComboBoxColumns. I want to use the selected item
I have an asp.net form . In this form I want to clear all
I have implement functionality for exporting data from gridview to excel sheet in .net
How can i clean and modify data from a form in django. I would
I can make a DAO recordset in VB6/Access do anything - add data, clean

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.