I can't get the GridPanel SelectedRow from an ascx control loaded dynamically

  1. #1

    I can't get the GridPanel SelectedRow from an ascx control loaded dynamically

    Hi EveryBody
    I have a main page that load dynamically an ascx control which contain a grid.
    I have a button designed to edit a Row line by DirectClick Event. The event is fired but I can't get GridPanel SelectedRow. The followed lines throw an error.
    RowSelectionModel sm = this.GridPanel1.GetSelectionModel() as RowSelectionModel;
    SelectedRow rowSelected = sm.SelectedRows[0];
    eg. In OnInit method of the main page i load the ascx control.
    Attached Files
    Last edited by Daniil; Apr 02, 2013 at 5:01 AM. Reason: Please use [CODE] tags
  2. #2
    Hi @perfexion,

    Welcome to the forums!

    Please post the example directly here wrapping in code tags. Also please put the code behind directly to the ASPX and ASCX wrapping in:
    <script runat="server">
        ...
    </script>
    See also
    Forum Guidelines For Posting New Topics

Similar Threads

  1. Replies: 1
    Last Post: Oct 10, 2012, 11:47 AM
  2. Replies: 2
    Last Post: Dec 08, 2011, 1:00 PM
  3. [CLOSED] How to make web user control (ascx) appear as an ext control
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 11, 2010, 9:23 AM
  4. Replies: 3
    Last Post: Mar 30, 2010, 1:03 PM
  5. ascx control
    By maxdiable in forum 1.x Help
    Replies: 0
    Last Post: Jul 07, 2009, 5:42 AM

Tags for this Thread

Posting Permissions