Hi friends,
Sorry for my simple question, but I have searched here and have found no clue on how to deselect (clear selection) on code behind.
Here´s what I´m doing:
ASPX
<asp:UpdatePanel ID="updPanel" runat="server">
<ContentTemplate>
<ej:Grid ID="MyGrid" runat="server" Width="300px" Height="345px" AllowTextWrap="True" Locale="en-US" DataSourceCachingMode="Session" >
<Columns>
<ej:Column Field="groupID" HeaderText="Group" TextAlign="Left" HeaderTextAlign="Left" HeaderTooltip="Group ID" />
<ej:Column Field="groupName" HeaderText="Group" TextAlign="Left" HeaderTextAlign="Left" HeaderTooltip="Group Name"/>
</Columns>
</ej:Grid>
<asp:LinkButton ID="LinkButton1" OnClick="clearSelection" runat="server" Width="150px"> Clear selection </asp:LinkButton>
</ContentTemplate>
</asp:UpdatePanel>
C-SHARP
public void clearSelection(object sender, EventArgs e)
{
this.MyGrid.SelectedRowIndex = -1;
this.MyGrid.Model.SelectedRowIndex = -1;
this.MyGrid.DataBind();
}
The code above is fired but the selected row is not unselected.
Can you please tell me what I´m missing?
Thank you in advance.