locked
access the gridview of the grid control RRS feed

  • Question

  • Hi all

    It may seem a weird title, but this is exactly my problem.

    I am using winforms with devexpress tool in my application. I want to access the selected row of a grid view from another form. so I used the following code:

    foreach (XtraUserControl usrControl in splitContainerControl.Panel2.Controls)
                {
                    if (usrControl is MY_USER_CONTROL_NAME)
                    {
                        foreach (Control grid_control in usrControl.Controls)
                        {
                            if (grid_control is GridControl)
                            {

                                //up to this point i must be able to access the grid control, and after that access the grid view by using

                                //the following statement as I found in other forum

                                GridView myView = grid_control.ViewCollection[0] as GridView;

                            }

                        }

                   }

               }

    the problem is I cannot get this ViewCollection[] property of the grid control

    any help???

    • Moved by Carl Cai Thursday, December 11, 2014 8:38 AM more related to suggested forum
    Wednesday, December 10, 2014 12:15 PM

Answers