ADAdministrator Syncfusion Team July 30, 2003 03:52 PM
For the column, you can set the style.ReadOnly = true and/or style.CellType = "Static". To set the column style, you use the grid.GridBoundColumns if you have explicitly added them, or you use the grid.Binder.InternalColumns if you have not explicilty added GridBoundColumns,
grid.Binder.InternalColumns.StyleInfo.ReadOnly = true;
grid.Binder.InternalColumns.StyleInfo.CellType = "Static";
SAscot adamsJuly 31, 2003 09:08 AM
and if I had boundgrid with realations (e.g. Customers and Orders) displaying using something similar to this
GridHierarchyLevel childrenLevel = this.grid.Binder.AddRelation("CustomerOrders");, how would I set specific rows in the child table as uneditable?
Also, if I have something like a checkbox in the child level row, how do I read the value? Using the format grid[row,col] will only read the value if the child row is expanded and visible.
ADAdministrator Syncfusion Team July 31, 2003 10:23 AM
The last request is trickier than the first. The problem is that currently the grid knows only what is being displayed. So, if there is a child list that is not expanded, the grid has no direct knowledge of it until the node is expanded and the data is retrieved from the relation.
So, if you have hidden information, then I think you would have to work directly with the dataset\tables\relations involved to retrieve what you want.
As far as making a particular row readonly, you can handle this because it only matters when the row is visible, and at that point, the grid does have knowledge of it. To do this, you would handle the grid.model.QueryCellInfo event. In teh event, you would use e.RowIndex, and get its GridBoundRecordState. From the GridBoundrecordState, you have information about the parent list, the hierarchylevel, and this row's position in the parent table. So, somehow, check to see if this row is a row you want to be readonly, and if so, set e.Style.ReadOnly = true.