Guest Alexander Pavlo Posted July 8, 2002 Posted July 8, 2002 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! Quote
Guest TheIrishCoder Posted July 8, 2002 Posted July 8, 2002 Just use the refresh method of the datagrid. Quote
Guest Alexander Pavlo Posted July 10, 2002 Posted July 10, 2002 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....:( Quote
Guest Alexander Pavlo Posted July 10, 2002 Posted July 10, 2002 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... Quote
Guest TheIrishCoder Posted July 11, 2002 Posted July 11, 2002 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.