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
545
CellSelectionChanged Event
posted

I'm working on setting up a datagridview that will display customer information and once the user selects a row it will modify the textboxes in the lower portion of the page and display the information for editing. Right now when the page loads the event fires correctly and everything but the event argument being sent to the server doesn't contain any members in the CurrentSelectedCells collection After the first time that the event is triggered.

So it loads, you can click on a row once then if you try clicking on another row it throws an object reference set to nothing error.

When i watch the event arguments, the first time through everything is set, currentselectedcell and previousselectedcells. The second time the currentselectedcell collection says it has one member but it is set to nothing.

Parents
No Data
Reply
  • 545
    posted

     

    Datagrid Definition:

    <ig:WebDataGrid ID="Panel1" runat="server" Height="200px" Width="100%"

     

    Visible="False" EnableDataViewState="True" AutoGenerateColumns="False" EnableAjax="false" CellSelectionChanged="Panel1_CellSelectionChanged">

     

    <Behaviors>

     

    <ig:Selection RowSelectType="Single" Enabled="True" CellSelectType="Single" ColumnSelectType="None" >

     

    <SelectionClientEvents CellSelectionChanged="Panel1_CellSelectionChanged"/>

     

    </ig:Selection>

     

    <ig:RowSelectors RowNumbering="True" Enabled="True" />

     

    <ig:Paging PagerAppearance="Bottom" PageSize="10" Enabled="True" />

     

    </Behaviors>

     

    </ig:WebDataGrid>

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

    Script to handle the event firing, mimicked from online samples:

     

    <script type="text/javascript">

     

    function Panel1_CellSelectionChanged(webDataGrid, evntArgs) {

    __doPostBack(

    '<%= divTextboxPanel.ClientID %>', '');

    }

     

    </script>

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

    Event Handler in .aspx file real version does more but this is all it does before throwing the error

     

     

    Public Sub Panel1_CellSelectionChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.SelectedCellEventArgs) Handles Panel1.CellSelectionChanged

    dim a as int = e.CurrentSelectedCells(0).Row.Index

    end sub

     

     

     

     

     

Children
No Data