Forum  General Visual ...  Visual WebGui v...  DataGridView error
Previous Previous
 
Next Next
New Post 12/27/2011 12:06 PM
Unresolved
  dleland
627 posts
www.kadant.com
1st Level Poster


DataGridView error 
Modified By dleland  on 12/27/2011 4:07:47 PM)

We fill all of our DataGridViews programmatically.  In a number of cases, I retrieve a value from some of the cells of the DataGridView immediately after populating it - before it is actually shown to the user.  In 6.3.15, I would sometimes use the following code to retrieve the value:

Dim strValue as String = DataGridView1("FieldName", 1).Value.ToString

In .NetHTML 6.4 Beta2b, this doesn't work if the DataGridView has more than 2 rows and you are attempting to retrieve the value from a row with an index greater than 1.  I get the following error message:

"Specified argument was out of the range of valid values. Parameter name: rowIndex"

If you attempt to retrieve the cell value after the populated DataGridView is shown to the user, the error doesn't occur.  It only occurs if you attempt to get the value immediately after populating the grid.

Dave (VS 2010, VB, .NetHTML 6.4 Beta2b)

 
New Post 12/30/2011 11:37 AM
  palli
14295 posts
1st Level Poster




Re: DataGridView error 

Hi Dave,

I will need a sample code in order to reproduce this, as I am unable to reproduce myself using the following code:

 

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DataGridView1.Columns.Add("FirstCol", "First")
        DataGridView1.Columns.Add("SecondCol", "Second")
 
        For i As Integer = 1 To 10
            DataGridView1.Rows.Add(i.ToString(), i.ToString())
        Next
 
        TextBox1.Text = ""
        For i As Integer = 0 To 9
            TextBox1.Text += "Row " + i.ToString() + " Value " + _
                DataGridView1("FirstCol", i).Value.ToString() + Environment.NewLine()
        Next
    End Sub

I tested in the upcoming 6.4.0 Release d QA16 WinWeb, as well as Beta2b .NETHTML5, and neither version had any problems in IE9.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 12/30/2011 12:00 PM
  dleland
627 posts
www.kadant.com
1st Level Poster


Re: DataGridView error 

I have sent a sample application that will show the error.  Please note that you will need to change the SQL Server Database in the program to one that you have access to.  The program doesn't actually read anything from any tables in the database though.

Dave
 

 
New Post 12/31/2011 3:19 AM
  palli
14295 posts
1st Level Poster




Re: DataGridView error 

Hi Dave,

Thanks for the sample application, which once more turned out to be vital as I clearly misunderstood what you meant by populating your DataGridView manually.

I did confirm your problem and opened a new tracker entry on the subject. Please view it here and follow up on our progress. Please make sure you view the suggested workaround.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 12/31/2011 9:23 AM
  dleland
627 posts
www.kadant.com
1st Level Poster


Re: DataGridView error 

Thanks Palli.  We'll use the workaround as we only have this type of coding in a few places in our application.

Dave

 
Previous Previous
 
Next Next
  Forum  General Visual ...  Visual WebGui v...  DataGridView error
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS