Radgrid Server and Client side Column and Row Coordinate

0 Answers 65 Views
Grid
anna
Top achievements
Rank 1
Bronze
Iron
anna asked on 05 Feb 2022, 09:09 AM

Hello.

I need help.

I need the coordinates of Column + Row of the selected cell in Radgrid.
Is the syntax of the source I attached correct?

please reply.

keep waiting for your reply

I want to communicate with client side and server side.


In Server Side(ASP.NET), 
<ClientSettings>
    <Selecting CellSelectionMode="MultiCell" />
    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    <ClientEvents OnCellSelected="cellSelected" />
</ClientSettings>

In JavaScript,
function cellSelected(sender, args)
{
            var selectedRow = args.get_row();
            var selectedColumn = args.get_column();
            var dataItem = args.get_gridDataItem();
            var tableView = args.get_tableView();
            var cellIndex = args.get_cellIndexHierarchical();
            var output = String.format("The selected cell is located in column with name: " + selectedColumn.get_uniqueName() + " and in row with index: " + dataItem.get_itemIndexHierarchical() + ". This cell has index " + cellIndex + " and it is part from " + tableView.get_name() + ".");

sender.get_masterTableView().fireCommand("cellSelected",    ????????????? );

}



Is the syntax of the source I attached correct?

To get the Selected Column&Row Coordinate

Client Side (aspx.cs)

protected void gv_ItemConmmand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "cellSelected")
    {
 var clickedColumnName = e.CommandArgument.ToString();

         // Label1.Text = clickedColumnName;
     }
 }

Do you have any other code from this source?

In Server Side

<ClientSettings>
    <Selecting CellSelectionMode="MultiCell" />
    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    <ClientEvents OnCellSelected="cellSelected" />
</ClientSettings>

In Client Side

protected voidRadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == "CellClick")
    {
        var selectedColumn = e.Item.selectedColumn.get_uniqueName();
        var selectedRow = e.Item.get_row();
    }
}

Is the syntax of the source I attached correct?             

No answers yet. Maybe you can help?

Tags
Grid
Asked by
anna
Top achievements
Rank 1
Bronze
Iron
Share this question
or