Hello everyone,
I have searched for this and I'm sure the answer is out there but I haven't been able to find it. I want to be able to edit the first cell in every column within a band.
I tried a few things like cell activation and also setting the datacolumn to ReadOnly = false;
Neither of these things work. Any help is much appreciated. Thank you!
RichSee said:this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
Didn't you say it was column 1 that wasn't allowing you to edit?You are specifying Column 0 here, so you might have the wrong index. I recommend using the column's Key rather than the index to avoid any possible confusion.
Is it only the one column having a problem? Can you edit other columns?
Have you tried reading out the property settings you have set here to make sure they are all still set to what you set them to at run-time? Put a button on the form and Debug.Writeline all of these property values to make sure they are not getting overwritten.
What kind of data source are you binding to? It looks like it's probably an UltraDataSource, so that should be all right.
Try putting a new grid control on the form and bind it to the same DataSource you are using for the real grid and see if the new grid allows editing.
If you want to post a small sample project demonstrating the issue, I would be happy to take a look at it and tell you exactly why you cannot edit the column.
Hi Mike,
Again thanks for all your help. I dont know why setting these to allowEdit/true...ect wouldnt work. Im at a real loss as to why this isnt working. : / Listed below are all the methods I have tried congruently. You mentioned that possibly the datasource might not allow editing. Is there any code for this you might be able to direct me to? Thank you so much for your time!
this.ultraGrid1.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True; this.ultraGrid1.DisplayLayout.Bands[0].Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True; this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
ultraGridColumn1.CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ultraDataColumn1.ReadOnly = Infragistics.Win.DefaultableBoolean.False; ultraDataBand1.ReadOnly = Infragistics.Win.DefaultableBoolean.False;
ultraGridBand1.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
Hi,
There's no property you have to set to enable editing. Editing is enabled by default, without setting anything. So if you are unable to edit, it's because something in your application is explicitly disabling editing.
The KB article gives you a fairly complete list of all the ways in which you might have disabled editing. So if you have searched your code for all of those possible ways and you can't find anything, then there are only a few other possibilities.
Thank you for your response. I thought for sure this example code was going to fix my problem. I did not create the grid through the designer and Im finding out now that Im running into a few places where the normal defaults are not being set. I did add this code below in the designer.cs file but it still didnt allow the cell in column 1 of band one to edit the text.
Im not sure if there is another property that is preventing this that didnt get set because I hand coded the whole thing? Any help is much appreciated.
//Code added to the grid (didnt enable the editing of the cell text)
this.ultraGrid1.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True; this.ultraGrid1.DisplayLayout.Bands[0].Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True;
All cells in the grid are editable by default. So if you are unable to edit any cell, it's either because you have disabled editing in the grid, or because your data source does not allow editing.
Here's a link to a KB article that describes how to disable things in the grid. That should point you in the right direction in terms of what to look for in your code.
HOWTO:How can I make a grid or a column, row, or cell in the UltraWinGrid disabled or read-only?