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

GridElement Begin and EndUpdate Does not seem to always work

1 Answer 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sculver
Top achievements
Rank 1
sculver asked on 22 Sep 2008, 02:54 PM
I have a Windows Form GridView object that I am populating.  I need to allow the user to change the order of items in the list.  To do this, I have two buttons, MoveUp and MoveDown to let them.  For simplicity sake, I have left out a lot of error checking code from my post.

My problem is that I am calling the GridElement.BeginUpdate() and GridElement.EndUpdate() methods, and for the MoveUp it works just fine, however, oddly enough, the MoveDown causes a flicker effect, which is not supposed to happen (I think) if I am using these methods correctly.

Here is the portion of my code that is doing this action, as you can see the same code is running in both instances, I am just passing in a different change:

private

void btnMoveUp_Click(object sender, EventArgs e)
{
    MoveCurrentItem(-1);
}

private void btnMoveDown_Click(object sender, EventArgs e)
{
    MoveCurrentItem(1);
}

private void MoveCurrentItem(int indexChange)
{
    if (radgvScriptsList.SelectedRows.Count == 1)
    {
        radgvScriptsList.GridElement.BeginUpdate();
        
        MultiScriptFile
file = GetSelectedFile();
        int oldIndex = Files.IndexOf(file);
        Files.Remove(file);
        Files.Insert((oldIndex + indexChange), file);
        radgvScriptsList.Rows[(oldIndex + indexChange)].IsCurrent =
true;
      
        radgvScriptsList.GridElement.EndUpdate();
    }
}

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 24 Sep 2008, 07:42 AM
Hello sculver,

I could not reproduce the flickering issue with our latest release Q2 2008 SP1. I strongly recommend updating to this version of RadControls, as a number of improvements have been made since the release of Q2 2008.

If the problem persists, please send me your application in a support ticket. This will help me locate the issue and address it faster.

Thank you in advance for your cooperation.
 

Greetings,
Jack
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
sculver
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or