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

Second RadGrid on page returning nothing for SelectedValue

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 13 Nov 2012, 11:37 PM
HI,

I have a page with 3 radgrids.Each exactly the same.

The first grid gives me a value in the SelectedValue property when a row is selected. The second grid, is an exact copy of the first grid does not give a value in the selectedvalue property.

My code on postback:

        If Page.IsPostBack = True Then
            'CLick on Branch 
            If CType(Request.Form("__EVENTTARGET"), String) = "eStatsDetail1$RadGrid1" Then
                Dim BranchNameString As String
                BranchNameString = RadGrid1.SelectedValue
                Session("BRANCHNAME") = RadGrid1.SelectedValue
                SqlDataSource2.SelectParameters("@P_BRANCHNAME") = New Web.UI.WebControls.Parameter("@P_BRANCHNAME", DbType.String, BranchNameString)
                RadGrid4.Rebind()
            End If


            'User Clicks on Employee
            If CType(Request.Form("__EVENTTARGET"), String) = "eStatsDetail1$RadGrid4" Then
                BindBranchGrid()
                Dim EmployeeNameString As String
                EmployeeNameString = RadGrid4.SelectedValue 'This is always empty
                Session("EMPLOYEENAME") = RadGrid4.SelectedValue
                SqlDataSource4.SelectParameters("@P_EMPLOYEENAME") = New Web.UI.WebControls.Parameter("@P_EMPLOYEENAME", DbType.String, EmployeeNameString)
                RadGrid3.Rebind()
            End If
        End If

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 16 Nov 2012, 06:37 AM
Hi Ryan,

I am not sure that might be going wrong on your side as I need the mark-up and code-behind but I have attached a small sample that demonstrates the best approach to get the field values of a selected item in RadGrid.

Hope it helps.


All the best, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or