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

CurrentRow Problem?

3 Answers 343 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 23 Jul 2010, 12:45 PM
Hello,

ClearSelection wont work in my implementations. if i use this.radGridView.CurrentRow = null; there is no selection at start up. but if i click then on a cell, the first cell in the clicked row will be selected. but this is wrong ?!

Regards,
tHomas

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 26 Jul 2010, 05:34 PM
Hi Thomas,

I confirm that this issue appears in our latest release and I want to thank you for reporting it. I updated your Telerik points. We will address it in the upcoming service pack. Should you have any further questions, do not hesitate to write back.

Regards,
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Emanuel Varga
Top achievements
Rank 1
answered on 26 Jul 2010, 08:39 PM
Hello guys,

Offtopic: It's really funny... I've been trying to convince people about a problem in the grid for some time now, a million messages exchanged, 2 support tickets and everybody keeps telling me it's normal behavior.

ONTOPIC: there are also problems with:
1. adding a new row to the grid when a row is selected = > it will select the newly added row
2.                 .......................................a row is editing   = > cancel editing select the new row (great)
3. trying to scroll while rows are being added (dynamic binding in a dynamic system)  = > the scrollbars will be stuck either on top if you're adding at pos 0 or at the bottom
4. Use filtering while using a dynamic grid, everything fill flicker and the scrollbars will be jumping all over the place.

I have provided a test application where all of these things are obvious.

I will tell this again here, hope i don't offend anyone but there might be increases in performance for static bindings, but grids with dynamic behaviors are a mess to work with now.

I hope somebody will take some things into considerations from this, because i'm just trying to help.

Best Regards,
Emanuel Varga
0
Jack
Telerik team
answered on 29 Jul 2010, 12:23 PM
Hi Thomas,

Thank you for your feedback. I have read your other tickets and tried to understand the issue. 

The desired behavior when adding a new row is to select the newly added row. We also have the behavior to ensure the visibility when a row becomes current. Yes, this behavior had issues in our previous version and we tried to address them in our latest release. And again, yes, you have a point. There are cases when we should not change the current row when adding new rows. In fact the standard MS DataGridView behaves this way. That is why we decided to improve our API and provide e property which allows or disables changing current row in this scenario. The new property will be available in our upcoming service pack. 

I also prepared a work around. You should call Begin/EndUpdate methods of GridTableElement when adding a new row:

void timer_Tick(object sender, EventArgs e)
{
    this.radGridView1.TableElement.BeginUpdate();
 
    if (objectCollection.Count > max)
    {
        objectCollection.RemoveAt(objectCollection.Count - 1);
        if (radGridView1.CurrentRow != null)
        {
            this.radGridView1.CurrentRow = null;
        }
    }
 
    objectCollection.Insert(0, new CustomObj()
    {
        Id = n,
        Name = "Name" + n
    });
 
    n++;
 
    this.radGridView1.TableElement.EndUpdate(false);
    this.radGridView1.TableElement.RowScroller.UpdateScrollRange();
    this.radGridView1.TableElement.ViewElement.UpdateRows();
}

Please, describe with more details the issue when using filtering. This will help us to address the issue in our upcoming service pack.
 
I hope this helps. Should you have further questions, please write me back. I will be glad to help.

All the best,
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Jack
Telerik team
Emanuel Varga
Top achievements
Rank 1
Share this question
or