I have a datagrid (having all columns as DataGridTextColumn) showing data of a child table. Now there are some columns which are bringing a Foreign Key value from Parent Table.
<UserControl x:Class="DMS.Presentation.CustomerWorkSpaceView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DMS.Presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<DataGrid Name="datagridCustomers" AutoGenerateColumns="False" Loaded="datagridCustomers_Loaded" IsReadOnly="True">
<DataGrid.Columns>
<DataGridTextColumn Header="ID" Binding="{Binding Path=ID}"></DataGridTextColumn>
<DataGridTextColumn Header="Name" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="Contact No" Binding="{Binding Path=ContactNo}"></DataGridTextColumn>
<DataGridTextColumn Header="Company ID" Binding="{Binding Path=CompanyID}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</HeaderedContentControl>
</ScrollViewer>
</HeaderedContentControl>
</Grid>
What I want to Do
If user edits the cell of a Foreign Key column (say Company ID), it should start suggesting it the possible values (just like Twitter starts suggesting the names using AJAX the moment we type @ or # - refer to screenshot).
By Possible Values I mean
Simply the rows of COMPANY table. I want to get the result of this query as possible values:
SELECT * FROM COMPANY
WHERE ID LIKE '%@IDEnteredValue%'
(where IDEnteredValue means value entered in cell of ID in our grid)
I ONLY need its Front-end Implementation