We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

What is the relationship between AutoPopulateColumns, MappingName and GridDataVisibleColumn.Binding?

I can't get a simple Converter working in a column.  From a previous example I see you use AutoPopulate=False, MappingName=property for column and a Binding to the same property.  Here is my XAML.
<syncfusion:GridDataControl Height="202" HorizontalAlignment="Left" Margin="30,40,0,0" 
Name="gridDataControl1" VerticalAlignment="Top" Width="428" 
ActivateCurrentCellBehavior="ClickOnCell"
ItemsSource="{Binding MduCollection}"
SelectedItem="{Binding MduSelectedItem}" 
AutoPopulateColumns="False" ShowAddNewRow="False" AllowResizeRows="False" AllowDelete="False" AutoPopulateRelations="True">
<syncfusion:GridDataControl.VisibleColumns>
	<syncfusion:GridDataVisibleColumn MappingName="DataType" IsReadOnly="True" Width="100" Binding="{Binding Path=DataType}"/>
	<syncfusion:GridDataVisibleColumn MappingName="Value" Width="*" Binding="{Binding Path=Value, Converter={StaticResource MduConverter}}"/>
</syncfusion:GridDataControl.VisibleColumns>
</syncfusion:GridDataControl>

I get a weird effect. When I select a new cell after editing:
1) The last value edited appears in the cell clicked on
2) The converter is not called
3) The property is not updated.

Can you help please (full solution attached).
I have looked at the class documentation but I'd appreciate knowing what the relationship is between the things in this post's subject.




ObjectGrid_80abf85f.zip

1 Reply

RS Ravi Shankar B Syncfusion Team November 30, 2012 12:13 PM UTC

Hi Hamish,

 

Thank you for using Syncfusion products.

 

We have analyzed your query and Please find the response below.

 

AutoPopulateColumns:

 

While creating the Visible Columns the GridDataControl get the meta data information (Property Name, DataTypes) about the collection and populate / assign the values based on the meta data information.

 

1.True:

 

While using AutoPopulateColumns as True ,GridDataControl  will get the information from binded underlyingcollection and populate VisibleColumns based on this.

 

2.False

 

While using AutoPopulateColumns as False ,We want to bind the each property in underlyingcollection to GridDataVisibleColumn. GridDataControl  will populate the VisibleColumn  based on the VisibleColumn .

 

MappingName:

 

MappingName property in GridDatavisibleColums is used to bind the underlying collection property to the GridDataVisibleColumn.

 

GridDataVisibleColumnBinding:

This is same behavior like MappingName .It is used to bind the property in the unnderlyingcollection data to the GridDataVisibleColumn.

 

And you can achieve your requirement by using ValueConverter property in GridDataVisibleColumn. We have modified the sample based on this and it can be download from the following  location.

 

Modified Sample: ModifiedSample.zip

 

Note :

Changes done in the Mainwindow.xaml

Changes done in the MduConverter.cs

 

Please let us know if you have any questions

 

Regards,

Ravi Shankar B.


Loader.
Live Chat Icon For mobile
Up arrow icon