Jump to content
Xtreme .Net Talk

DataGrid Resetting


Recommended Posts

Guest Alexander Pavlo
Posted

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!

Guest TheIrishCoder
Posted
Just use the refresh method of the datagrid.
Guest Alexander Pavlo
Posted

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....:(

Guest Alexander Pavlo
Posted

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...

Guest TheIrishCoder
Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...