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. Image for the cookie policy date

Databoundgrid Static???

How can I make cells in a databoundgrid and make them Static? When I use GridDataBoundGrid1(1, 1).CellType = "Static" ...I can still enter data into the cell John

3 Replies

AD Administrator Syncfusion Team February 20, 2003 08:43 PM UTC

You need to handle the PrepareViewStyleInfo event if you want to change style information for specific cells in a databound grid. The event is fired on cell-by cell basis. Check out the Grid\Samples\DataBound\GDBGMultiHeader sample. There you will find an override for this event. There should be also other samples that handle this event. Stefan


AD Administrator Syncfusion Team February 21, 2003 10:26 AM UTC

Stefan, Is there an easy way to disable entry into an entire column in VB.NET? Would you have a code sample, I am evaluating this toolset and like it alot, I just can't figure out the column locking. Thank you John O > You need to handle the PrepareViewStyleInfo event if you want to change style information for specific cells in a databound grid. > > The event is fired on cell-by cell basis. Check out the Grid\Samples\DataBound\GDBGMultiHeader sample. There you will find an override for this event. > > There should be also other samples that handle this event. > > Stefan >


AD Administrator Syncfusion Team February 21, 2003 12:47 PM UTC

You could actually do all that from designer. Just drop a GridDataBoundGrid onto a form and a valid datasource (from the Server Controls), e.g. the Customers table from Nothwind. Then select the grid. In the properties window select the correct DataSource and then search for the "GridBoundColumns" collection. Open its editor and add the columns to be shown in the grid. For each column, you can modify the style setting. There you can set CellType to be "Static" for the specific column you want to change. If you do not want to manually specify the columns to be displayed in the grid at design-time, then you could access InternalColumns collection in your forms OnLoad event instead: Dim supplierIDStyle As GridStyleInfo = hlCategory_Products.InternalColumns("SupplierID").StyleInfo supplierIDStyle.CellType = "Static" Stefan

Loader.
Up arrow icon