Несвязанный столбец GridView в настроек выпадающем списке редактирования - WPF с частое
Using unbound column in Grid on Combo box edit settings. When i select the drop down and move into another row the previous row values are disappearing.
while load the grid if any values exists then that value is appearing fine
What I have tried:
<pre>The coding are below, please help
<dxg:GridColumn FieldName="TestField" UnboundType="String" AllowEditing="True">
<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings
ItemsSource="{Binding Path=dealPcode}"
ValueMember="PK"
DisplayMember="PorderCode"
/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
private void TagRegisterGrid_CustomUnboundColumnData(object sender, GridColumnDataEventArgs e)
{
var grid = sender as GridControl;
long temp=0,evalue=0;
try
{
if (e.Column.FieldName == "TestField")
{
if (e.IsGetData)
{
long val;
long pKey1 = Convert.ToInt32(Convert.ToString(e.GetListSourceFieldValue("PK")).Replace ("{}",string.Empty));
if (dataService.GetPurchaseOrder(pKey1).GetValue().Count() >0) // in the row PK value will be come (invisible)based on the key value will be //shown in dropdown
{
val = Convert.ToInt64(dataService.GetPurchaseOrder(pKey1).GetValue());
e.Value = dealPcode.FirstOrDefault(x => x.PK == val).PK;
}
else
{
e.Value = evalue;
}
}
if (e.IsSetData)
{
evalue = Convert.ToInt64(e.Value);
temp = dealPcode.FirstOrDefault(x => x.PK == evalue).PK;
}
}