Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RadDataGrid doesn't allow row selection if removed and re-added to visual tree. #461

Open
Going-Gone opened this issue May 20, 2020 · 3 comments

Comments

@Going-Gone
Copy link

Description

If you target windows version 16299, this bug does not occur. If you target anything higher, then the bug occurs.

Reference to bug. Can we please look for a solution for this?
#94

@APopatanasov
Copy link
Collaborator

Hi @Going-Gone ,

The observed by you issue is not caused by the DataGrid control, but by the UWP framework itself. For some unknown reason the framework raises Unloaded event for the control while actually the control is loaded and is operational. As we are expecting the framework to raise the right events, currently we cannot apply any fix in the DataGrid control.

On your own risk you can try to remove the logic that checks whether the control is operational and thus the selection functionality should not depend on it - after that you can build a nuget by yourself and use it in your application:

protected override bool IsOperational
{
    get
    {
        return base.IsOperational && this.Owner.IsLoaded && this.suspendedCount == 0;
    }
}

replace with:

protected override bool IsOperational
{
    get
    {
        return this.suspendedCount == 0;
    }
}

Please, be aware that such a change is very risky and might result into an unexpected behavior when the control is actually unloaded.

I hope the provided information will be helpful for you.

@Going-Gone
Copy link
Author

Going-Gone commented Nov 13, 2020

Hi @Going-Gone ,

The observed by you issue is not caused by the DataGrid control, but by the UWP framework itself. For some unknown reason the framework raises Unloaded event for the control while actually the control is loaded and is operational. As we are expecting the framework to raise the right events, currently we cannot apply any fix in the DataGrid control.

On your own risk you can try to remove the logic that checks whether the control is operational and thus the selection functionality should not depend on it - after that you can build a nuget by yourself and use it in your application:

protected override bool IsOperational
{
    get
    {
        return base.IsOperational && this.Owner.IsLoaded && this.suspendedCount == 0;
    }
}

replace with:

protected override bool IsOperational
{
    get
    {
        return this.suspendedCount == 0;
    }
}

Please, be aware that such a change is very risky and might result into an unexpected behavior when the control is actually unloaded.

I hope the provided information will be helpful for you.

When this happens. IsOperational && IsLoaded both = true, and suspendedcount = 0.
What else could be causing it?

If I loop through the itemsource and select one item at a time, this problem goes away. If I use the SelectAll() the problem happens, so something with the SelectAll must be off.

Target version 18362
Min version 17134
Telerik version 1.0.1.9

@APopatanasov
Copy link
Collaborator

@Going-Gone It seems the observed by you issue is not the one described in #94. In #94 the selection is performed using the mouse while here you are mentioning the SelectAll method which is part of the programmatic selection of the control.

I will need a sample project that demonstrates your exact scenario and setup of the DataGrid in order to continue my investigation. Without being able to observe the issue on my side I cannot tell for sure what is causing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants