Changing DataSet Position from another Form 
Author Message
 Changing DataSet Position from another Form

To anyone that can help, I've now exhausted my help
resources and this is one of the last spots that I can
think of to get assistance on this issue.

I'm not sure if I'm just missing the obvious here, but
I'll lay out my problem:

What I have - A Visual Basic.NET (2003) project with a
MDI Container that contains a toolbar.  The toolbar has
four buttons on it Start, Previous, Next, and End.

Next I have a MDI Child that loads into this container
and contains a dataset with a variety of contextbinded
fields.

What I'm trying to do basically is change the position
(i.e. via clicking the next button) of the dataset. Now I
can do this easily if I create a button on the same child
form, in it calling this function:

    Public Sub func_nav_next()
        Me.BindingContext
(objds_main_data, "table1").Position = (Me.BindingContext
(objds_main_data, "table1").Position + 1)
    End Sub

However, when I try calling this same (public, shared)
function from the MDI Container, nothing happens.

Any ideas anyone?

Thank You for any help,
Jessee Holmes

Additional Information:

Just for information, I have made the forms available to
the entire project through this method so I can call
controls from one another.

Public Module globals

    Private g_mdi_child As frm_mdi_child
    Private g_mdi_parent As frm_mdi_parent

    Public Property frm_mdi_child() As frm_mdi_child
        Get
            If g_mdi_child Is Nothing Then
                g_mdi_child = New frm_mdi_child
            End If
            Return g_mdi_child
        End Get
        Set(ByVal Value As frm_mdi_child)
            g_mdi_child = Value
        End Set
    End Property

    Public Property frm_mdi_parent() As frm_mdi_parent
        Get
            If g_mdi_parent Is Nothing Then
                g_mdi_parent = New frm_mdi_parent
            End If
            Return g_mdi_parent
        End Get
        Set(ByVal Value As frm_mdi_parent)
            g_mdi_parent = Value
        End Set
    End Property

End Module



Mon, 14 Nov 2005 20:51:51 GMT  
 Changing DataSet Position from another Form
Jesee,

I have a question -   You say that Public Sub func_nav_next() function is
shared, public. If that function were shared, you would have received a
compile error because you are using "Me.BindingContext",  and "Me" can
never be accessed from within a shared function

Also, can you send more detailed code? Where do you access the properties
in the global module? I see that you are not setting the parent property of
 the mdi_child to the parent container.

I tried creating an MDI container with a child form bound to a dataset. I
added a button on the parent form and called the func_nav_next()  function
on the child form, and it seemed to work fine.

Regards,
Hema Nagarajan
VB .NET QA team

--------------------
| Content-Class: urn:content-classes:message


| Subject: Changing DataSet Position from another Form
| Date: Thu, 29 May 2003 05:51:51 -0700
| Lines: 72

| MIME-Version: 1.0
| Content-Type: text/plain;
|       charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcMl4RMekFzK+IYcR2iSxFK5XYbs+Q==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.languages.vb
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:110794
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| To anyone that can help, I've now exhausted my help
| resources and this is one of the last spots that I can
| think of to get assistance on this issue.
|
| I'm not sure if I'm just missing the obvious here, but
| I'll lay out my problem:
|
| What I have - A Visual Basic.NET (2003) project with a
| MDI Container that contains a toolbar.  The toolbar has
| four buttons on it Start, Previous, Next, and End.
|
| Next I have a MDI Child that loads into this container
| and contains a dataset with a variety of contextbinded
| fields.
|
| What I'm trying to do basically is change the position
| (i.e. via clicking the next button) of the dataset. Now I
| can do this easily if I create a button on the same child
| form, in it calling this function:
|
|     Public Sub func_nav_next()
|         Me.BindingContext
| (objds_main_data, "table1").Position = (Me.BindingContext
| (objds_main_data, "table1").Position + 1)
|     End Sub
|
| However, when I try calling this same (public, shared)
| function from the MDI Container, nothing happens.
|
| Any ideas anyone?
|
| Thank You for any help,
| Jessee Holmes
|
|
|
| Additional Information:
|
| Just for information, I have made the forms available to
| the entire project through this method so I can call
| controls from one another.
|
| Public Module globals
|
|     Private g_mdi_child As frm_mdi_child
|     Private g_mdi_parent As frm_mdi_parent
|
|     Public Property frm_mdi_child() As frm_mdi_child
|         Get
|             If g_mdi_child Is Nothing Then
|                 g_mdi_child = New frm_mdi_child
|             End If
|             Return g_mdi_child
|         End Get
|         Set(ByVal Value As frm_mdi_child)
|             g_mdi_child = Value
|         End Set
|     End Property
|
|     Public Property frm_mdi_parent() As frm_mdi_parent
|         Get
|             If g_mdi_parent Is Nothing Then
|                 g_mdi_parent = New frm_mdi_parent
|             End If
|             Return g_mdi_parent
|         End Get
|         Set(ByVal Value As frm_mdi_parent)
|             g_mdi_parent = Value
|         End Set
|     End Property
|
| End Module
|



Tue, 15 Nov 2005 05:03:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Adjust size and position of controls under the change of the Form size

2. Problem changing form position

3. Adjust size and position of controls under the change of the Form size

4. Change Position of a Form.Picture

5. Dataset and Combobox position are different ?

6. Cant set bindingcontext position past halfway through dataset?????

7. find and positioning dataset in a MSRDC Control

8. recordset record position change upon the Datacombo change...

9. recordset record position change upon the Datacombo change...

10. recordset record position change upon the Datacombo change...

11. Positioning Forms relative to other forms

12. Locking forms in a fixed position within an MDI form

 

 
Powered by phpBB® Forum Software