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

[Solved] how to retrieve value from radgrid column

1 Answer 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Testing
Top achievements
Rank 1
Testing asked on 13 Mar 2013, 07:48 AM
Hi.. I am using radgrid in my program.. I need to retrieve the leave type from the table to delete the record. 

    If e.CommandName = "Delete" Then
            Dim ParameterCol As New ParameterCollection
            Dim LeaveType = TryCast(e.Item, GridDataItem).GetDataKeyValue("CodeHRLeaveType").ToString()

            ParameterCol.Add("UserID", Master.LoginUser)
            ParameterCol.Add("EmployeeID", ddlEmpName.SelectedValue)
            ParameterCol.Add("LeaveType", LeaveType.ToString)
            ds = TESTING.HrLeaveRecordDelete(ParameterCol)
        End If

but there is an error with the dim leavetype line.. Is the the right way to retrieve the value??

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Mar 2013, 11:58 AM
Hi,

Please make sure that you have set the DataKeyName property in the MasterTableView as follows.

ASPX:
<telerik:RadGrid . . .>
 
<MasterTableView DataKeyNames="CodeHRLeaveType">
 
. . .

Thanks,
Shinu.
Tags
Grid
Asked by
Testing
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or