My question is related to the fact, that I missing feature in the UltraGrid which will work similar to "Enabled" property but when it set to false it will not disable the scrollbars. The problem with DisplayLayout.Override.AllowUpdate is that the grid actually doesn't look as disabled and it even allows entering cells to the edit mode which is very user unfriendly. Can you please add the feature request?
So for now I try to implement this functionality by myself but I have a problem that when column is being added to the grid which is "disabled" (I set all columns' CellActivation to Disabled) it is "enabled". I found that there is SubObjectPropChangeEvent being fired from ColumnsCollection, but I don't see how to determine the new column. (In case of add it is possible - it will be the last one, but what to do with insert?)
Regards,Maxim Golubitsky.
In short my original post is about that, that I miss functionality in the UltraGrid that will make it disabled and look as disabled while the scrollbars will be enabled. When I tried to implement it by myself I came to the problem that a newly inserted column will be "enabled" when the grid is "disabled". Your solution will work, but it is not "beautiful" solution. One of previous repliers gave me idea how to "seamlessly" solve the issue, but thank you anyway.
I had trouble interpreting your original post, but if it relates to the subject of getting a column notification when one is created, why not use extension methods? If you're able to switch the project over to the 3.5 .NET framework in the project properties then the snippet below could be useful. It's not a notification, but you can take control of the Add/Insert method.
public static class UltraGridExtension { public static UltraGridColumn Add(this ColumnsCollection columns, string key, string caption, string unused) { UltraGridColumn gridColumn = columns.Add(key, caption); //Do processing on the created column return gridColumn; } public static UltraGridColumn Insert(this ColumnsCollection columns, int index, string key, string unused) { UltraGridColumn gridColumn = columns.Add(index, key); //Do processing on the created column return gridColumn; } }
If I was way off from what you were asking, just ignore this reply. Also, if you use these extension methods, remember to use the correct override of the Add/Insert methods that we created.
P.S. If you don't want to be as fancy with extension methods, the regular Add/Insert methods return the new UltraGridColumn that you can read/write properties from.
Maxim,
I will submit this as a feature request.
Michael S.
OK, thanks, you gave me idea. When column added I'll rebuild my structure where I hold original CellActivation of each column. But why I should do your job? Please add feature request as I described in the beginning of the thread ;-)
MbG said: I mentioned DisplayLayout.Override.AllowUpdate since it was provided as a solution to the similar question posted here and I explained why it doesn't fit my needs. In my case the column is unbound, so I think your solution can't help.
I mentioned DisplayLayout.Override.AllowUpdate since it was provided as a solution to the similar question posted here and I explained why it doesn't fit my needs.
In my case the column is unbound, so I think your solution can't help.
Every column in the grid has a CellActivation property - it makes no difference whether the column is bound or unbound. You would, of course, have to loop through all of the column, but that's pretty easy. :)