hi all,
i'm seeing something very strange with UltraDropDown columns that i have in my grid. are the UltraDropDown properties part of the displayout? i.e. savelayoutasxml(). is it possible that my layout is overwriting the visibility or capability of the UltraDropDowns ?
thanks
Al
found out the problem was CellActivation!
Hi Al,
You got there before I got a chance to look into this for you... Something sounded odd when you mentioned that it worked differently when deployed as opposed to in DEV. Everything cool?
thanks Matt. i've got to re-think my layout strategy when i use the wingrid. loading all layout categories, then applying formatting after the fact, then user is allowed to save layout on top of that. just a mess.
I know you are busy coding away... but I'm curious what's working and what isn't working from your point of view? What could we do differently here to make this a smoother process for you when saving/loading these layouts? There is more custom coding you are doing afterwards for some styling?
hi Matt,
well the layout features are great. the whole problem (for me), is that users of my app save their own layouts, then after the fact they request general layout changes like a field should be right aligned, or should be currency, or some column hidden. So the user that saved their layout originally is not going to have these additional changes. so i have to apply these layout changes at runtime directly after loadlayout.
...then they could say "save layout" again, which will now include the new changes. that's fine cause they'll be overwritten everytime. but i'm still required to apply changes after loadlayout.
does that make sense?
Hope mike is out here somewhere. i have a grid with 2 bands, and i want to hide the colheaders for the 1st band. No matter what i do i can't get them hidden. i'm not loading layouts or anything. just setting these properties at run time.
There's nothing especially tricky about this that I can think of.
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand rootBand = layout.Bands[0]; rootBand.ColHeadersVisible = false; }
If you are setting this property and it's not working, then something is re-setting it or changing it after you set it. Check the property value at run-time just to make sure it's still set to false. If not, then something in your code is changing it either by directly setting the property, loading a layout, or possibly loading a preset. Or, it could be getting reset if you set it and then set the grid's DataSource or DataMember (in which case basically the entire layout would be lost).
Al Maiz said:thanks Mike, i'm going in and literally commenting out any code that modifies layout at run time. i will find it. i keep seeing all your layout examples are occuring in the InitializeLayout event. is that the best way to do it?
Generally, yes. The InitializeLayout event fires whenever the DataSource is set (or reset), so it's a good place to initialize your grid's layout - hence the name of the event. :)
Al Maiz said:how do you reconcile/merge making changes to a general layout vs users custom layout? Once user saves their layout , there is no going back without them having to make all their changes again.
There's no really great solution to this. You basically have two choices. One is that you throw away any previous layouts the client was using any time you make a change to the layout on your end. That's the simplest way to do things, except that your clients have to re-create their layouts any time you make a change.
Another option would be to try to somehow merge the layout, or to change the layout in code AFTER you load the user's layout. For example, say you have a user who has a saved layout on their machine. Now you need to add a new column to the grid. So you add the column to your grid and now the user runs the new app and loads a layout that doesn't include the new column. So that's a problem. So what you could do is explicitly set that column to visible in code, after loading the layout. The only down side of this is that if the user tries to subsequently hide that column, the app will always show it.
What I've done to get around things like this in the past is that I version my layouts. Instead of saving the layout directly to a file, you can save it to a stream and so you can also add extra information into that stream, like a version number. Then what you could do is explicitly show the column only if the layout you just loaded is not the latest version. That way, the new column shows up the first time, but once the user saves a new layout with the new version number, you skip that code in the future.
thanks Mike, i'm going in and literally commenting out any code that modifies layout at run time. i will find it. i keep seeing all your layout examples are occuring in the InitializeLayout event. is that the best way to do it?
how do you reconcile/merge making changes to a general layout vs users custom layout? Once user saves their layout , there is no going back without them having to make all their changes again.
i use ultraGridWatch.SetDataBinding(m_dsCallSheet, "Tablename"); once to bind the grid on startup. then the underlying dataset is refreshed on a timer.