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

RadGridView Add Button and Get Value from another cell On Click

1 Answer 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Simon Brassington
Top achievements
Rank 1
Simon Brassington asked on 20 Feb 2017, 05:58 PM

Hi

 

I've added a button to my RadGridView via the below:

 

Dim col As New MyDeleteButtonColumn()
RadGridView1.Columns.Add(col)

Public Class MyDeleteButtonColumn
Inherits Telerik.Windows.Controls.GridViewColumn
Public Overrides Function CreateCellElement(cell As GridViewCell, dataItem As Object) As FrameworkElement
Dim btn As New RadButton()
btn.Content = "MD"
btn.[AddHandler](Button.ClickEvent, New RoutedEventHandler(AddressOf btn_Click))
Return btn
End Function
Private Sub btn_Click(sender As Object, e As RoutedEventArgs)
     Dim win2 As New form2("gvcell0value:)")
win2.Show()
End Sub

 

Within the but_Click I need to get the value of from cell 0 to pass throught to a new form opening

How could I achive this?

Many thanks

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 23 Feb 2017, 02:37 PM
Hi Simon,

You need to extract the content of the cell through the underlying item. Please check the attached sample that shows a possible approach. 

Regards,
Stefan Nenchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Simon Brassington
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or