SelectedIndexChanged not working

2 posts, 0 answers
  1. Charles
    Charles avatar
    11 posts
    Member since:
    Sep 2013

    Posted 25 Jan 2017 Link to this post

    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"
           OnSelectedIndexChanged="RigDiff_SelectedIndexChanged"
           Style="width: 100%; height: 92%;">
            
           <ClientSettings EnablePostBackOnRowClick="false">
               <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ></Scrolling>
               <Selecting AllowRowSelect="true"  />
           </ClientSettings>
           <AlternatingItemStyle BackColor="#313131" ForeColor="White" />
           <MasterTableView >
     
               <ItemStyle HorizontalAlign="Left" Font-Size="11pt" />
               <AlternatingItemStyle HorizontalAlign="Left" Font-Size="11pt" />
           </MasterTableView>
     
           <HeaderStyle BackColor="#313131" ForeColor="White" />
           <ItemStyle BackColor="#313131" ForeColor="White" />
       </telerik:RadGrid>

     

    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)
         MsgBox("Hello")
     End Sub
     
     Protected Sub RadGridRigDiff_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RadGridRigDiff.SelectedIndexChanged
         MsgBox("Hello")
     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)
                    daRigTab_Grid.Fill(DT_RigTab_Grid)
     
                    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.DataBind()
     
                    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. Charles
    Charles avatar
    11 posts
    Member since:
    Sep 2013

    Posted 25 Jan 2017 Link to this post

    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?

  3. Charles
    Charles avatar
    11 posts
    Member since:
    Sep 2013

    Posted 25 Jan 2017 Link to this post

    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?

     

Back to Top