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

[Solved] Getting Cell Value in GridItem

1 Answer 558 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adrian Porger
Top achievements
Rank 1
Adrian Porger asked on 21 Dec 2007, 04:59 PM
Hy folks, I am having dificulties to acomplish a very simple task... geting a value out of the RadGrid.SelectedItems Collection...

I have the following code

Public Function SelectedItem(ByVal columname As String) As String

Dim result As String = Nothing

Dim item As Telerik.Web.UI.GridItem = Nothing

Try

item =

Me.RadGrid1.SelectedItems.Item(0)

*  result = item.Cells(columname).Text

Return result

Catch ex As Exception

result =

Nothing

End Try

Return result

End Function


The selectedItems Collection is properly filled, after selecting the first Item, * how do i get the Cell Value in the specified Column? Using the index works but how do I know how the columnname and index are mapped? the docs state to use the uniqeName property of the GridItem but there is no such property??

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Dec 2007, 05:08 PM
Hi Adrian,

You can index GridDataItem by column UniqueName. Here is an example:

result = item("YourColumnUniqueName").Text

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Adrian Porger
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or