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

Cell readonly property

Thread ID:

Created:

Updated:

Platform:

Replies:

11431 Mar 5,2004 12:31 PM UTC Jun 16,2004 06:04 PM UTC Windows Forms 5
loading
Tags: GridControl
Philip Bishop
Asked On March 5, 2004 12:31 PM UTC

I am trying to set individual cells to readonly under certain circumstances and then be able to then turn it off and make the cell editable during other circumstances. I know there was a bug with the readonly proper and setting it in the ide and it not being able to be turned off. Is this the same problem if u set it in the code? I have attached a sample where i load 10 rows with text and set the readonly to true. If u click the button on the form it should change the text. I cant make that work. It ignores me changing the readonly back to false. Thanks Phil ReadOnly_7874.zip

Administrator [Syncfusion]
Replied On March 5, 2004 12:58 PM UTC

If a style is set ReadOnly, then you cannot change it, even programatically. (This means you cannot change the style.ReadOnly property either.) So, to handle this process of changing ReadOnly styles, there is a grid wide flag that you can set to tell the grid to ignore ReadOnly settings, and this will allow you to make changes. //turn off readonly this.grid.IgnoreReadOnly = true; // change your styles... //.... //turn readonly back on this.grid.IgnoreReadOnly = false;

Philip Bishop
Replied On March 5, 2004 01:57 PM UTC

Clay, Ok I am confused about when u said the "style.ReadOnly " property. In the sample I never set a style property unless thats what it does when i use the following line of code gridcontrol(1,1).readonly = true. I guess I am confused about that because of a direct trac incident that another programmer with us had. The number is 5567 and in that you said that it is a bug in the ide but that you can set it in the code? Are we talking about differnt settings here. Phil

Administrator [Syncfusion]
Replied On March 5, 2004 02:33 PM UTC

GridControl(i,1) returns a GridStyleInfo object, so yes, you are setting ReadOnly on style objects. The incident you referred to was strictly at design time, not runtime. Did you try what I susgested? I think it should work. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click GridControl1.IgnoreReadOnly = True Dim i As Integer For i = 1 To 10 GridControl1(i, 1).ReadOnly = False GridControl1(i, 1).CellValue = "Reset" Next GridControl1.IgnoreReadOnly = False End Sub

Charles
Replied On June 16, 2004 05:24 PM UTC

I''ve tried as you suggested as follows: DataGrid1.DataBoundGridModel.IgnoreReadOnly = true; DataGrid1.DataBoundGridModel[2,4].ReadOnly = true; DataGrid1.DataBoundGridModel.IgnoreReadOnly = false; The difference is that I want the value on ReadOnly property on the specific sell to remain True. The issue is that the ReadOnly property never sets to true when I step through it in the debuggger. Thanks, Charles

Administrator [Syncfusion]
Replied On June 16, 2004 06:04 PM UTC

The grid where we showed the code was a GridControl. It looks like you are trying to use a GridDataBoundGrid. You cannot set cell specific properties (other than CellValue) in a GridDataBoundGrid. Instead, you have to use an event like grid.Model.QueryCellInfo or grid.PrepareViewStyleInfo. Check out this KB. http://www.syncfusion.com/Support/article.aspx?id=10351

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

;