I am using a RadGrid and want to be able to show row specific details in another item (such as a TextBox) when a row is clicked. This is similar to the example seen in this Grid Example. Since the Grid Example does not have details I am using the example in Grid Row Selection. I want the selection to work like the top example, not the bottom one. I am trying to have the JavaScript call a method in the aspx.cs page that then updates a text box, but the PageMethods.RowClick method in the code behind is static so it does not have access to TextBox1. Is it possible to have more control in the aspx.cs page? The first example looks to be using previously generated items that are then hidden or exposed using JavaScript. Is that what I need to be doing?
I basically want the user to be able to click on a row in the RadGrid and have other things on the page update immediately based on the selected row.
//radgrid.aspx
function RadGrid1_OnRowClick(sender,eventArgs)
{
var MasterTable = sender.get_masterTableView();
var Name = MasterTable.getCellByColumnUniqueName(row, "Server").innerHTML;
PageMethods.RowClick(Name);
}
// radgrid.aspx.cs
[System.Web.Services.WebMethod]
public static void RowClick(string item)
{
TextBox1.Text += item;
}