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
865
Row Selection (Server Side) Fired on new row enter edit mode
posted

Hi Team 

Here is the situation..I have a webdata grid with server side row selection changed event configured

OnRowSelectionChanged="dgLocGroups_RowSelectionChanged"

It is calling the method on any row selection change:

protected void dgLocGroups_RowSelectionChanged(object sender, SelectedRowEventArgs e)

 

I also have a button that is adding a new row to grid via javascript

 

function AddRow() {

            var grid = $find('<%= dgkeywords="" clientid="">');

            var editing = grid.get_behaviors().get_editingCore();

            var rowAdding = editing.get_behaviors().get_rowAdding();

             rowAdding._commitRow();

         }

 

The row gets added well but when clicking on the cell to enter into edit mode post back is happening due to rowselection event .

 

Below is the code snippet of the behavior:

<Behaviors>

                        <ig:Selection Enabled="true" RowSelectType="Single" CellClickAction="Row">

                            <AutoPostBackFlags RowSelectionChanged="true" />

                        </ig:Selection>

                        <ig:EditingCore BatchUpdating="true">

                           

                            <Behaviors>

                              <ig:RowAdding Enabled="true" EditModeActions-MouseClick="None"></ig:RowAdding>

                                <ig:CellEditing>

                                    <EditModeActions MouseClick="Double" />

                                </ig:CellEditing>

 

                            </Behaviors>

 

                        </ig:EditingCore>

                    </Behaviors>

 

 

I have changed the EditModeActions of Cellediting to ‘Single’ but of no use.

 

Please help.

Varun

Parents
  • 20255
    Offline posted

    Hello Varun,

    Thank you for contacting us.

    This is expected behavior, when new row is added into the Grid and you select it, RowSelectionChanged event should be fired. When you start to enter a cell from the newly added row, this is considered as row changing, because previously the row was not selected, and then RowSelectionChanged event is fired.

    Could you please let me know what you are trying to achieve in order to suggest you the best approach.

    Looking forward to hearing from you.

Reply Children