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. (Last updated on: November 16, 2018).
Close Icon
Unfortunately, activation email could not send to your email. Please try again.
Close Icon
close icon
Vote for your favorite ebook
Succinctly Readers Awards 2020
Syncfusion Feedback

how to bind GridDataVisibleColumn from ObservableCollection programmatically?

Thread ID:





117615 Nov 17,2014 11:15 AM UTC Nov 18,2014 09:22 AM UTC WPF 1
Tags: GridDataControl
Asked On November 17, 2014 11:15 AM UTC

          Could you tell me how to bind GridDataVisibleColumn from ObservableCollection<ColumnChooserItems> programmatically without using binding property in design view?

Thank you.

Saravanan M [Syncfusion]
Replied On November 18, 2014 09:22 AM UTC

Hi Shwe,


Thank you for Contacting Syncfusion support,


We have analyzed your query. You can bind the GridDataVisiblecolumn in code behind instead of binding in XAML from ObservableCollection. Please refer the below code snippet.


Code Snippet[C#]:

ObservableCollection<GridDataVisibleColumn> _Columns;

ObservableCollection<GridDataVisibleColumn> Columns


            get { return _Columns; }

            set { _Columns = value; }


public ObservableCollection<GridDataVisibleColumn> GetColumns()


  var columns = new ObservableCollection<GridDataVisibleColumn>();

  columns.Add(new GridDataVisibleColumn() {MappingName="CustomerID" });

   return columns;



public MainWindow()



  Columns = GetColumns();





We have prepared a sample based on this and you can download it form below location,


Sample Location: GridDataControl_Sample.zip


We have a SfDataGrid control like GridDataControl. But compare to GridDataControl, SfDataGrid having a better performance and flexibility. SfDataGrid assists you to create entirely customizable and highly interactive features used to display and manipulate the huge amount of data. So, we suggest you to use SfDataGrid instead of GridDataControl.


We have prepared a sample based on the same scenario in SfDataGrid and you can download it from below location.


Sample Location: SampleApplication.zip


Please let us know if you have any queries,






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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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