You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Binding the IsVisible Property from ViewModel into DataGridTextColumn to hide/show column by toggling the checkbox
All the checkbox binding the boolean property in mode TwoWay
Steps to Reproduce
Create UWP Project and import some Nuget Packages as same as Basic Infomation bellow
Create the ViewModel with inheritance of ViewModelBase (using GalaSoft.MvvmLight). Define 3 properties _one; _two; _three; with type of bool and have default value = true. We can see this code bellow:
using GalaSoft.MvvmLight;
namespace Test
{
public class TestVM : ViewModelBase
{
private bool _one = true;
private bool _two = true;
private bool _three = true;
public bool One
{
get => _one;
set => Set(ref _one, value);
}
public bool Two
{
get => _two;
set => Set(ref _two, value);
}
public bool Three
{
get => _three;
set => Set(ref _three, value);
}
}
}
Create the MainPage.xaml with using RadDataGrid like this code bellow:
Three DataGridTextColumns (column with Header=1, 2 and 3) has the Property IsVisible with binding mode OneWay to ViewModel
Three Checkboxs has the Property "IsChecked" with binding mode TwoWay to toggle the Property from ViewModel. Three checkbox use to hide/show 3 columns in DataGrid
Description
Binding the IsVisible Property from ViewModel into DataGridTextColumn to hide/show column by toggling the checkbox
All the checkbox binding the boolean property in mode TwoWay
Steps to Reproduce
Expected Behavior
The column 3 can swap normally
Actual Behavior
The column 3 can not swap with other columns
See this gif bellow for more details:
Basic Information
The text was updated successfully, but these errors were encountered: