Solved

Help with unbounding a Grid

Posted on 2012-12-27
11
264 Views
Last Modified: 2012-12-28
Hello,

I am loading my grid with code in Part A, but when trying to save data entered in code in Part B I receive the following error:

Not supported when the grid is bound

on line: For x As Integer = 0 To C1NSN.Rows.Count - 1

How do you unbound the grid or fix this error?

Part A:

 Dim NSN As New DataSet
        NSN.ReadXml(Application.StartupPath + "\App_Data\Blank.xml")
        C1NSN.DataSource = NSN.Tables(0)



Part B:

    For x As Integer = 0 To C1NSN.Rows.Count - 1
                If CheckForNSNFix.Contains(C1NSN.Rows(x).ToString) Then
                    For Each xnLink As Xml.XmlNode In xdNSN.SelectNodes("/Root/NSNTable[NSN='" & C1NSN.Rows(x).ToString & "']")
                        NSN_ID = xnLink.SelectSingleNode("NSN_ID").InnerText
                        If NSN_ID <> "" Then
                            CD = NSN_ID
                            If u > 0 Then
                                num1 = num1 & "" & CD & ","
                            Else
                                num1 = CD & ","
                            End If
                            u = u + 1
                        End If
                    Next
                End If
            Next
0
Comment
Question by:vcharles
  • 6
  • 3
  • 2
11 Comments
 

Author Comment

by:vcharles
ID: 38726710
Help!
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38726735
Is C1NSN a DataGridView?
0
 

Author Comment

by:vcharles
ID: 38726765
C1NSN is from componentOne (TrueDBGrid), but I thinnk the solution for the DataGridView would also apply since they have many similar features.
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 38726776
They are different in this case. What happens if you change

For x As Integer = 0 To C1NSN.Rows.Count - 1

to

For x As Integer = 0 To C1NSN.RowCount
0
 

Author Comment

by:vcharles
ID: 38726789
Currently do not have access to my application, I will try it later and get back to you.
Thanks.
0
 

Author Comment

by:vcharles
ID: 38726950
Hi,
I still receive error message "Not supported when the Grid id bound"
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38727036
On same line?
0
 

Author Comment

by:vcharles
ID: 38727188
Yes.
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 38727908
If you step through the code, what is the value of C1NSN.Rows.Count?  Alternately, you could do something like...
     Dim x as Integer = C1NSN.Rows.Count
...to see the value
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 38727924
Also, what if you try:

   ...
     For x As Integer = 0 To C1NSN.Splits(0).Rows.Count - 1
   ...
0
 

Author Comment

by:vcharles
ID: 38728025
Hi,

Post with C1NSN.RowCount  works, modified to C1NSN.RowCount  - 1

Thank you for all you comments.

Victor
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question