Current filter:
                                You should refresh the page.
                                  • Hello DevExpress,

                                    Im trying to implement a button to reset mine Layout configuration in GridView(TerminlisteCollectionView) and LayoutControl, using button inside GridView and call Sub in MainView to reset LayoutControl. Both are inside MainView.

                                    Here is my code (for example I just want to show MessageBox):

                                    [VB.NET]
                                    MainView.vb #Region " Events " Friend WithEvents WerkeinstellungenEvent As Terminliste.Views.TerminlisteCollectionView.TerminlisteCollectionView #End Region #Region " Werkeinstellungen " ''' ''' Default Layout settings for Kopfzeile ''' Public Sub Kopfzeile_Werkseinstellungen() Handles WerkseinstellungenEvent.KopfzeileWerkseinstellungen MessageBox.Show("Test") End Sub #End Region TerminlsiteCollectionVIew.vb #Region " Events " Friend Event KopfzeileWerkseinstellungen() #End Region #Region " Werkseinstellungen " Private Sub WerkseinstellungButton_ItemClick(sender As Object, e As ItemClickEventArgs) Handles WerkseinstellungButton.ItemClick RaiseEvent KopfzeileWerkseinstellungen() End Sub #End Region

                                    While debugging I can see, that code is working till RaiseEvent.
                                    Is there any restricted functionality in MVVM Project?

                                Show all comments
                                • Nadezhda (DevExpress Support) 12.02.2019

                                  Hello,

                                  Our MVVM Framework does not have specific restrictions for the use of standard approaches. So, raising the event should work in this case. However, if you are using this framework in your application, I suggest you use MVVM Behaviors to achieve this goal.
                                  For example, if you wish to call your method from your ViewModel when a specific event is raised in your View, you can use the approach from the Event-To-Command section in the article.
                                  If it does not help, please share a project to illustrate your scenario. Also, specify your Model-View-ViewModel structure.

                                • Ilja Grebel 12.02.2019

                                  What is the different though Event-To-Command  and standart VB.NET WithEvent/RaiseEvent?

                                  Can you look at this project to tell me, why WithEvent /RaiseEvent isnt working?

                                • Nadezhda (DevExpress Support) 12.03.2019

                                  Hello,

                                  When I run your project, the following exception is thrown:
                                  "An error occurred creating the form. See Exception.InnerException for details. The error is: Login failed for user ''.".
                                  So, I was able to reproduce the issue on my side. Could you localize this behavior in a simple project? For this, you can copy your real application and remove all unnecessary forms from it. It will be enough if you create custom fake data to bind it to controls as described in the How to investigate the issue and determine why it occurs in your project thread.
                                  As for the MVVM approach, it allows organizing the separation of layers and data binding in an application. In this case, you can change your view on fly without changing the other layers. So, if you wish to show the message box in one view when you click the button in a separate view as shown in your project, you can utilize Messenger.

                                • Ilja Grebel 12.03.2019

                                  Hello Nadezhda,

                                  my messagebox is only for testing if the event is working or not. You dont need any data for testing this event and see the issue.

                                  I upload the new example. The button which you need is "Werkseinstellungen"

                                • Nadezhda (DevExpress Support) 12.04.2019

                                  I removed all our controls from your project. However, the event is not raised if I execute the following line in any case:

                                  [VB.NET]
                                  RaiseEvent KopfzeileWerkseinstellungen()

                                  Please make sure that you perform all the steps to handle an event from another class as described in the RaiseEvent Statement article.
                                  As for the MVVM approach, I will be happy to find an appropriate solution for you. Could you please describe why you need to raise an event in the main form? Do you wish to pass data between your UserControl and the main form? If so, how will you use it?

                                • Ilja Grebel 12.04.2019

                                  Hello Nadezhda,

                                  I have a button inside TerminlisteCollectionView - called WerkseinstellungButton_ItemClick, after press the button, it should save the XML-Layout from TerminlisteCollectionView and LayoutControl1 inside MainView.

                                  The stept to handle an event from another class are correct.dieser knopf,this button,
                                  Detected language : English

                                • Ilja Grebel 12.04.2019

                                  Please use the example from yesterday. I deleted all connections, so you should be able to test it.

                                • Nadezhda (DevExpress Support) 12.05.2019

                                  Thank you for the clarification. In this case, I suggest you create a public method that executes your code. After that, you can call it inside your UserControl. I have modified your project to illustrates this approach.
                                  As for the RaiseEvent statement, the project from my previous reply demonstrates that this statement does not raise the event without our components either.

                                0 Solutions

                                Creation Date Importance Sort by