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

SelectedIndexChanged not working

2 Answers 34 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Charles asked on 25 Jan 2017, 08:56 AM

I have a RadGrid and the SelectedIndexChanged is not firing. I have literally tried to change every property and I have tried it with the postback and OnSelectedIndexChanged set correctly per all the examples.

Here is the code: Right now its set to OnSelectedIndexChanged  but i have tried ever combination 

<telerik:RadGrid ID="RadGridRigDiff" runat="server"
        GridLines="None" BackColor="#313131" ForeColor="White"
       Style="width: 100%; height: 92%;">
       <ClientSettings EnablePostBackOnRowClick="false">
           <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ></Scrolling>
           <Selecting AllowRowSelect="true"  />
       <AlternatingItemStyle BackColor="#313131" ForeColor="White" />
       <MasterTableView >
           <ItemStyle HorizontalAlign="Left" Font-Size="11pt" />
           <AlternatingItemStyle HorizontalAlign="Left" Font-Size="11pt" />
       <HeaderStyle BackColor="#313131" ForeColor="White" />
       <ItemStyle BackColor="#313131" ForeColor="White" />


here are my two functions I use... I just comment the one out I'm not using     

Protected Sub RigDiff_SelectedIndexChanged(sender As Object, e As EventArgs)
 End Sub
 Protected Sub RadGridRigDiff_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RadGridRigDiff.SelectedIndexChanged
 End Sub


HERE is my code to set the grid...

           SQL_RigChange = "My SQL Statement"
                Dim DT_RigTab_Grid As New DataTable
                Dim daRigTab_Grid As New SqlDataAdapter(SQL_RigChange, Conn)
                Dim DT_RigTab_Grid2 As New DataTable
                If DT_RigTab_Grid.Rows.Count > 0 Then
                    DT_RigTab_Grid2 = Get_Diff(DT_RigTab_Grid, "Grid")
                End If
                For Each row As DataRow In DT_RigTab_Grid2.Rows
                    row.Item("Name") = StrConv(row.Item("Name"), VbStrConv.ProperCase)
                Next row
                RadGridRigDiff.DataSource = DT_RigTab_Grid2
                RadGridRigDiff.MasterTableView.GetColumn("Sort").Visible = False
                RadGridRigDiff.MasterTableView.GetColumn("Flag").Visible = False
                RadGridRigDiff.MasterTableView.GetColumn("Change").ItemStyle.HorizontalAlign = HorizontalAlign.Center
                RadGridRigDiff.MasterTableView.GetColumn("M1Total").ItemStyle.HorizontalAlign = HorizontalAlign.Center
                RadGridRigDiff.MasterTableView.GetColumn("M2Total").ItemStyle.HorizontalAlign = HorizontalAlign.Center
                RadGridRigDiff.MasterTableView.GetColumn("Name").HeaderStyle.Width = Unit.Pixel(220)
                RadGridRigDiff.MasterTableView.ItemStyle.Height = 15
                RadGridRigDiff.MasterTableView.AlternatingItemStyle.Height = 15


2 Answers, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 25 Jan 2017, 10:24 PM

I would like to re-ask my question.

I have created a new web app and brought over every piece of code for this grid and it works just fine.

So this must mean that there is some other code that is affecting this grid.

What could be doing this? Has anyone ever seen this kind of thing?

Top achievements
Rank 1
answered on 25 Jan 2017, 11:34 PM

Wow... I found it... Here it is so that if anyone ever searches they can cross this off the list..

In a whole other TabStrip not even on the same <div> I had OnClientTabUnSelected="OnClientTabUnSelected" (not sure why)

It did not affect anything else... nothing but the click event of the RadGrid..

Any ideas why?


Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question