Search Results

Search found 8 results on 1 pages for 'virtualmode'.

Page 1/1 | 1 

  • Is WinForms ListView in VirtualMode limited to 100,000,000 rows?

    - by damageboy
    I have some grid scenario with 500,000,000 rows I would like to display in ListView. If I artificially limit my ListView to display 100,000,000: _listView.VirtualListSize = _data.Count; if (_listView.VirtualListSize > 100000000) _listView.VirtualListSize = 100000000; Everything works fine (In VirtualMode naturally). When I change my code to: _listView.VirtualListSize = _data.Count; if (_listView.VirtualListSize > 100000001) _listView.VirtualListSize = 100000001; The ListView display an empty grid... Is this a Microsoft Bug? Where is this coming from? Is this a Win32 ListView limitation? Most importantly, why is this not documented?

    Read the article

  • Using VirtualMode on a DataGridView when the number of rows/columns isn't known

    - by Nathan Baulch
    I need to display an unknown length sequence of dictionaries with unknown keys efficiently in a data grid. This sequence is the result of a potentially slow LINQ query that could contain any number of results. At first I thought that VirtualMode on DataGridView was what I was looking for but it appears that the number of rows and columns must be known upfront. I tried adding a single row and column then adding more as needed from the CellValueNeeded event but this doesn't work. Is this even possible with VirtualMode? Or do I need to estimate how many rows are visible on the screen and manually build up the rows/columns? And if so, how do I ensure that a vertical scrollbar is present and react appropriately when a user uses it?

    Read the article

  • Is there a workaround for Linux mono's refusal to acknowledge that I have resized the columns of my

    - by fantius
    When I resize a column, it does not redraw the data with the updated alignment. I've tried Invalidating, Refreshing, and a few other things. Nothing has worked. Does anyone know a workaround? I have not tried this in mono for Windows. To see what I mean, drop this control on a form, and run it in mono for Linux: using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing; class MyListView : ListView { private readonly List<ListViewItem> items_ = new List<ListViewItem>(); public MyListView() { VirtualMode = true; Columns.Add("Col 1"); Columns.Add("Col 2"); Columns.Add("Col 3"); Add(new ListViewItem(new[] { "a", "b", "c" })); Add(new ListViewItem(new[] { "a", "b", "c" })); Add(new ListViewItem(new[] { "a", "b", "c" })); Add(new ListViewItem(new[] { "a", "b", "c" })); Add(new ListViewItem(new[] { "a", "b", "c" })); } protected override void OnRetrieveVirtualItem(RetrieveVirtualItemEventArgs e) { e.Item = items_[e.ItemIndex]; base.OnRetrieveVirtualItem(e); } public void Add(ListViewItem item) { items_.Add(item); VirtualListSize = items_.Count; } protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e) { e.DrawText(); base.OnDrawColumnHeader(e); } protected override void OnDrawSubItem(DrawListViewSubItemEventArgs e) { var text = ((ListViewItem.ListViewSubItem)e.SubItem).Text; using (var brush = new SolidBrush(e.SubItem.ForeColor)) { e.Graphics.DrawString(text, Font, brush, e.Bounds); } base.OnDrawSubItem(e); } protected override void OnColumnWidthChanged(ColumnWidthChangedEventArgs e) { base.OnColumnWidthChanged(e); Invalidate(true); // Nope, that didn't work Refresh(); // Nope, that didn't work } }

    Read the article

  • C# Exception when retrieving rows from a datagrid in virtual mode

    - by JamesM
    Hi all, I keep getting an exception (see below) when I retrieve a list of rows from a Virtual Mode datagrid, this only happens when I have more rows than I can display on screen and it doesn't happen every time. Is there anything I'm missing with regards to virtual mode? Update The image below shows the problem, the index is now outside the list range. The reason for this is say I have 10 items and I hide 5 as they are not needed and I want to run some code on the 5 that are visible, there are now 5 items but the index of some maybe between 5-9, how can I re-index? When I have run some code on the visible 5 I then show the hidden 5 so I don't want to disgard these, I'd need to reindex again when they are all visible. Many thanks.

    Read the article

  • Virtual Mode List View Click 1 Selects More Than One Items

    - by Samir
    I have a list view with virtual mode set to true and other things. It doing ok. But 1) Say there are 25 items and 15 of them are visible, that is to see the rest of 10 items need to scroll down. 2) Before scrolling swap two items, say myItems[0], it must be visible & myItems[20], it must be not visible scroll required. 3) Now select the first item, it was swapped, you now have two items selected, both 0 indexed and 20 indexed ones. When after swap, those two list view items are of same Position and same Bounds. But before 20-indexed item's Position was (-1, -1) and Bounds was (0,0,0,0). How come 0-indexed item didn't change its position & size? How to solve this ?

    Read the article

  • C# Virtual Mode List View Click 1 Selects More Than One Items

    - by Samir
    I have a list view with virtual mode set to true and other things. It doing ok. But 1) Say there are 25 items and 15 of them are visible, that is to see the rest of 10 items need to scroll down. 2) Before scrolling swap two items, say myItems[0], it must be visible & myItems[20], it must be not visible scroll required. 3) Now select the first item, it was swapped, you now have two items selected, both 0 indexed and 20 indexed ones. When after swap, those two list view items are of same Position and same Bounds. But before 20-indexed item's Position was (-1, -1) and Bounds was (0,0,0,0). How come 0-indexed item didn't change its position & size? How to solve this ?

    Read the article

  • How to calculate unbound column value based on value of bound colum in DatagGridView?

    - by Wodzu
    Hi. I have few columns in my DataGridView, one of them is an unbound column and the DataGridVIew is in VirtualMode. When CellValueNeeded event is called, I want to calculate value of Cells[0] basing on the value of Cells[2] which is in bounded column to the underlaying DataSource. This is how I try to do this: private void dgvItems_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) { e.Value = dgvItems.CurrentRow.Cells[2].Value * 5; //simplified example } However, I am getting System.StackOverflowException because it seams that call to dgvItems.CurrentRow.Cells[2].Value results in call to another CellValueNeeded event. And so on and so on... However Cells[2] is not an unbound column, so on common sense it should not result in recursive call unless getting value of any column(bound or unbound) firest that event... I can not use here SQL Expression and I can not precalculate e.Value in any SQL call. In real example Cells[2].Value is a key used in HashTable which will return a correct value for the Cells[0] (e.Value). What can I do?

    Read the article

  • How do you keep the text selection on a DataGridView?

    - by fneep
    I'm running C# 2.0, and I've written an application with a DataGridView in virtualmode and a TreeView in the same form, but in different panels of a SplitContainer. My application has a "find all" function that finds all instances of a certain string, and adds them as the child nodes to a new node to the TreeView (it's a tree view because you can have multiple search results by having different root nodes). That idea is that when you click on one of those search results in the TreeView, that it would select the specific text of that result in the DataGridView (Virtually the same as Notepad++'s find all function) When I click on the TreeView, it does set the selected cell of the DataGridView and highlight the specific text, but it loses that specific text selection instantly (but keeps the cell selection) because by clicking on the TreeView the DataGridView loses focus. Here's the code for the AfterSelect of the TreeView: private void Tree_Results_AfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.Level > 0) { SearchResult SelectedItem = (SearchResult)Tree_Results.SelectedNode.Tag; DataViewMain.CurrentCell = DataViewMain[SelectedItem.TypeIndex, SelectedItem.LineIndex]; DataViewMain.BeginEdit(false); DataGridViewTextBoxEditingControl SelectionData = (DataGridViewTextBoxEditingControl)DataViewMain.EditingControl; SelectionData.SelectionStart = SelectedItem.HighlightStart; SelectionData.SelectionLength = SelectedItem.HightlightLength; } } If the DataGridView were a text box I could possibly set HideSelection to false, but DataGridViews have no such property (and changing the Hide Selection for the EditingControl does nothing) Any ideas? I'm receptive to a different control instead of a TreeView that would allow my DataGridView to retain focus.

    Read the article

1