I have a GridView with n number of items. Only 50 are loaded in at a time. Is there a way to jump the GridView control to a specific index without just scrolling through the GridView until that item is available? I dont want to do it that way for obvious visual and memory reasons.
Thanks,
Dom
I'd look into ISupportIncrementalLoading to support data virtualization. That way your ItemsSource might say it has 1000 items, but not load them all and your GridView will be able to skip to say 600-700 range and your ItemsSource will only load the items from that specific range. You can then use the ScrollIntoView() method to do the actual scrolling to the specified item.
Related
I have a use case where I have a sidepanel containing Searchbox, Some MessageBoxes and two lists which get filtered when user searches for something.
The searchbox and messagebox occupies the fixed height but I want both the lists to occupy equal height and grow if the browser resizes.
Also would be nice to shrink the list if there are less items in one of the lists to give more room to the other one.
Here's what the UI looks like...
I'm currently trying to calculate the height and assigning the height to both the lists manually on browser resize event but I was wondering if there's a better way to do that.
Thanks in advance :)
Use a Stack component, specifying the grow attribute on the Stack.Items that wrap your lists.
https://github.com/microsoft/fluentui/blob/master/packages/office-ui-fabric-react/src/components/Stack/examples/Stack.Vertical.Grow.Example.tsx
I'm developing the custom UI layout system for our custom SBO forms. I.e. catching form's resize event and arranging the controls according to our specific layout logic. The problem is that, apparently, SBO tries to arrange controls according to its (clunky and primitive) logic on every form resize first! My code handling the resize event and rearranging the items works, but there is a noticeable performance delay, as items are essentially re-positioned twice on each form resize - once by SBO itself, and then by my code.
Is there any way to stop SBO arranging controls on our custom forms during resize, so that they will be positioned only once by my code (in the resize event handler)?
This page by Boyum IT helps to explain what the resizing rules are.
There's additional information on this page
To summarize those pages, every form is split into 4 quadrants, which are effectively pinned to the corners of the form that they belong to.
That means that as you resize the form, these quadrants separate from each other, leaving large sections of space between them.
I don't believe that there's an easy way to prevent this behavior out of the box, but you can manually override it using the B1 UI API, by setting the LinkTo property of the Items to match the ID of one of the Items in the top left quadrant, which causes the given item to move with the same behavior as that of the item specified in LinkTo.
I have a DataRepeater in which I have a Label (LabelID) and a GroupBox which contains RadioButtons. I am binding the Labels to a column from a DataTable and what I wish to do is to give the user the chance to select one of the Radio Buttons within each cell of DataRepeater and then upon progress I wish to read the user's selection for each cell. The problem is that when the user starts selecting the radio buttons and scrolls down to select radio buttons for other cells within the DataRepeater, the previous selections change or even the ones that user has not selected yet get selected. I have no idea why this is happening.
Here is the code for what I have done:
LabelID.DataBindings.Clear()
LabelID.DataBindings.Add(New Binding("Text", SomeDataTable, "SomeID"))
myDataRepeater.DataSource = SomeDataTable
I added the GroupBox which contains the RadioButtons in the Visual Studio drag and drop framework.
I tried the following binding as something that I thought might solve the problem, but it did not.
GroupBoxSelection.DataBindings.Clear()
GroupBoxSelection.DataBindings.Add(New Binding("Tag", SomeDataTable, "SomeID"))
I know it has something to do with scrolling the DataRepeater up and down. Because I increased the size of the DataRepeater to get rid of the ScrollBar and this strange behavior won't happen anymore. I cannot keep the DataRepeater that big so I would like to find another solution.
Any help will be appreciated?
I don't know how the DataRepeater works exactly but I wouldn't be surprised if it reused controls to increase performance. If so then your controls may be retaining their values as they are moved. What you might try is creating a user control to contain the RadioButtons and expose a single property that you can then bind. If an instance gets reused then the binding should update correctly as it does for the other controls.
Very weird situation going on with a FlowLayoutPanel...
I have been dynamically adding user controls to my panel. This user control has a height of 105. If I have my FlowLayoutPanelwidth to only show 1 "column" of controls, it will only display 296 of them. The rest of the controls are grayed out at the bottom of the flowlayoutpanel. If I widen the flp to allow 2 "columns" of controls, I can see 592 of them, with the remainder grayed out at the bottom. I have gone in and resized the user control to make it shorter in height, which works in some respects (i.e. it works when I have two columns, but not just 1), and can go forward with this work-around.
So, I guess my question is, why does the FlowLayoutPanel behave in this fashion? It seems (based on what I saw) that there is a limit to how much data the FLP will show at one time.
Your comment just reminded me that when you're adding many controls to any container it is a good idea to do this:
YourPanel.SuspendLayout();
// populate panel with controls
YourPanel.ResumeLayout(false);
This in effect stops the container (panel) from re-rendering itself every time you add a control until you're done adding controls. In the very least your panel creation will be smoother and faster. Not sure if this might fix your issue or avoid the need for a hack with PerformLayout.
If you look at your Form's designer file you will actually see this in action in the InitializeComponent function.
I have a listbox in a WP7 application and I would like to retrieve a list of visible items in the listbox. Actually, I am trying to retrieve the object that is visible so that when my application is tombstoned, I can resume it and write listbox.ScrollIntoView(lastVisibleItem);
If it matters, listbox is bound to a collection of custom objects with a datatemplate for customizing the way it looks.
Thanks in advance.
It's possible to work out how far the list has been scrolled using the technique detailed in this answer.
You could then calculate which item(s) are displayed based on the size of the list and the height of the items displayed.
If different items can be diffferent sizes then this becomes more difficult as you need to consider the height of each individual item.
You also need to remember that only part of an item may be displayed.