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?
 
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
 
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
CodeCruiserCommented:
What happens if you comment out this line?

  gvCashierEntryLines.UpdateCurrentRow();
0
 
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
 
mahmood66Author Commented:
U r absolutely right.... i got the solution...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.