Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
605
XamGrid UnboundColumn update
posted

Hello.

 

I created a solution with XamGrid, xaml example:

<Grids:XamGrid x:Name="grid" Height="100"  AutoGenerateColumns="False"

 ItemsSource="{Binding Collection,Mode=OneWay}"   >

            <Grids:XamGrid.Columns>

                <Grids:TextColumn Key="Name" />

                <Grids:UnboundColumn Key="UnbColumn"

ValueConverter="{StaticResource UnboundConverter}" >

                </Grids:UnboundColumn>

            </Grids:XamGrid.Columns>

        </Grids:XamGrid>

I have a converter that must calculate output value by some fields of value object.

Converter's code:

public class UnboundConverter : IValueConverter

    {

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

        {

            var testClass = value as TestClass;

 

            if(testClass != null)

            {

                return testClass.UnbColumn;

            }

            return null;

        }

 

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

        {

            throw new NotImplementedException();

        }

    }

Collection is ObservableCollection<>.

TestClass is a simple class wich has 2 string fields.

Than, if I try change some element in collection like this:

Collection[0].Name = "newName";

Collection[0].UnbColumn = "newValue";

After that, value in column "Name" is change, but value in column "UnbColumn " still not change.

 

So, what I should do to change value on UnboundColumn?

 

Alexey Lukyanov