Hi,
Anybody can help me how can I get selected cell value in radgrid dynamically. I would like to publish my code and attachement. What I want is when CellDbClick event fire, I want to get current selected cell value in attachement gridview. I appreciate any help.
.aspx
(
<telerik:RadGrid runat="server" ID="grdAvailability" AllowPaging="true" AutoGenerateColumns="false"
OnItemDataBound="grdAvailability_DataBound"
PageSize="50" Height="565px" Skin="Simple">
<PagerStyle Visible="false" />
<MasterTableView DataKeyNames="RoomKey" ItemStyle-Wrap="false" ClientDataKeyNames="RoomKey" TableLayout="Auto">
</MasterTableView>
<ClientSettings AllowRowsDragDrop="true">
<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
<ClientEvents OnCellSelected="cellSelected" OnScroll="HandleScrolling" OnRowContextMenu="OnRowContextMenu" />
<ClientEvents OnRowDblClick="CellDbClick" />
<Selecting CellSelectionMode="SingleCell" EnableDragToSelectRows="true" />
</ClientSettings>
</telerik:RadGrid>
)
Script
(
function CellDbClick(sender, eventArgs) {
var grid = sender;
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
var cell = MasterTable.getCellByColumnUniqueName(row, 'RoomKey');
var value = cell.innerHTML;
var rvalue = cell.innerText;
alert("HTML" + value);
alert("Text" + rvalue);
}
)