Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
390
ColumnMove doesn't fire in Composit Control
posted

Hi!

I made a composite control with a WebGrid inside.
I registered some events in the "CreateChildControls()"-method:
    AddHandler grid.UpdateCell, AddressOf grid_UpdateCell
    AddHandler grid.ColumnMove, AddressOf grid_colMoved
    AddHandler grid.XmlHTTPRequest, AddressOf grid_XmlHTTPRequest
    AddHandler grid.InitializeDataSource, AddressOf grid_InitializeDataSource

And I activated the columnMoving:
    grid.DisplayLayout.AllowColumnMovingDefault = Infragistics.WebUI.UltraWebGrid.AllowColumnMoving.OnServer
    grid.DisplayLayout.AllowUpdateDefault = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes

The "CreateChildControls()" - method is called in the OnInit method:

    Protected Overrides Sub OnInit(ByVal e As EventArgs)
        Page.RegisterRequiresControlState(Me)
        CreateChildControls()
        MyBase.OnInit(e)
    End Sub

My problem is, that only the "grid_InitializeDataSource" - event is fired when I move columns or when I update a cell. I think the initialization of the grid is correct because both times, a postback is performed.

Any suggestions?

Regards, Philipp 

  • 390
    posted

    I found the solution: the event isn't fired because when it should be fired, the column does not exist. I think that's a bug in the Grid, because the workaround looks like this (in order of the fired events):

    createChildControls - method:
         initialize the grid...

    initializeDataSource - event:
         add Columns to the Grid

    columnMoved - event:
         code for the moved column

    prerender - event:
         bind the datasource to the grid

    As we see, we have two events for fetching the same data from the database.

    Regards, Philipp

    ----------------------------------------------------------- 

    Edit: it's not the same data,I have to build a part of the grid in the first (now wrong) way that the event is fired, and afterwards, I have to create it in the rigth way.