We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

DataBoundGrid Editable Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

6101 Jul 30,2003 02:04 PM Jul 31,2003 11:23 AM Windows Forms 3
loading
Tags: GridControl
scot adams
Asked On July 30, 2003 02:04 PM

How do I make all but one the columns in a DataBoundGrid editable? Right now I can only seem to make it all or nothing.

Administrator [Syncfusion]
Replied On July 30, 2003 04: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[2].StyleInfo.ReadOnly = true; grid.Binder.InternalColumns[2].StyleInfo.CellType = "Static";

scot adams
Replied On July 31, 2003 10: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.

Administrator [Syncfusion]
Replied On July 31, 2003 11: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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;