Click here to Skip to main content
15,905,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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;                                                
                    }
                }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900