DevX - Xtra Grid Problem

I am using a Dev Express Xtra Grid for two functions
1. saving a new set of data (New)
2. opening the saved one and updating (Update)

I am able to enter new details and save it, Then  am trying to open the saved one and try to add a new row, when i am typing a value in a cell and clicking the next column, the whole row is getting disappeared...

In the attached image,
When i am trying to change the weight field and click another cell.. the entire row is displaying.
1.bmp
mahmood66Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
Do you have any validation code in? Do you have any constraints in the dataset(or db)?
0
mahmood66Author Commented:
Yes .. there are some validations for every click...
with respect to the deduction and Weight, Net Weight is calculated....

For your information,
when i commented this validation, the row is not dis appearing but when clicking on the next row, the row disappears.

Check the code below,
 oNetWeight = Convert.ToDouble(oWeight) - Convert.ToDouble(oDeduction);
  gvCashierEntryLines.SetRowCellValue(e.RowHandle, gcolNetWeight, Math.Round(Convert.ToDouble(oNetWeight), 2));
                    gvCashierEntryLines.UpdateCurrentRow();


is there any problem with the validation?
 
0
CodeCruiserCommented:
What happens if you comment out this line?

  gvCashierEntryLines.UpdateCurrentRow();
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

mahmood66Author Commented:
i removed that line in  all the validations, now the status is... Row is not disappearing when i click any cell in the same row but, row gets disappeared when i click another row...
0
CodeCruiserCommented:
What constraints do you have in your db(not null etc)? Looks like the dataset/datatable refuses to accept the row?
0
mahmood66Author Commented:
There are some not nulls, but i am not giving any null value... should i set some property for the grid..
0
CodeCruiserCommented:
So you are filling the whole row with valid values? Do you have the cell validation or row validation?
0
mahmood66Author Commented:
I am using the same link which we are using from computer to view camera but it is not working in BB set.
0
mahmood66Author Commented:
soory ignore my last comments its related to other question.
0
mahmood66Author Commented:
I have written code for validations in the following events,

Cell value changing, cell value changed, validating editor, Init New row,
 I have attached the code also
Code.txt
0
CodeCruiserCommented:
Remove the UpdateRow call from all the methods.
0
mahmood66Author Commented:
I tried that also... but same issue remains...

i also tried commenting all the events of that grid, even then the values in the row dis appears when i click some other row.

when i checked in the focused row changed event, the values are there, i think after that something is happening.... may be not binding to the data set...  

Note : The values in the row gets dis appear when the current row looses its focus..
0
CodeCruiserCommented:
Show the databinding code(where you set the datasource related properties).
0
mahmood66Author Commented:
           object oAutoIndexForDetail = lkPO.EditValue;
            DataView  dv = Supplier.getPOsListDetail();
            if (oAutoIndexForDetail != null)
            {
                dv.RowFilter = "iInvoiceID = " + oAutoIndexForDetail;
                gcCashierEntryLines.DataSource = dv;
                       
            }
 public static DataView getPOsListDetail()  
        {
            try
            {
                string strQuery = @"SELECT dbo._btblInvoiceLines.iInvoiceID,dbo._btblInvoiceLines.idInvoiceLines,dbo.SM_POCashierEntryLinesData.idPOCashierEntryLines as SmpoId ,iStockCodeID, dbo.StkItem.Description_1  AS cDescription,
                                dbo.SM_POCashierEntryLinesData.fWeight + dbo.SM_POCashierEntryLinesData.fDeductionInWeight AS fWeight, dbo.SM_POCashierEntryLinesData.fDeductionInWeight,
                                dbo.SM_POCashierEntryLinesData.fWeight as fQuantity, dbo._btblInvoiceLines.fUnitPriceExcl,
                                dbo._btblInvoiceLines.fQuantityLineTotExcl, dbo.SM_POCashierEntryLinesData.cType,iUnitsOfMeasureID as idUnits, dbo.SM_POCashierEntryLinesData.cWTNo,iWarehouseID, iWarehouseID as WhseLink, _btblInvoiceLines.iInvoiceID
                                FROM dbo._btblInvoiceLines INNER JOIN
                                dbo.StkItem ON dbo._btblInvoiceLines.iStockCodeID = dbo.StkItem.StockLink INNER JOIN
                                dbo.SM_POCashierEntryLinesData ON dbo._btblInvoiceLines.idInvoiceLines = dbo.SM_POCashierEntryLinesData.iInvoiceLineId
                                ORDER BY dbo._btblInvoiceLines.iLineID";

                SqlDataAdapter daGetPOListDetail = new SqlDataAdapter(strQuery, Constants.SqlConnection_CompanyDB);
                if (dsPOsDetail == null)
                {
                    dsPOsDetail = new DataSet();
                }
                else
                { dsPOsDetail.Clear(); }
                daGetPOListDetail.Fill(dsPOsDetail);
                DataView DV = new DataView(dsPOsDetail.Tables[0]);
               
                DataTable dt = new DataTable() ;
                return DV ;
            }
            catch { throw; }
}
0
CodeCruiserCommented:
>gcCashierEntryLines.DataSource = dv;

I think DataView is readonly. Try this

DataTable temp = dv.ToTable();
gcCashierEntryLines.DataSource = temp;

Then use this temp table to read the edited values.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mahmood66Author Commented:
U r absolutely right.... i got the solution...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.