In VB 2005, I am trying to reset a datagridview to its original state (as in..completely filled with all data).
When the form loads, the datagridview is completely filled, however, after using a rowfilter, I would like to be able to reset the datagridview back to its original state.
This one has me stumped. If anyone could provide some assistance, I would definately appreciate it. It seems like it should be something relatively easy, but it has got me at a standstill.
Thanks in advance.
7 4994
Use the New keyword to assign and new (i.e. empty) datagridview to the variable.
Use the New keyword to assign and new (i.e. empty) datagridview to the variable.
I am not completely sure as to what you mean by that.
Here is a small segment of my code. Where would i be assigning a New DataGridView? I tried a few different things with it, but nothing worked. Any ideas? - Dim myView As DataView
-
myView = CardsDataSet.Tables(0).DefaultView
-
Sub BookSearch()
-
-
strBook = txtBook.Text
-
-
'Book Location search and all other possibilities
-
If filBook = "1" Then
-
myView.RowFilter = "[Book Location] ='" & strBook & "'"
-
cardsDG.DataSource = myView
-
End If
-
End Sub
-
If I understand you correctly, you are trying to get myView to be empty again.
To do this, you would put this where you want to clear it:
If I understand you correctly, you are trying to get myView to be empty again.
To do this, you would put this where you want to clear it:
Oh. No, I actually want myView to display all of the records...not none of the records.
And by the way, thank you for replying to this.
Oh. No, I actually want myView to display all of the records...not none of the records.
And by the way, thank you for replying to this.
I am not familiar with the rowfilter construct, but I imagine if you set it to it's original value, you would have the entire dataset again.
Sorry I couldn't be more help...If this doesn't work let me know, and I'll make some more stuff up :D
I am not familiar with the rowfilter construct, but I imagine if you set it to it's original value, you would have the entire dataset again.
Sorry I couldn't be more help...If this doesn't work let me know, and I'll make some more stuff up :D
haha. I can't figure out how to set it to its original value. I have tried just about everything i can think of to reset this and searched all over the internet trying to get ideas and I can't find a thing.
So, if you could make some stuff up, that would be great! Thanks anyhow.
Store the rowfilter value before you set it, then restore it. Hehe.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Michael Beatty |
last post by:
In my application the accept and cancel buttons change depending on which
panels are visible, my question is how do I reset the cancel button to
"(none)" property.
to change the buttons I use -...
|
by: DraguVaso |
last post by:
Hi,
I'm using the DataGridView in VB.NET 2.0. The DataSource is a Generic List
of a custom class0: lstMyPersonnes = New List(Of clsPersonne).
When I add a new clsPersonne to lstMyPersonnes,...
|
by: dbuchanan |
last post by:
Hello,
Is this a bug?
Is there some kind of work around?
I want to add default values for a few columns in my datagridview
I found the "DefaultValuesNeeded" event for the datagridview
I...
|
by: dm1608 |
last post by:
Hello, I have a DataGridView control in VB.NET 2005 that I would like to
iterate thru row by row and parse out the individual columns into variables.
Can someone provide me example code or direct...
|
by: Eric Fortin |
last post by:
I have a DataGridView that I bind to a dataset at runtime (I do not set up
the data grid view for binding to that specific dataset at design time) and
I want to save the manually resized column...
|
by: Bob |
last post by:
How do I show a calendar control or another appropriate control to pick a
date and time for a cell in a column in a datagridview?
Thanks for any help.
Bob
|
by: |
last post by:
I am sure this has been asked and answered, but here goes anyway...
VS.Net 2005, VB.Net
How can you display more than one field in the displaymember property of a
combobox inside the...
|
by: Karl |
last post by:
Hi all...
This is a good one. You'll like this...
I am working on a course management tool that allows certain Courses
to be cross referenced with Job Roles and, when they are, whether the...
|
by: snowdog17 |
last post by:
Hello,
I am a student and I need help with my VB task. I am currently using VB 2005 Express and I am fairly new to it, although I have programed in Delphi before....
|
by: Gail248 |
last post by:
I have a datagridview that I am using for filling in the detail of an Invoice. So each row has Item, Quantity, Price.
I want to prevent the user from adding new rows if the Quantity and Price...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |