This is a migrated thread and some comments may be shown as answers.
SelectedIndexChanged not working
2 Answers 3 Views
This is a migrated thread and some comments may be shown as answers.
Charles
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"
       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 Answers, 1 is accepted

Sort by
0
Charles
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?

0
Charles
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?

 

Tags
Grid
Asked by
Charles
Top achievements
Rank 1
Answers by
Charles
Top achievements
Rank 1
Share this question
or