I need to deselect a row and select another row from code behind.
I am trying to do it in CellSelectionChanged event of the grid.
I have tried gvLOBList.Behaviors.Selection.SelectedRows.Remove(gvLOBList.Rows(2))
but this seems to be not working.
Any pointers in this regard would be very helpful.
Hi romita,
Let me know if you still need assistance with this.
Regards,
Lyuba
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hello Romita,
I noticed that you are using RowSelectType=”none”, and with this configuration your selection would be the cell. Would you try instead of clearing the row selection to clear the cell selection:
gvLOBList.Behaviors.Selection.SelectedCells.Clear()
Hope this helps.
Infragistics version i am using is 10.2.20102.1011. Please find the markup of the web data grid attached.
<ig:WebDataGrid ID="igPlacementQuote" runat="server" Height="350px" Width="350px" AutoGenerateColumns="False" EnableAjax="False" EnableDataViewState="true" BackColor="White"> <Columns> <ig:BoundDataField DataFieldName="PlacementId" Key="PlacementId" Hidden="True"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="QuoteId" Key="QuoteId" Hidden="True"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="DeliveryDate" Key="DeliveryDate" Hidden="True"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="DeliveryMode" Key="DeliveryMode" Hidden="True"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="LobShortDesc" Key="LobShortDesc" Hidden="True"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="LobCode" Key="LobCode" Hidden="True"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="IsCloned" Key="IsCloned" Hidden="True"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="PlacementQuoteName" Key="PlacementQuoteName" Hidden="True"> </ig:BoundDataField> <ig:TemplateDataField Key="delete" Width="20px"> <ItemTemplate> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/_layouts/images/WebSQP/deleteImg.jpg"/> </ItemTemplate> <Header TemplateId="Delete" CssClass="style5_SQPDetails" /> </ig:TemplateDataField> <ig:TemplateDataField Key="PlacementQuote"> <Header Text="Placement Name" TemplateId="Placement" CssClass="style5_SQPDetails" /> <ItemTemplate> <asp:Label ID="lblPlacementName" runat="server" Font-Bold="True" Font-Size="Small" Text='<%#Eval("PlacementQuoteName") %>'> </asp:Label> <br /> <asp:label runat="server" id="lbldelivery" Text='<%# "Delivered"+ Eval("DeliveryDate")+" Via "+ Eval("DeliveryMode") %>' Font-Size="XX-Small"> </asp:label> <br /> <asp:label runat="server" id="lblLobDesc" Text='<%# Eval("LobShortDesc") %>' Font-Size="XX-Small"> </asp:label> </ItemTemplate> </ig:TemplateDataField> </Columns> <Behaviors> <ig:Selection RowSelectType="None" SelectedCellCssClass="style4_SQPDetails" > <AutoPostBackFlags CellSelectionChanged="True" /> </ig:Selection> <ig:EditingCore> <Behaviors> <ig:RowDeleting /> </Behaviors> </ig:EditingCore> </Behaviors> </ig:WebDataGrid>
Would you tell me which Infragistics version are you using(please give me full version number such as 10.2.20102.2101)? Would you paste here the markup of your webdatagrid?
Hi,
Please find my code snippet attached. My infragistics Web data grid is gvLOBList.
Unselecting is not working, but selecting is working from code behind.
********************************************************************************************
Private Sub gvLOBList_CellSelectionChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.SelectedCellEventArgs) Handles gvLOBList.CellSelectionChanged
Dim columnName As String = e.CurrentSelectedCells(0).Column.Header.TemplateId.ToString() Dim selectedIndex As Integer = e.CurrentSelectedCells(0).Row.Index If columnName = "LOB" Then Dim strPage As String = hdfConfirmVal.Value If strPage <> "Same Page" Then selectedLOBDetails = New SubLOBDetailsOutputPE selectedLOBDetails = LOBCollection.Item(selectedIndex) selectedLOBCode = LOBCollection.Item(selectedIndex).LOBCode ShowselectedLOBDetails() Else gvLOBList.Behaviors.Selection.SelectedRows.Remove(gvLOBList.Rows(2)) gvLOBList.Behaviors.Selection.SelectedRows.Add(gvLOBList.Rows(0)) End If
End If
**************************************************************************************************************