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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

105716 Nov 15,2012 02:34 PM UTC Nov 30,2012 12:13 PM UTC WPF 1
loading
Tags: GridControl
Hamish Gunn
Asked On November 15, 2012 02:34 PM UTC

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

Ravi Shankar B [Syncfusion]
Replied On 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.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;