Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
How do I decode a layout byte array without loading it into a gird?
posted

I save layouts to a stream using:

  grid.DisplayLayout.Save(stream, flags);

which I save to the database as a byte array.

Then, when I want to load the layout, I use:

  grid.DisplayLayout.Load(stream);

So far so good.

The problem I am having is that I need to know what columns a user has displayed, but without loading the layout into a grid (basically business logic related to visible grid columns is in an area of the application that does not have a grid displayed, not does it make sense to display one).

When I try to decode the layout byte stream:

  Encoding.Default.GetString(layoutByteArray);

The data is not easy to decipher, below is a snippet:



I notice that it contains null terminators, control codes, and other odd characters.

Is there a way to decode this?