Search code examples
c#telerik-grid

How To Move RadGridView(in Telerik) Selected Row UP and DOWN In C#?


I want to skip to the above or the next row when I use up or down button on the RadGridView (in Telerik).
The below image shows my purpose:
RadGridview


Solution

  • private void btnUP_Click(object sender, EventArgs e)
    {
        if (dgv != null)
        {
            if (dgv.Rows.Count > 0)
            {
                try
                {
                    dgv.GridNavigator.SelectPreviousRow(1);
                }
                catch { }
            }
        }
    }
    
    
    private void btnDown_Click(object sender, EventArgs e)
    {
        if (dgv != null)
        {
            if (dgv.Rows.Count > 0)
            {
                try
                {
                    dgv.GridNavigator.SelectNextRow(1);
                }
                catch { }
            }
        }
    
    }