DE-SELECT SELECTED/CHECKED ROWS

  Good morning,

I am working on visual basic with ej:grid but I have a slight problem. When I process the checked rows on the page (attached screenshot below), it refreshes as expected but the selected rows still remain checked. How I reset them to unchecked onFormReLoad?


1 Reply 1 reply marked as answer

PK Padmavathy Kamalanathan Syncfusion Team June 8, 2020 11:33 AM UTC

Hi Joji, 
  
Thanks for contacting Syncfusion Forums. 
  
QUERY: How i reset them to unchecked onFormReload? 

 
In order to clear the selection, we suggest you to clear the "SelectedRowIndices" property of Grid and also set the "SelectedRowIndex" to "-1" on form reload. In the below example, we have cleared selection in button click event at server end. Similarly we suggest you to clear selection in form reload. 

 

Please check the below code,

  
      <ej:button ID="Start" runat="server" Text="Clear" Size="Medium"  
        ShowRoundedCorner="true" OnClick="Button_Click"></ej:button> 
          <ej:Grid ID="OrdersGrid" runat="server"> 
            <Columns> 
             <ej:Column Type="checkbox" HeaderText="OrderID" TextAlign="Left" ></ej:Column> 
            <ej:Column Field="OrderID" HeaderText="OrderID"  IsPrimaryKey="True" ></ej:Column> 
            </Columns> 
           </ej:Grid> 
  
   Protected Sub Button_Click(ByVal sender As Object, ByVal e As  
     Syncfusion.JavaScript.Web.ButtonEventArgs) 
        Dim selectedRows As ArrayList = Me.OrdersGrid.Model.CheckedRowIndices 
        If OrdersGrid.SelectedRowIndices.Count <> 0 Then 
  
            If True Then 
 
              'Clearing the SelectedRowIndices of grid using Clear method 
 
                Me.OrdersGrid.Model.SelectedRowIndices.Clear() 
                'Setting SelectedRowIndex to -1
 
                OrdersGrid.SelectedRowIndex = -1  
            End If 
        End If 
End Sub 


Please check the below API help documentations,

Still facing the issue, kindly share us the below details, 
 
  1. Complete grid rendering code(both client and code behind).
  2. Also let us know in what scenario do you expect to clear the selection.
  3. Video demonstrating the issue.
  4. Screenshots of error with stack trace (if any).
  5. Share us your Essential Studio Version details.

Regards,
Padmavathy Kamalanathan


Marked as answer
Loader.
Up arrow icon