DataGrid Resetting

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

Alexander Pavlo

Guest
Hi All !

Im developing a wizard that would be the easiest way for the user to create the SQL query and then itd populate the DataGrid with it.

Here is my problem:
Im 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 Id 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
Ive 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 its hiden behind some other TabPage-s its not being .Refresh-ed.

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

Ive been trying to bind the empty DataTable but it didnt work out....:(
 
Thats exactly the problem Ive 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 couldnt 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 dont know how visible/naff this would look though.
 
Back
Top