Simple row selected column value to label

Hello,

I am trying to get a label to display the PropectID of a selected row. Ive got it to work with the RecordDoubleClicked event provided by one your guys. But I would like the label to display the ID with a simple click of the row.

Private Sub GridGroupingControl1_RecordDoubleClicked(ByVal sender As Object, ByVal e As Syncfusion.Web.UI.WebControls.Grid.Grouping.RecordDoubleClickEventArgs) Handles GridGroupingControl1.RecordDoubleClicked

Dim r As Syncfusion.Grouping.Record = Me.GridGroupingControl1.Table.CurrentRecord

If r IsNot Nothing Then

Me.lblStatus.Text = r.GetValue("ProspectID").ToString()

End If

If ViewState("ProspectID") Is Nothing Then

ViewState("ProspectID") = r.GetValue("ProspectID").ToString()

ElseIf r IsNot Nothing AndAlso r.IsCurrent Then

If ViewState("ProspectID").ToString() <> r.GetValue("ProspectID").ToString() Then

Dim currentrec As Syncfusion.Grouping.Record = r

Me.lblStatus.Text = currentrec.GetValue("ProspectID").ToString()

End If
End If
End Sub

Thanks,
Felix



1 Reply

YO Yogeshwaran Syncfusion Team October 19, 2011 02:04 PM UTC

Hi Felix,

Thanks for using Syncfusion products.

Your requirement to get particular record value from grid at single click can be achieved by using click function from client side and use grid object to get current record. Please refer the following code
Snippet:

[javascript]

function Select(gridobj) {

document.getElementById("label1").innerHTML = gridobj.Row.GetValue('ID');

}


For your convenience ,we have created the following sample and the same it can be download from below link:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GridSearchBox-798512864.zip

Please let us know if any concerns.

Regards,
Yogesh R


Loader.
Up arrow icon