Bug Tracker Sample Application

28 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 15 May 2009 Link to this post

    Hi,

    This is a dedicated forum thread to discuss the BugTracker Silverlight Drag&Drop demo.

    See the Introductory Blog post and download the source.

    Then tell me what you think. It would be great if this example is the place to show you how you can do the things you like to have in your applications.

    Since I am a developer I vow that I will not make custom themes and change ControlTemplates. It is possible and I would enjoy a different-looking application but I would like to keep the example free from thousands of lines of xaml, having just essential Xaml, databound and flexible.

    We can all agree that this is not a real-world application. We know when we see one. But we can get there.

    I can follow up with a blog post on how something is currently implemented or add a feature to the application, depending on what you would like to see.

    Just two rules:
    • Try to define your requirements in the spirit of the bug tracker.
      • "I want to see filtering of the TreeView" is bad.
      • "I want to be able to filter the TeamExplorer" is good.
    • I would rather do small updates often than big updates rarely, so I would like to start with small things.

    Normally we discuss controls in these forums. It will be great if we can discuss applications and application building.

    Your turn.

    Miro

  2. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 18 May 2009 Link to this post

    Hello Miroslav,

    I would like to see a hirarchy in the View All Bugs to show that bugs can be moved between 'groups' of bugs using TableDefinition_PreviewDataRecordCreate creating a GridViewTableDefinition and a relation property

    I am myself trying to get this working. Dragging and dropping between grids in different panes works . but dropping on a GridViewTableDefinition sees the hole child grid as the parent row.
    I have no clue on what i should do to make the child grid droppable?
    Tooltip and context menu work in the child grid.

    Regards and thx for this demo application.

    --piet 
  3. DevCraft banner
  4. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 18 May 2009 Link to this post

    Hello Miroslav,

    It seems (in my case) that DragDrop in a RadGridView goes ok 
     - fires DragQuery, DropDestinationQuery, DropSourceQuery, DropPossible, DragComplete , DropComplete

    In a child Grid of that same grid (TableDefinition_PreviewDataRecordCreate create GridViewTableDefinition with PropertyRelation)

    - it fires  DragQuery, DragCancel 

    doing the same mouse action in both cases on the specific row

    any comment?

    Regards  
  5. Miroslav Paskov
    Miroslav Paskov avatar
    6 posts
    Member since:
    Oct 2007

    Posted 18 May 2009 Link to this post

    Hi Piet,

    It seems like the RowStyle/Alternative row style is not propagated properly to the internal grid.

    I will look into this and try update the example or come up with a more complete answer.

    Thank you for the feedback,

    Miroslav

  6. Clinton van Ry
    Clinton van Ry avatar
    10 posts
    Member since:
    Feb 2009

    Posted 04 Oct 2009 Link to this post

    Hi Miro,

    thank you for your sample application as it is teaching me allot about silverlight.
    I have one question. Why does the status column not sort? You do have the IsSortable =true

    Kind Regards,

    Clinton
  7. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 08 Oct 2009 Link to this post

    Hi Clinton van Ry,

    Thank you for pointing this out. We will see where the probem come from and fix it.

    All the best,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Ven Govindarajan
    Ven Govindarajan avatar
    3 posts
    Member since:
    Sep 2009

    Posted 09 Dec 2009 Link to this post

    The sample code does not work when the latest telerik 2009 Q3 binaries are referenced as some of the members of gridview are not compatible. Could you please provide an updated sample code?


  9. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 14 Dec 2009 Link to this post

    Hello Ven Govindarajan,

     Yes, I updated the code for the Q3 SP1 version of the controls (2009.3.1208); the project is attached to my reply.

    Sincerely yours,

    Miroslav
    the Telerik team

     


    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. Ven Govindarajan
    Ven Govindarajan avatar
    3 posts
    Member since:
    Sep 2009

    Posted 14 Dec 2009 Link to this post

    Thank you!
  11. tomas
    tomas avatar
    139 posts
    Member since:
    Sep 2012

    Posted 26 Jan 2010 Link to this post

    Hi Miro.

    Thank you very much for your sample application. It is very useful for me, because you have used MvVM pattern.

    I am using the source from the post posted on Dec 14, 2009 NOT the official link (Download Bug Tracker) on http://www.telerik.com/community/labs/bugtracker-demo-%e2%80%93-a-silverlight-drag-drop-and-mvvm-showcase.aspx. It seems to me that the official link contains an older version.

    Also the hyper addin is not needed.

    Is that right?

    Thank you Tom
  12. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 28 Jan 2010 Link to this post

    Hi tomas,

    Thank you for reporting this issue. We will update the example as soon as possible.
    You are right that the usage of hyper addin is optional.

    Kind regards,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  13. tomas
    tomas avatar
    139 posts
    Member since:
    Sep 2012

    Posted 14 Feb 2010 Link to this post

    Hi Miro.

    I have one question regarding to ClickHelper class. There is this method:
    private static void OnElementMouseLeftButtonUp(object sender, MouseButtonEventArgs e)  
            {  
                var element = sender as FrameworkElement;  
                var info = GetClickInfo(element);  
                if (info == null)  
                {  
                    info = new ClickInfo();  
                }  
                var clickPoint = e.GetPosition(element);  
     
                if (info.LastClickPoint != clickPoint)  
                {  
                    info = null;  
                }  
                else  
                {  
                    var elasped = DateTime.Now - info.LastClickTime;  
                    if (elasped > MultiClickSpan)  
                    {  
                        info.ClickCount = 0;  
                    }  
                    info.ClickCount++;  
                    element.RaiseEvent(new ClickEventArgs(ClickEvent, element, info.ClickCount));  
                    info.LastClickTime = DateTime.Now;  
                }  
     
                SetClickInfo(element, info);  
            } 

    The element variable is cast like a FrameworkElement. But Framewor element has no RaiseEvent method. This method is defined in DependencyObjectExtensions. What is this class? How this class is used? Where is used? In XAML?

    Thank you very much.

    Tom
  14. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 15 Feb 2010 Link to this post

    Hi tomas,

    The RaiseEvent extension method defined there is an extension method for the Telerik Routed events.

    The Telerik routed events have been around since SL 2 in the Telerik controls and they have proved very useful. Since we cannot define and raise events using the MS routed event manager we are still using the Telerik implementation in Silverlight. (We do not have it in WPF since the routed events there are much more open).

    Our routed events should work just as the MS routed events in WPF.

    The DependencyObjectExtensions class exists because we created the Add/RemoveHandler() extension methods that allows registering for events in an easy WPF-code-compatible way.

    The AddHandler extension method works for the Telerik routed events in the same way as the UIElement.AddHanlder method for the built-in events.

    All the best,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  15. tomas
    tomas avatar
    139 posts
    Member since:
    Sep 2012

    Posted 15 Feb 2010 Link to this post

    Hi Miro.

    Thank you for your reply.

    Yes I understand. But I don't know, when can I expect, that DependencyObjectExtensions methods are available? What should I do to use this class? How to attach these methods to the FrameworkElement class? There is no such code in your sample. It seems to me a little bit mysterious.


    Than you

    Tom

  16. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 15 Feb 2010 Link to this post

    Hi tomas,

    To use the extension methods in code you need to have the

    using Telerik.Windows;

    in your code because this is the namespace of the DependencyObjectExtensions class. The extension methods will work on any dependency object and are available whenever you include this namespace. This is similar to the System.Linq extensions on the IEnumerable<T> which are visible only when you include this namespace.

    Greetings,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  17. tomas
    tomas avatar
    139 posts
    Member since:
    Sep 2012

    Posted 15 Feb 2010 Link to this post

    OK. May be some static constructor does that job.

    Thanks anyway.

    Tom
  18. tomas
    tomas avatar
    139 posts
    Member since:
    Sep 2012

    Posted 19 Feb 2010 Link to this post

    Hello Miro.

    I am currently inspecting DataTemplateProvider.xaml. It contains also this template:
    <DataTemplate x:Key="DragCueTemplate">  
                <Grid Width="150">  
                    <Grid.RowDefinitions> 
                        <RowDefinition /> 
                        <RowDefinition /> 
                    </Grid.RowDefinitions> 
                    <Border CornerRadius="6" BorderThickness="1" Grid.Row="2" 
                            Background="#FFFFFFFF">  
                        <Border.BorderBrush> 
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">  
                                <GradientStop Color="#FFA3AEB9" Offset="0" /> 
                                <GradientStop Color="#FF8399A9" Offset="0.375" /> 
                                <GradientStop Color="#FF718597" Offset="0.375" /> 
                                <GradientStop Color="#FF617584" Offset="1" /> 
                            </LinearGradientBrush> 
                        </Border.BorderBrush> 
                        <Border BorderBrush="#FFFFFFFF" BorderThickness="1" 
                                CornerRadius="5" Background="#FFF7F8FA" 
                                Padding="3 0 3 0">  
                            <StackPanel Margin="4 15 4 4">  
                                <!--Image and message--> 
                                <TextBlock VerticalAlignment="Center" 
                                        HorizontalAlignment="Center" 
                                        Text="{Binding Message, Converter={StaticResource DefaultValue}, ConverterParameter='Drag and Discover Actions'}" 
                                        TextWrapping="Wrap" TextAlignment="Center" 
                                        FontWeight="Bold" /> 
                                <StackPanel Orientation="Horizontal" 
                                        Margin="0 4 0 0">  
                                    <ItemsControl  
                                            ItemsSource="{Binding ApprovedDrops}" 
                                            Width="16" 
                                            ItemTemplate="{StaticResource DragDropApprovalIconsTemplate}" /> 
                                    <telerik:ItemsControl  
                                            ItemsSource="{Binding DraggedItems}" 
                                            Margin="3 0 0 0" 
                                            ItemTemplateSelector="{StaticResource DefaultDataTemplates}" /> 
                                </StackPanel> 
                            </StackPanel> 
                        </Border> 
                    </Border> 
     
                    <Image  
                            Source="{Binding IconPath, Converter={StaticResource DefaultValue}, ConverterParameter=/Images/DragInfoIcon.png}" 
                            Width="48" Height="48" HorizontalAlignment="Center" 
                            Margin="0 0 0 -15" /> 
                </Grid> 
            </DataTemplate> 

    I can see you are using original Silverlight ItemsControl and also TelerikItemsControl. What is the difference between them, please? Why do you do so?

    Thank you very much.

    Tom
  19. tomas
    tomas avatar
    139 posts
    Member since:
    Sep 2012

    Posted 23 Feb 2010 Link to this post

    One more question:

    How can I drag more than one but at once.

    Thanks. Tom
  20. Krishnan Rajah
    Krishnan Rajah avatar
    9 posts
    Member since:
    Feb 2010

    Posted 24 Feb 2010 Link to this post

    Hello,

    I am trying to provide the "Add" ability to teams, bugs & members in the Bug Tracker application. I added context menus & popup screens on the treeview, but am not able add a team, member or bug to the collection. Would appreciate if someone can help me with how to add the new data to the collection. Also some pointers on integrating it with a database would help.

    Thanks
    Krishnan
  21. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 25 Feb 2010 Link to this post

    Hello Tomas,

    The Telerik ItemsControl is an extension of the MS ItemsControl and adds the following:

    - ItemContainerStyle
    - ItemContainerStyleSelector
    - ItemTemplateSelector (which I needed in the example)
    - ContainerBindings, which work similarly to the StyleBindigns in WPF

    The TelerikControl also "understands" HeaderedContentControls and HeaderedItemsControls when they are its containers and treats them a bit differently (as in WPF). This items control also works with HierarchicalDataTemplates and is very flexible, as outlined here:

    http://www.telerik.com/help/silverlight/radtreeview-templating-hierarchical-data-templates.html

    As for your question "How can I drag more than one but at once"

    If I understand you correctly, you are trying to start dragging more than one item at once. Since you can put anything in the Payload of a DragDrop, you can put a collection of items there instead of a single item - for example these can be the SelectedItems of a control rather than its SelectedItem.

    Regards,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  22. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 25 Feb 2010 Link to this post

    Hi Krishnan Rajah,

    The BugTracker takes a different view on data. Instead of having many collections of data around the application, you have the "root" collections of data that contain all entities of a certain type.

    Then the data that is displayed in the application is "shaped" with the bindable linq library.

    This means that if you want to add a team you need to add a team to the root collection.

    The integration with a DB can happen over a web service. In such scenario retrieving all the available data may not be possible and  there you have the question of which data to retrieve so that it will be enough to populate the views.

    This retrieval may happen in the getter of the collection properties once, so that multiple calls to the web service will be avoided.

    Regards,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  23. Krishnan Rajah
    Krishnan Rajah avatar
    9 posts
    Member since:
    Feb 2010

    Posted 25 Feb 2010 Link to this post

    Hi Miroslav,

    Thanks for replying. I was able to add teams & members by adding add method to IBugTrackerDataSource.cs and implementation on DummyDataSource.cs. I hope by "root" collections you mean the following variables in DummyDataSource.cs

     
    private static IList<BugViewModel> bugs;  
    private static IList<TeamViewModel> teams;  
    private static IList<TeamMemberViewModel> members;  
    private static IList<BugStatusViewModel> statuses; 

    Regarding the DB access, am trying to use ADO.NET dataservice. If the collections are populated once, let say while initializing, how will the changes like adding new member would reflect in these collections. I can add the new data to the collection directly but there would be a question of the data failing to be updated in the DB. Since the data updates are asynchronous in Silverlight, how can this be handled. Would appreciate if you can give some examples(Web Service/ADO.NET Data Service)  of the approach you are mentioning.

    Thanks
    Krishnan
  24. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 26 Feb 2010 Link to this post

    Hello Krishnan Rajah,

    Yes, with "root" collections I meant these four collections.

    The ADO.NET data service is a good choice in this case.

    The question about how the collections should be updated is a classic choice that has to be made:
    - 1. The "optimistic update" is the case where you immediately add the item on the user's side and call the web service. If it fails though you have to revert the change and notify the user.

    2. - The "pessimistic update" is the case where the update on the client is done only after the service returns successfully.

    I would be happy to update the example with a real web service but currently we are in the process of finalizing the Q1 release and updating this example with a real service will have a lower priority.

    Greetings,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  25. Krishnan Rajah
    Krishnan Rajah avatar
    9 posts
    Member since:
    Feb 2010

    Posted 03 Mar 2010 Link to this post

    Hi Miroslav,

    Thanks for the reply. Am trying to convince my client that using telerik silverlight control is a good choice. They want a working proof of concept with the database connectivity. So am trying my hand with the ADO.NET data service & the bug tracker application. I understand that your Q1 release is the priority, would appreciate if you can give pointers on how to integrate this app with database. I have created the schema with tables Bugs, Teams, Members & BugStatus with relationships. Also have added the Dataservice. Can u pls let me know how do i bind these into the bug tracker application.


    Thanks
    Krishnan
  26. Krishnan Rajah
    Krishnan Rajah avatar
    9 posts
    Member since:
    Feb 2010

    Posted 05 Mar 2010 Link to this post

    Hi, 

    I was able to retrieve & populate the collections with data from ADO.NET data services. I had to create values of each of the viewModel collections from the DataService classes. The problem i have now is how do i handle updates. Since the classes are not directly bound to the view model, need some help to update the data back to the database when it changes in the UI. Would appreciate if you can let me know how to do the data binding between View Model & the View and handle the updates ?

    Thanks
    Krishnan
  27. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 10 Mar 2010 Link to this post

    Hi Krishnan Rajah,

    With the Q1 almost out of the door I can look into the BugTracker demo.

    You can find what I have done yesterday attached.

    Now there is an entity model and a data service that is consumed by the bug tracker.

    I must admit I kind of cheated here because what I did was to reuse the classes generated by the WCF DataService as kind-of ViewModels. This combined with the self-tracking data service collections should make saving changes easier. The MVVM pattern will prescribe that the model stays completely separate but in this case there isn't much to be gained.

    I guess to enable basic editing a 'Save' button needs to be added that will just save the data context.

    Kind regards,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  28. Krishnan Rajah
    Krishnan Rajah avatar
    9 posts
    Member since:
    Feb 2010

    Posted 10 Mar 2010 Link to this post

    Hi Miroslav,

    Thank you for taking the time to rewrite the application. Appreciate your support. I just have one problem, i still use silverlight 3.0 & visual studio 2008 so could not get the demo working. It would be nice if you can give me the sample in VS 2008 version & sliverlight 3.0. Looks like you have used silverlight4.0 & Visual Studio 2010 :D.

    Thanks
    Krishnan
  29. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 16 Mar 2010 Link to this post

    Hi Krishnan Rajah,

    I tried converting the project for Silverlight 3.0 but I use a DataServiceCollection<T> which does not seem to be available for Silverlight 3.0. The DataServiceCollection has item tracking which means that it will listen for changes on the properties of its items and it will manage their relations.

    The DataServiceCollections are generated in the service proxies as well so I am not sure that they can be converted easily. I could not find an equivalent for Silverlight 3.

    Regards,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
DevCraft banner