Expander with GridSplitter - wpf

I've a grid splitter before to the expander(which exists in the right side of a wpf window) and when i was running the app i need to use grid splitter to see more data from expander after its expanded, but the problem is when i was drag splitter i'm getting full view of my expander irrespective of original width but after click on expander to collapse it won't go to its original position by maintaining the splitter dragged width. So any one help me how can i send back expander to its original position.
Thanks,
#nagaraju.

Once you have used the splitter the grid column widths will no longer be 'auto'.
One solution is to respond to the collapsed event of the expander and reset the width of the first column to auto using column.Width=GridLength.Auto;

As you are resizing the contents of the Expander it may make more sense to place the GridSplitter inside the Expander, and on the outside you just have a normal Grid which makes the cell where the Expander is size to content.

Related

Can I drag a gridsplitter using an image that floats above it?

I have a vertical gridsplitter with a column width of 10 pixels. I've floated an icon over the top of it, and using a multibinding, this icon stays centred on the gridsplitter (so it follows the gridsplitter as it's dragged left and right).
Is there a way I can (a) allow the user to the drag the icon only left and right within the grid (I'm guessing by tracking the delta values?), and (b) bind the grid column widths to its position, so that the gridsplitter effectively follows it?
I can see a very rough solution in my head, but I'm wondering if I'm overcomplicating things - maybe there's a simple way to do this through binding?

WPF Stretch Middle Content in DockPanel or Stackpanel

How do I stretch the content in the middle section of a Stackpanel or Dockpanel. I know that a dockpanel will stretch the last item but I need to stretch the middle item. I know that I could use a grid with * for the middle section but I want to be able to set the left and/or right items as collapsed depending on my window size.
You should still use a DockPanel with LastChildFill setted.
Your DockPanel will stretch the last element you put in it, not the last one according to view.
So you can put the element you want to stretch in the last position and use DockPanel.Dock="Top/Bottom/Right/Left" on others one.

Show/hide Grid Row when mouse is over grid

I have a Grid with two rows which are aligned at the bottom of my window.
By default the top row is always visible and the bottom is hidden. What I would like is when the mouse is over the grid, for the bottom row to display with animation rising up from the bottom.
Could someone help me with this.
Put the buttons in a panel, say a StackPanel, and place the StackPanel in the bottom row.
Then add a RenderTransform to the panel and animate the transform.

Datagrid row height doesnot shrink back

I have a data grid, in each row I have one cell which needs to have a very lengthy text which is about 1000 characters long. So I decided to put the text in the expander control keeping the cell width fixed, when the user wants to read the text, he clicks on the expander to open and reads it.
The row height automatically grows when the expander is expanded but when the expander is collapsed back, the row height doesnt shirk. Can anyone pls tell me how to set the row height back after the expander is collapsed?
i tried the follwing link.
http://forums.silverlight.net/forums/p/133177/299186.aspx#299186
but this did not work
any help would be grealty appreciated,
thanks
i was not able to solve this problem using SL control.
alternate solution to this is use silverlight telerik grid control. where we can solve the problem.

How do I get content to realign around an expanding/collapsing WPF Expander?

Right now I have a Stackpanel, that contains a collapsed Expander, and a Listbox.
The Listbox beneath the collapsed Expander is being positioned as if the Expander was expanded. Is it possible for the StackPanel to dynamically do layout based on the collapsed size of the Expander, and then on the Expanded size of the Expander once it's been clicked on?
Thanks for your help.
After a bunch of documentation reading, I determined what my problem was.
If you explicitly set the height of the Expander (in a vertical layout) then it will always use that size in a StackPanel. If you set the height to "Auto" then it will use the contents of the Expander for the expanded size, and the collapsed size of the Expander when it's collapsed.

Resources