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

Empty line appears when hiding GridView line

1 Answer 140 Views
GridView
This is a migrated thread and some comments may be shown as answers.
EAGLE
Top achievements
Rank 1
EAGLE asked on 21 May 2020, 03:54 PM

 

Hi

I am using a GridView containing 2 or 3 lines of data.I have to hide and show some lines related to the condition

But when I hide the row, there is an empty space (possibly a row with no data)

This way I hide the line (I tried both Collapse and Hidden)

  GridView1.GetRowForItem(GridView1.Items[rowIndex]).Visibility = Visibility.Collapse;

How can I completely hide the Grid row?

1 Answer, 1 is accepted

Sort by
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 26 May 2020, 08:21 AM

Hello,

Thank you for the shared picture. 

Speaking generally, we don't recommend working directly with the visual elements inside the RadGridView (GridViewRow and GridViewCell) as this will interfere with the UI Virtualization mechanism of the control.

If you want to remove a certain row, you can do that on the data level by removing the object that is represented by that row from the ItemsSource of the RadGridView. Alternatively, you can also programatically filter out the object that you don't want to show. 

I hope you find this helpful.

Regards,
Vladimir Stoyanov
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
EAGLE
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or