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.
Syncfusion Feedback

GDBG and readonly cell

Thread ID:

Created:

Updated:

Platform:

Replies:

35778 Oct 10,2005 07:35 AM UTC Oct 11,2005 10:05 AM UTC Windows Forms 3
loading
Tags: GridControl
Michael Cruanes
Asked On October 10, 2005 07:35 AM UTC

HI, I am using following code: DataColumn colName = new DataColumn("Name"); DataColumn colComment = new DataColumn("Comment"); DataTable myTable = new DataTable("MyTable"); myTable.Columns.Add(colComment); grid.DataSource = myTable; I cannot edit the cells. How to make the Comment column editable. Thanks, Michael

Administrator [Syncfusion]
Replied On October 10, 2005 07:59 AM UTC

If I drop a GridDataBoundGrid on a form and add your code to the forms''s Load event handler, I do not have a problem adding new rows. Here is what I tried. http://www.syncfusion.com/Support/user/uploads/GdbG_Simple_3b5a63b6.zip Search your code for ReadOnly settings, AllowEdit settings, and AllowAddNew settings to see if you have some property set that might be interferring with this behavior. If you can upload a sample showing the problem we can try to spot something here.

Michael Cruanes
Replied On October 11, 2005 09:41 AM UTC

Sorry Clay, My problem was not well formulated. I want the whole grid not editable but only the Comment column should be editable. What is the best way to do that ?

Administrator [Syncfusion]
Replied On October 11, 2005 10:05 AM UTC

If you want to do it through property setting, then you can set the GridBoundColumn.StyleInfo.ReadOnly = true for all columns you want to be readonly. If you are not explicitly adding GridBoundColumns, then you set this property in the grid.Binder.InternalColumns collection. If you are adding GridBoundColumns, then you set this property using the grid.GridBoundColumns collection. Or you can use the grid.Model.QueryCellInfo event. there if e.ColIndex does not point to your comment column and e.RowIndex > 0, then 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.

Warning Icon 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.Close Icon

;