Datagrid row height doesnot shrink back - silverlight

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.

Related

WPF - overlay text on top of datagrid row

I have a WPF datagrid where certain rows will be disabled. In addition to disabling the cell contents, I'd like to present to the user some text that overlays the row with an explanation such as "Row disabled due to ...". Basically the same effect of having a label control with a lower z-order sitting directly in front of the datagrid row's cells.
If cell text spillover was possible (like in Excel), I could create a text column of 0 width with the message, then let the message runover through the neighboring cells. But to my knowledge this type of text spillover isn't possible in the datagrid.
If your rows have fixed height, you could add a another transparent datagrid on top of the other datagrid. The transparent datagrid would have one column which would show the disabled explanation. Simple but hacky solution.
The proper way would be to use adorners.

WPF Tabcontrol : Find number of rows created to show all tab headers

I have a dialog which shows a tab control, I have all the logic in place to figure out the largest tabitem it then this size is used to resize my dialog. It all works fine if I have a single row of tab items, if multiple rows get created then i am not able to calculate the height properly because I dont know how many rows of tabs were created.
How can I find out the number of rows that were created to render all tabs?
Update:
SizeToContent = SizeToContent.WidthAndHeight; works when I want the dialog to autosize, now I also want to have a fixed size dialog, here, I want to override the size of my tabitem content to be (dialog height - buttons below the tabcontrol - number of tabrows * tab row height), so the question still stands.
Also, SizeToContent leaves a single line at the bottom of my dialog, which disappears when you try to resize the dialog, I tried invalidating the visual, but it does not help, any ideas?

Expander with GridSplitter

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.

Spreading controls to fill space as a dialog resizes

I have a dialog with column down the right side filled with buttons. The dialog is built with Windows Forms. I have a mockup at the following link:original dialog
(I would have included it but apparently i'm not allowed to use image tags)
I would like for the buttons in the right column to resize themselves to fill the remaining vertical space when the dialog resizes. It doesn't particularly matter to me whether or not buttons simply increase in size or whether the buttons remain the same size while the gaps between them increase. I'm simply want the buttons to go from the top to the bottom. (I have a mockup for this as well but apparenlty i can only include one link)
I've tried hosting the buttons in a FlowLayoutPanel but they do not increase as the dialog stretches, I only get whitespace at the bottom after I run out of buttons. I also tried a TableLayoutPanel and had the same result but I may have misused it. Does anyone have any ideas how I could accomplish this?
Thanks in advance,
Jeremy
To get you started. Use the TableLayoutPanel, set its Anchor property to top, bottom, left, and right. Set the rows and columns to percentages as needed. I suggest each control have it own cell. Note that each control in a "cell" can have its Dock and Anchor property set as needed.
You can do this with a TableLayoutPanel. Create a column for the buttons, with each button having it's own row / cell in the column. Set each row to be an even percentage for height (if there are 10 buttons, each row would be 10%), and dock the TableLayoutPanel to the right side of the screen. Then, put the buttons into their rows and set them to full docking. Then, when the dialog expands, the TableLayoutPanel will expand to fill the entire right side of the screen, each row will adjust proportionally, and each button would expand to fit the new row size.
You may have to adjust this a bit to fit your needs, especially in how it relates to the other content in the window.

Datagridview scrolling/last row problem (.Net Winforms)

I have a grid with 7 and half rows visible. I have managed to display the last row fully but the half row space after the last row does not repaint and shows whatever was there previously. Even if I drag another window over my form with the grid and then minimize it, the empty space shows content of the minimized window.
I've tried Invalidate() but no luck.
Hope you understand.
Any help appreciated.
I had this exact problem. I tried all sorts of craziness. In the end, what worked, was that I would hide / show the datagridview control after I inserted a row.
Hope this helps...

Resources