﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » DataGridView refresh problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 29 May 2026 19:18:44 GMT</lastBuildDate><ttl>20</ttl><item><title>DataGridView refresh problem</title><link>http://forum.strataframe.net/FindPost23327.aspx</link><description>I have a Refresh or Display problem with a DataGridView control.  The control is in a ChildForm, and the first time I open the child form "MyChildFormDialog.ShowDialog()" will show all the records in the datagridview, but if I cancel this childform, and open it again, the datagridview will have all records but only the first one will be displayed, if I scroll down then the rest of the rows will be shown.&lt;br&gt;
&lt;br&gt;
Please see the attached video to better understanding of the problem.&lt;br&gt;
&lt;br&gt;
Here is the call to Show the childform:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
 Private Sub cmdAddCards_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddCards.Click&lt;br&gt;
        Me.BizTransactionItems1.SaveCurrentDataTableToSnapshot("CardToBeActivated")&lt;br&gt;
        If Me.ChildFormDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then&lt;br&gt;
            Me.ListView1.Requery()&lt;br&gt;
        Else&lt;br&gt;
            Me.BizTransactionItems1.RestoreCurrentDataTableSnapshot("CardToBeActivated", True)&lt;br&gt;
        End If&lt;br&gt;
    End Sub&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Here is the code to populate the datagridview:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
    Private Sub GetAvailableInactiveCards()&lt;br&gt;
        '-- Get the available Inactive Cards&lt;br&gt;
        If Me.BizTransaction1.Count &gt; 0 Then&lt;br&gt;
            Me.BizTransactionItemsStock1.FillByActiveCarrier_ITemType_And_Item(Me.BizTransaction1.FK_Vendor_Carrier, Me.cboCardName.SelectedValue)&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
        Me.DataGridView1.Refresh()&lt;br&gt;
        &lt;br&gt;
        Me.ShowInactiveStockQtyValue()&lt;br&gt;
        Me.SetObjectStateForButtons()&lt;br&gt;
&lt;br&gt;
        Me.txtQty.Focus()&lt;br&gt;
        Me.txtQty.SelectAll()&lt;br&gt;
    End Sub&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Here is the call to Cancel and close the child form:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
Private Sub cmdCancelActivation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancelActivation.Click&lt;br&gt;
        Me.BizTransactionItemsStock_To_Activate.Clear()&lt;br&gt;
        Me.BizTransactionItemsStock1.Clear()&lt;br&gt;
&lt;br&gt;
        DialogResult = Windows.Forms.DialogResult.Cancel&lt;br&gt;
    End Sub&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
All this is basic stuff, I have done this many times with a ListView without problems, but frankly working with a DataGridView is turning out to be a very unpleasant experience.&lt;br&gt;
&lt;br&gt;
Any idea what may be happening here?</description><pubDate>Thu, 04 Jun 2009 10:00:30 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: DataGridView refresh problem</title><link>http://forum.strataframe.net/FindPost23347.aspx</link><description>LOL...I have been there before my friend! :D</description><pubDate>Thu, 04 Jun 2009 10:00:30 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DataGridView refresh problem</title><link>http://forum.strataframe.net/FindPost23345.aspx</link><description>[quote][b]Trent L. Taylor (06/03/2009)[/b][hr]...but at some point they always make me want to cuss![/quote]&lt;br&gt;
Well, I don't usually give up on these sort of things, but due to the highly pressure of this project and all the time wasted trying to get the datagridview to work, I took a deep breath and review my approach and there it was the answer to my prayers :) "use a listview with a childform dialog", even though I believe a grid would have done more sense for the end user, the simplicity of using a listview and a childform dialog provides much more control on how to handle the data validations.&lt;br&gt;
&lt;br&gt;
I will retake the datagridview issue when I have more time to spend, and probably at that time, MS may have a new, better version of this control.:hehe:</description><pubDate>Thu, 04 Jun 2009 09:43:10 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: DataGridView refresh problem</title><link>http://forum.strataframe.net/FindPost23330.aspx</link><description>Yeah...this is one reason I am not much of a grid fan....they are not always THIS irritating...but at some point they always make me want to cuss!</description><pubDate>Wed, 03 Jun 2009 11:04:50 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DataGridView refresh problem</title><link>http://forum.strataframe.net/FindPost23329.aspx</link><description>Thanks Trent.&lt;br&gt;
&lt;br&gt;
Frustration levels are getting to the top on my side with the DataGridView control, all these problems are really holding me up in moving forward with this project.  I'll try to duplicate this in the Business Binding Source Sample project.&lt;br&gt;
&lt;br&gt;
Did you look at the video I uploaded in my previous post?  This refresh thing is very strange.</description><pubDate>Wed, 03 Jun 2009 11:03:26 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: DataGridView refresh problem</title><link>http://forum.strataframe.net/FindPost23328.aspx</link><description>Edhy....there is no way for me to give you a straigh answer without having something that reproduces this.  I would really love to tell you to "flip this switch" but there are too many things in the mix at this point.  It is possible for you to reproduce this somehow?</description><pubDate>Wed, 03 Jun 2009 10:58:48 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>