locked
Silverlight datagrid Scrolling issue RRS feed

  • Question

  •  I have a datagrid in my program which has a template column and some other regular columns. I used the template column ,it has some controls textbox and combobox.controls are dynamically binded and selected index of the combobox is set according to the data in the service.Everything works fine but problem comes when i scroll the datagrid ,all combobox selected item got changed,it seems loading row  event is getting fired when i scroll the datagrid but cant able to resolve it...Its URGENT!
    • Moved by Sheldon _Xiao Friday, August 5, 2011 5:58 AM (From:Windows Presentation Foundation (WPF))
    Tuesday, July 19, 2011 2:34 PM

Answers

  • Hi there,

    not sure about SL, but this sounds like you're "suffering" from virtualization. That is, by default, the WPF's DataGrid will set EnableRowVirtualization="True" which, in turn, will mean that, when you scroll your DG so that previously unloaded rows become visible, this would result in the LoadingRow-event being fired. If the amount of data you display in your DG isn't all too extensive, setting EnableRowVirtualization="False" could do the trick.

    The same applies to EnableColumnVirtualization, BTW.


    Cheers,
    Olaf
    http://blogs.intuidev.com
    • Proposed as answer by Olaf Rabbachin Tuesday, September 6, 2011 3:18 PM
    • Marked as answer by Just Karl Friday, May 15, 2015 2:47 PM
    Tuesday, July 19, 2011 6:35 PM
  • Hello,

    I'd ask in the Silverlight Developer Center

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    • Proposed as answer by Just Karl Friday, May 15, 2015 2:47 PM
    • Marked as answer by Just Karl Friday, May 15, 2015 2:47 PM
    Wednesday, May 6, 2015 5:10 PM

All replies

  • Is this in XAML? Put a breakpoint in the combobox selection changed event and look at the call stack. Some code would help us debug further.
    Louis
    Tuesday, July 19, 2011 3:21 PM
  • Hi there,

    not sure about SL, but this sounds like you're "suffering" from virtualization. That is, by default, the WPF's DataGrid will set EnableRowVirtualization="True" which, in turn, will mean that, when you scroll your DG so that previously unloaded rows become visible, this would result in the LoadingRow-event being fired. If the amount of data you display in your DG isn't all too extensive, setting EnableRowVirtualization="False" could do the trick.

    The same applies to EnableColumnVirtualization, BTW.


    Cheers,
    Olaf
    http://blogs.intuidev.com
    • Proposed as answer by Olaf Rabbachin Tuesday, September 6, 2011 3:18 PM
    • Marked as answer by Just Karl Friday, May 15, 2015 2:47 PM
    Tuesday, July 19, 2011 6:35 PM
  • I need to scroll as well as need to keep row visualization true, what do I do in that case?

    Thursday, November 6, 2014 9:45 AM
  • Hello,

    I'd ask in the Silverlight Developer Center

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    • Proposed as answer by Just Karl Friday, May 15, 2015 2:47 PM
    • Marked as answer by Just Karl Friday, May 15, 2015 2:47 PM
    Wednesday, May 6, 2015 5:10 PM