Click here to Skip to main content
14,447,035 members
Rate this:
Please Sign up or sign in to vote.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100