locked
Datarepeater show nothing in Virtual Mode

    Question

  • Hey guys,
    I'm trying to use datarepeater control in my winform program, and everything is fine in databiding mode. but I found it just give a blank frame when I try to use it in virtual mode.

    My environment:
    visual studio 2008 with VS Power Packs 3.0

    This is list of things I have done:
    1. a class named customerInfo with some properties (e.g. customerID, customerName...)
    2. a class named customerInfoList which is inherits from List ( List(Of customerInfo))
    3. create a new form
    4. drag and drop the datarepeater control from tool box (named datarepeater1)
    5. change the datarepeater's vitual mode property to 'TRUE'
    6. drag and drop some textbox controls from tool box on the top part of datarepeater
    7. then in code view of same form, I use the top side drop box to add new 'ItemValueNeeded' event.
    8. write some code to pass data from list to 'datarepeater1'.

    when I link this project and run, the winform show up, and I can see the frame border of 'datarepeater1', with nothing in it.
    I also found that 'ItemValueNeeded' event didn't fire at all.
    I'm already seek for the answer almost everywhere, but still have no idea.
    Please help me, thank you very much.

    p.s. this is the link from msdn which I was followed.
    http://msdn.microsoft.com/en-us/library/cc488276.aspx

    Monday, December 28, 2009 11:09 AM

Answers

  • Hi Frank, if I want to make a guess, the problem is that you have not added any data to the DataRepeater.
    Noticed that you have purposely set the virtual mode to true and that means datarepeater is not aware of the data and you need to push the data in.

    That is you need to call DataRepeater1.AddNew() or set DataRepeater1.ItemCount, etc.

    Here is one example I wrote previously to answer someone's question. You can play with it and see how it works. 
    There is an add button to start with.


    HTH,

    John  



    John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
    Wednesday, December 30, 2009 3:51 AM
    Moderator
  • I just posted a blog discussing the usage of DataRepeater Virtual Mode: http://blogs.msdn.com/vsdata/archive/2010/01/07/using-the-datarepeater-virtual-mode.aspx
    Hopt this would be helpful.
    John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
    • Marked as answer by Frank_Quan Thursday, June 17, 2010 10:06 AM
    Friday, January 08, 2010 7:30 AM
    Moderator

All replies

  • Hi Frank, if I want to make a guess, the problem is that you have not added any data to the DataRepeater.
    Noticed that you have purposely set the virtual mode to true and that means datarepeater is not aware of the data and you need to push the data in.

    That is you need to call DataRepeater1.AddNew() or set DataRepeater1.ItemCount, etc.

    Here is one example I wrote previously to answer someone's question. You can play with it and see how it works. 
    There is an add button to start with.


    HTH,

    John  



    John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
    Wednesday, December 30, 2009 3:51 AM
    Moderator
  • I just posted a blog discussing the usage of DataRepeater Virtual Mode: http://blogs.msdn.com/vsdata/archive/2010/01/07/using-the-datarepeater-virtual-mode.aspx
    Hopt this would be helpful.
    John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
    • Marked as answer by Frank_Quan Thursday, June 17, 2010 10:06 AM
    Friday, January 08, 2010 7:30 AM
    Moderator
  • Hi, John, thank you for your reply, I'll check your blog.
    Thursday, June 17, 2010 10:05 AM