5 Answers, 1 is accepted
Please try the following approaches:
1) Client side:
2) Server side
I hope this helps.
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I was wondering if you had any thoughts about this. After a button in a row is clicked, I need to access a value from the row directly above it.
Try out the following code to access a control in the previous row when the button in a row is clicked.
e.CommandName = "DeleteEmployee" Then
dataItem As Telerik.Web.UI.GridDataItem = CType(e.Item, Telerik.Web.UI.GridDataItem)
Dim itemValue As String = dataItem("EmployeeID").Text
selectedIndex As Integer = e.Item.ItemIndex
EmpID As String = itemValue
What I was hoping to do is use this from the code you provided :
strtxt As String = RadGrid1.MasterTableView.Items(index - 1)("EmployeeID").Text
but it's not assigning the value to strtxt
if (e.CommandName == "DeleteEmployee")
Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)e.Item;
string itemValue = dataItem("EmployeeID").Text;
int selectedIndex = e.Item.ItemIndex;
string EmpID = itemValue;
string strtxt = RadGrid1.MasterTableView.Items(index - 1)("EmployeeID").Text;
Can you try replacing the last line of your code i.e.,
with the following code strip
and see if it helps.