BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
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
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
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