Hello,
I want to use a database to store some key settings regarding a users toolbar. Most important is the position in the docked row, which I can see on the toolbarmodified event, under E.Toolbar.base.nonpublicmemebers.
There I see targetpositionindockedrow. How can I set this at runtime?
Thanks.
Since that property is under "nonpublicmembers", that means it's either private, protected, or internal, so you can't access it from your code. However, you can use the DockedColumn property of the Toolbar to determine where the toolbar shows in relation to the other toolbars in the row. The first toolbar would have a DockedColumn of 0, the second would be 1, etc.
Hi,
I understand that, and it is how I am storing the order in the Database. But if they position an Toolbar away from others...lets say all the way to the right where there is a big space between the leftmost toolbar and the rightmost
TOOLBAR #1 --------------EMPTY TRAY ---------------------------------- TOOLBAR #2
The only way I can load it back up the same is if I could set that nonpublic member. That or use the controls built in save settings...hmmmm
can i write the output of that to the database VS the userconfig file? That would make my life EASY>
You could use the SaveAsBinary() method of the UltraToolbarsManager object and store that output in a BLOB field in the database. Try that and let me know if it works.
Dangit, there is some issue today replying on the forms..page just does not load and you loose your reply.
Yes, that worked, and I got it all working. PS< it would get GREAT if you had a write up on how to do this with XML back to sql. I figured out as far as getting it into a XMLTextWriter...but I am not sure how to get it to a String to save in SQL, or how to save it in SQL as the XML datatype.
Writing:
dg.SetupSP("sp_UpdUserToolbar", true);dg.AddParameterVal(mJi.UserID);System.IO.MemoryStream s = new System.IO.MemoryStream();utbTotals.SaveAsBinary(s, true);Byte[] b = s.ToArray();s.Close();s = null;dg.AddParameterVal(b);dg.InitProcedure(true);
Reading:
System.IO.MemoryStream m = new System.IO.MemoryStream((Byte[])dg.SQLReader.GetSqlBinary(0));utbTotals.LoadFromBinary(m);m.Close();m = null;
I'm glad my suggestion worked. Could you please verify it so other users with the same question could find the answer?