Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
Ultragrid trying to write in a cell and error message says "The column is read only" but this is not trueHello H
posted

Hello, My Name is Paolo Bertoldo, from Italy

I am testing the evaluation of Ultimate UI for Windows forms 

I use VB.NET Language

Database is SQL Server 

I have a form bounded with a datasource, table adapter and bindingsource created with the designer.

The form uses UltraWinGrid for display data from a table called "Manuafctured"

One field of the table is "ProductID, contains primary keys, it is connected to another table called "BOM" with a UltraDropDown with Datasource, DisplayMember, and ValueMember, the display member is the product description (From BOM table) , and it works fine.

But here is the problem (sorry for the long description but it is a little complicated)

I have to display a value coming from the "BOM" table (it is called "StdWidthIn" and contains the width in inches of the product selected "ProductID")

For this purpose I have modified the SQL Query like this :

SELECT (This part is omitted for simplicity) ,
(SELECT StdWidthIn FROM BOM WHERE Manufactured.ProductID = BOM.ID) AS BOMStdWidthIn,
(SELECT Passes FROM BOM WHERE Manufactured.ProductID = BOM.ID) AS Passes
FROM dbo.Manufactured
WHERE (((Manufactured.LengthMt)=0))
ORDER BY RollNo, InputDate DESC, MfgDate, Manufactured.Customer

The query has nested SELECT statements but the most important is this :

(SELECT StdWidthIn FROM BOM WHERE Manufactured.ProductID = BOM.ID) AS BOMStdWidthIn

In the grid what appears is the alias "BOMStdWidthIn"

During form load eveything works fine, the correct data is displayed depending on the selected "ProductID"

When I try to change a "ProductID" selection via the "UltraDropDown" have written a code in the "AfterCellListCloseUp" event of the grid to modify the "BOMStdWidthIn" column according to the new value but this error appears:

The column "'BOMStdWidthIn'" is read only

The piece of code is this : e.Cell.Row.Cells("BOMStdWidthIn").Value = [some value here]

even if I try to edit it manually it is not possible but the "CellActivation" value is "AllowEdit"

My consideration is that maybe the grid cannot write a value in a column coming from the alias "BOMStdWidthIn" that is related to another table ("BOM") , not the table directly connected with the grid ("Manuafctured")

But I am not interested in changing the "BOMStdWidthIn"  value, only display in the grid.

Hope the description was exhaustive

Thank you

Paolo Bertoldo

Parents Reply Children
No Data