This is a migrated thread and some comments may be shown as answers.

Get ItemIndex in TextChanged Event

1 Answer 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Satya Sahu
Top achievements
Rank 1
Satya Sahu asked on 12 Apr 2010, 06:05 AM
Hi Folks,

I am trying to to get the itemindex in the textchanged event.

Can anyone help me out on this.
Protected Sub txtEditPileDia_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) 
        Try 
            objDetailInfo = New NDSBLL.DetailInfo 
            objDetailDal = New NDSDAL.DetailDal 
            Dim txtNewPileDia As TextBox 
            Dim txtLinkStart As TextBox 
            Dim txtLinkEnd As TextBox 
            'Dim txtAdditionalSpiral As TextBox 
            Dim intIndex As Integer = ???? 
            txtNewPileDia = DirectCast(gvStructDetails.Rows(intIndex).FindControl("txtPileDia"), TextBox) 
            txtLinkStart = DirectCast(gvStructDetails.Rows(intIndex).FindControl("txtEditNoLinksStart"), TextBox) 
            txtLinkEnd = DirectCast(gvStructDetails.Rows(intIndex).FindControl("txtEditNoLinksEnd"), TextBox) 
            'txtAdditionalSpiral = DirectCast(gvStructDetails.Rows(intIndex).FindControl("txtEditNoAdditionalSpiral"), TextBox) 
            If ((Not txtLinkStart Is Nothing) And (Not txtLinkEnd Is Nothing) And (Not txtNewPileDia Is Nothing)) Then 
                PopulateLinksValues(txtNewPileDia, txtLinkStart, txtLinkEnd) 
            End If 
        Catch ex As Exception 
            ErrorHandler.RaiseError(ex, strPath) 
        End Try 
 
    End Sub 

Below is my Code and the line below is wht i am expecting.....

 Dim intIndex As Integer = ????


Thanks
Satya

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 14 Apr 2010, 08:37 PM
Hello Satya,

I take that your TextBox control reside in RadGrid. In this case, you can access the item via TextBox's naming container:
Dim item As GridItem = TryCast((TryCast(sender, TextBox)).NamingContainer, GridItem)

Let me know if I'm missing something.

Best regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Satya Sahu
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or