This is a migrated thread and some comments may be shown as answers.

how to select row and have it set for current row upon loading

1 Answer 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lily
Top achievements
Rank 1
Veteran
Lily asked on 18 Jun 2020, 03:01 PM

Hi,

I have a question about IsSelected & IsCurrent.

I have a gridview that when upon loading, the first row is selected and highlighted, so I have a pop-up contatiner that will get the current row data.  But when reload that gridview again, no rows are highlighted any longer.

I've tried IsSelected and IsCurrent, but it only highlights the row with the IsSelected, but when I click on the pop-container that gets the current row data, it gives a error due to null value.

What can I do?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Jun 2020, 11:01 AM
Hello, Lily,  

I would like to start with the clarification that selected and current row are two different things. One row can be:

1. Only current, but not selected
2. Only selected, but not current
3. Both, selected and current

Please refer to the below screenshots for better illustration of the different style that RadGridView offers for the selected and current row:

Only one row can be Current in the grid, but multiple rows can be Selected.

If you set the CurrentRow in the grid, it automatically gets also selected. But after that, you can make another row selected:

        Me.RadGridView1.CurrentRow = Me.RadGridView1.Rows(1)
        Me.RadGridView1.Rows(5).IsSelected = True

In case you are still experiencing any further difficulties, it would be greatly appreciated if you can provide more information about the precise case and the exact goal that you are trying to achieve. Thus, we would get better understanding of the precise case and think about a suitable solution. Thank you.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
GridView
Asked by
Lily
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or