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

How to make my GridGroupingControl read only

I know this sounds easy but my code does not seem to be working. Attached you will find the InitializeComponent() code that the designer generated for my GridGroupingControl. This code correctly DOES NOT allow me to type alphanumerics in the cell.. but it DOES allow me to backspace and delete the contents. What obvious property am I missing.

4 Replies

AD Administrator Syncfusion Team July 7, 2005 04:41 PM UTC

Your code did not make it. Try setting these properties to see if this makes thing work as you need. this.gridGroupingControl1.TableDescriptor.AllowNew = false; this.gridGroupingControl1.TableDescriptor.AllowRemove = false; this.gridGroupingControl1.TableDescriptor.AllowEdit = false;

BW Brian Wright July 12, 2005 04:42 PM UTC

Sorry about forgetting the code.. and I have been on vacation so now I am ready to tackle this again. I already had the code you mentioned in my code. Perhaps I am setting something else that is overriding it? To clarify, the behavior I get is that I cannot type letters and such.. but I can set the focus to the cell and begin deleting letters using backspace, etc.. I would like for the user to not even be able to set the focus to the cell.. and certainly not to be able to delete text. I have now attached the code and it seems pretty vanilla to me. Any suggestions? support_556.zip

BW Brian Wright July 18, 2005 08:01 PM UTC

Any ideas about this?

AD Administrator Syncfusion Team July 18, 2005 09:10 PM UTC

This sounds like a defect in the version you are using. I checked it with our upcoming 3.3 build and just settingthose 3 properties makes it so the backsoace and delete key do nothing. In teh version you are using, try handling the TableControlCurrentCellStartEditing event and cancel it. This should avoid even the cursor appearing in the cell. private void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e) { e.Inner.Cancel = true; }

Live Chat Icon For mobile
Up arrow icon