DataGrid Resetting

  • Thread starter Thread starter Alexander Pavlo
  • Start date Start date
A

Alexander Pavlo

Guest
Hi All !

I'm developing a wizard that would be the easiest way for the user to create the SQL query and then it'd populate the DataGrid with it.

Here is my problem:
I'm using DataTable as a .DataSource to bind a data to the DataGrid. It works just fine but the user may remove all the tables from the query and then I'd have to show the empty DataGrid (without any traces of the previous queries). I do that by setting the empty DataTable to the .DataSource of my DataGrid. It shows me the empty DataGrid but it keeps the ScrolBars from the old query.

How can I remove that scrols or how do I bind the empty .DataSource to the DataGrid in my case?

Thanks!
 
Refreshing the DataGrid

Hi All!

I work in VB.NET
I've got a problem doing .Refresh method of the DataGrid.

I have a TabControl.
I need to .Refresh my DatGrid wich is on the third TabPage but showing the first TabPage on the top at the same time.

As I noticed DataGrid.Refresh works only if the user can see the DataGrid but if it's hiden behind some other TabPage-s it's not being .Refresh-ed.

Does anybody know how to do it being on the first TabPage ???

I've been trying to bind the empty DataTable but it didn't work out....:(
 
That's exactly the problem I've got !

I use .Refresh method but my DataGrid is on my third TabPage and I want to .Refresh it being on the first TabPage.

.Refresh does work only if the DatGrid is visible to the user, if it can be repainted... the trace from previous work (like scrollbars) is still in my "hidden" DataGrid...
 
Theres bound to be a better way but couldn't you switch to the relevent tab, refresh and then go back to the tab it was on, assuming you have set a reference to the tab it was on. I don't know how visible/naff this would look though.
 
Back
Top