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 GridComboBoxColumn Binding to a List

Thread ID:

Created:

Updated:

Platform:

Replies:

114244 Nov 7,2013 01:07 PM Sep 16,2014 07:12 AM WinRT 3
loading
Tags: SfDataGrid
Joseph Orjinta
Asked On November 7, 2013 01:07 PM

Hi,

Am working on Syncfusion WinRT, I hope to have a Grid Column with Combo Box to be Bound on List -  from an SQLite Datasource

 

  private async Task LoadGender()
        {


           genderList.Add(new Gender { GenderCode = "M", GenderName = "Male" });
           genderList.Add(new Gender { GenderCode = "F", GenderName = "Female" });

 

           foreach (Gender item in genderList)
           {
               await oGenderRepository.InsertGenderAsync(item);
           }

     
           List<Gender> result = await oGenderRepository.SelectAllGenderAsync();
           //or parse a query
           //List<Employee> result = await oEmployeeRepository.SelectEmployeesAsync("SELECT EmployeeId, FirstName, LastName, Email, DepartmentId FROM Employee");

           genderList.Clear();
           genderList = result;

         //  this.cboGender.ItemsSource = result;

           
        }

the xaml code is

 

        <Grid:SfDataGrid x:Name="dgUserAccounts" HorizontalAlignment="Left" Height="390" Margin="171,140,0,0" VerticalAlignment="Top" Width="1042" Background="White"  HeaderStyle="{StaticResource headerCellStyle}" AllowEditing="True" AutoGenerateColumns="False" NavigationMode="Cell" ColumnSizer="Star" RowSelectionBrush="#FFA7DFF1" CurrentCellBorderBrush="DeepSkyBlue" >
                <Grid:SfDataGrid.Columns>
                <Grid:GridTextColumn HeaderText="User Name" MappingName="UserName"  Width="240" CellStyle="{StaticResource customCellStyle}" />
                <Grid:GridTextColumn  HeaderText="First Name" MappingName="FirstName" Width="200" CellStyle="{StaticResource customCellStyle}"/>
                <Grid:GridTextColumn  HeaderText="Last Name" MappingName="LastName" Width="200" CellStyle="{StaticResource customCellStyle}"/>
                <Grid:GridComboBoxColumn x:Name="cboGender"  HeaderText="Gender" MappingName="Gender" Width="200" CellStyle="{StaticResource customCellStyle}" DisplayMemberPath="GenderName" SelectedValuePath="GenderCode"  ItemsSource="{Binding genderList}"    />
                <Grid:GridTextColumn  HeaderText="Password" MappingName="Password" Width="200" CellStyle="{StaticResource customCellStyle}"/>
                <Grid:GridTextColumn MappingName="UserAccountCode" IsHidden="True"   />
                </Grid:SfDataGrid.Columns>
            </Grid:SfDataGrid>

 

HOW CAN I ACHIEVE THIS

 


Narayanasamy J [Syncfusion]
Replied On November 12, 2013 02:12 AM

Hi Joseph,

 

Thanks for using Syncfusion Products.

 

We have analyzed your query. You need to specify the Source Property for Binding in GridComboBoxcolumn.ItemsSource property, explicitly to meet your requirement.

Based on your requirement, we have prepared a simple sample and it can be downloaded from the following location.

 

Sample: ComboBox.zip

 

Please let us know if you require further assistance on this.

 

Regards,

Narayanasamy


Daniel Thompson
Replied On September 15, 2014 12:41 PM

Hi,

Can you make this sample available for download please? When clicking on your link I get 

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>0D5927F88300245D</RequestId>
<HostId>
agtepudrxExo5ljy5fvnxGULV0ee1lRKHks01lcfPb30dCcXytSSToZiCTWOI/i/UI6jbyKDqiY=
</HostId>
</Error>

Thanks!
Daniel

Jai Ganesh S [Syncfusion]
Replied On September 16, 2014 07:12 AM

Hi Daniel,

 

Sorry for the inconvenience caused.

 

The sample for the previous update is downloaded from the following location,

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/129504/ComboBox-690268664.zip

 

Please let us know if this sample helps you.

 

Thank you,

Jai Ganesh S


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.

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.

;