Telerik Forums
UI for WPF Forum
1 answer
274 views
I have a proof-of-concept WPF app with parent RadGridView with two hierarchical levels of child details.   Most of the information on the child detail of the top-level parent is in a child RadGridView.   That child grid's row details are mainly another RadGridView of the first child's children.    In the POC, all three grids were bound directly to VS2010-generated DataAdapters/Views.  That worked fine as long as only one top-level parent at a time had to display row details.

Now I find I need to instead have row details displayed at the same time for multiple parent rows in a RadGridView.   But if I simply source the child details out of the existing child dataset, then all parent table rows will show the child details for the same, currently selected parent row instead of being the unique child details which match each parent row.

I'd like to know what you recommend as the best practice for providing binding sources for child table-sourced row details to support multiple, simultaneous child row details displays.

I had thought about creating separate observable collections in the LoadingRowDetails event of the top two grids.  But with the parent grids' rows directly bound to DataAdapters/DataViews, there is no way to separate the data contexts with multiple top-level parent row details simultaneously opened.

I realize could do this by hand-creating three levels of custom business objects and sourcing their content from the database rows.   But I'd rather not start over like that if there is a decent solution leveraging at least part of the existing direct database data objects.  (All the current code for updating the database is directly using the bound DataSet/DataAdapter objects to automatically track the change deltas and perform the database updates).

What is the best practice here for providing multi-level row-details?   Should I just bite the bullet and change the app over to working off of three-level, hierarchical custom business objects, tracking my own change deltas, and hand-coding the database update logic?

Thanks for your thoughts,
-Bob
BRiddle
Top achievements
Rank 1
 answered on 12 Jul 2011
6 answers
268 views
I have a collection of class "Person" containing
  • Name (string)
  • ID (int)
  • ParentID (int)

and that linear list defines a hierarchy by referencing to itself (each person whoose ID (primary key) is equal to the ParentID (foreign key) of another person is parent of this other person.
In the telerik WPF Controls Examples showing the Self-Reference Hierarchy, the thing is, that this hierarchy is not a clean hierarchy tree, because elements of the first level (e.g. EmployeeID = 1) show up in the second level as well. I would need to build a tree like a family tree, where one Id can only occur in one place and nowhere else. One the other hand, it would be nice to have the tree in linear form as well, to see all persons at one glance.
Can someone give me a hint, how this can be done easily?
Thanks,
hermann
Top achievements
Rank 1
 answered on 12 Jul 2011
4 answers
287 views
Hi there
The situation is the following:
I am in need of having custom ticks on the X-axis in the form of DateTimes, jeg AutoRange doesnt seem to be working for me when i have ticks with same date but different time of day.
I have tried setting AutoRange to false, and creating ticks my self but this gives me no graphs at all, can someone tell me what I am missing here?

Following is from my code-behind:
private void SetupGraph()
{
    radChart.ItemsSource = dataContext.Points;
    var seriesMappings = CreateSeriesMappings();
    var axisX = new AxisX
        {
            DefaultLabelFormat = "dd-MM-yy",
            LabelRotationAngle = 45,
            Step = 1,
            LabelStep = 1,
            AutoRange = false,
            IsDateTime = true                                  
        };
  
        var tickPoints = dataContext.Points.SelectMany(gp => gp).Select(gp => gp.Date).Distinct().Select(dt => new TickPoint(){IsDateTime = true, Label = dt.ToShortDateString(), Value = dt.ToOADate()});
    axisX.TickPoints.AddRange(tickPoints);
  
    var axisY = new AxisY { DefaultLabelFormat = "N3", };
    var chartArea = new ChartArea { AxisX = axisX, AxisY = axisY, LegendName = "legend" };
    var chartLegend = new ChartLegend { Name = "legend", UseAutoGeneratedItems = true, Width = 145 };
    var chartTitle = new ChartTitle { Content = "Graph" };
    var chartDefaultView = new ChartDefaultView
        {
            ChartArea = chartArea,
            ChartTitle = chartTitle,
            ChartLegend = chartLegend,
        };
  
        radChart.SeriesMappings.AddRange(seriesMappings);
        radChart.DefaultView = chartDefaultView;
        radChart.AnimationSettings = new AnimationSettings() { TotalSeriesAnimationDuration = new TimeSpan(0, 0, 0, 00), ItemAnimationDuration = new TimeSpan(0,0,0,0), ItemDelay = new TimeSpan(0,0,0,0)};
        radChart.Rebind();
}
KADI
Top achievements
Rank 1
 answered on 12 Jul 2011
3 answers
69 views
Hi,

I updated to the beta because I want to try out the new PropertyGrid. I noticed, that the Drag&Drop behaviour changed from the Q1 SP1 release. Now when I drag an item from another control onto the target TLV I'll get a red stop sign. The DropQuery-Event is not fired so I guess that the DragAndDropManager thinks, that the item is not over the control. This worked perfectly with the previous release.

Is this a bug or a feature? And will this be changed to the old behaviour with the final release of Q2?

Greets
Hans
Tsvyatko
Telerik team
 answered on 12 Jul 2011
5 answers
166 views

Hello

Is there property can user edit row?

Best regards

Ehud

Dimitrina
Telerik team
 answered on 12 Jul 2011
2 answers
318 views
Hi Support

I implement INotifyDataErrorInfo for my class ,It shows exception right in GridView But allow user to exit cell with invalid data.
I want to force user to correct data before leaving cell how can I do that?

public

class TestClass : INotifyDataErrorInfo  

{

        int code; 
                public int Code  

                {

                    get {return code; }

                    set 
                    {
            IsCodeValid(
value); 

            if (code != value) code = value;  

                    }

                }

        string name;

        public string Name  

                {

                    get {return name; }

                    set {name = value; }

                }

public bool IsCodeValid(int value)  

{

bool isValid = true;

if (value == 0)

{

AddError("Code", "Code Err!", false);

isValid = false;  

}

else RemoveError("Code", "Code Err!");

return isValid;

}
private
Dictionary<String, List<String>> errors = new Dictionary<string, List<string>>();

public void AddError(string propertyName, string error, bool isWarning)

{

if (!errors.ContainsKey(propertyName))  

errors[propertyName] = new List<string>();

if (!errors[propertyName].Contains(error))

{

if (isWarning) errors[propertyName].Add(error);

else errors[propertyName].Insert(0, error);

RaiseErrorsChanged(propertyName);

}

}

public void RemoveError(string propertyName, string error)  

{

if (errors.ContainsKey(propertyName) && errors[propertyName].Contains(error))

{

errors[propertyName].Remove(error);

if (errors[propertyName].Count == 0) errors.Remove(propertyName);

RaiseErrorsChanged(propertyName);

}

}

public void RaiseErrorsChanged(string propertyName)

{

if (ErrorsChanged != null)

ErrorsChanged(this, new DataErrorsChangedEventArgs(propertyName));

}

#region

INotifyDataErrorInfo Members

public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;

public System.Collections.IEnumerable GetErrors(string propertyName)

{

if (String.IsNullOrEmpty(propertyName) || !errors.ContainsKey(propertyName))

return null;

return errors[propertyName];

}

public bool HasErrors

{

get { return errors.Count > 0; }

}

#endregion

 

 

}

 

 

<telerik:RadGridView Name="radGridView1" AutoGenerateColumns="False" ItemsSource="{Binding ColData}" >

 

<telerik:RadGridView.Columns>

 

<telerik:GridViewDataColumn Header="Code" DataMemberBinding="{Binding Code}" ValidatesOnDataErrors="Default" />

 

<telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" />

 

</telerik:RadGridView.Columns>

 

</telerik:RadGridView>

Mehri
Top achievements
Rank 1
 answered on 12 Jul 2011
5 answers
651 views

Hi,
I am using RadGridView in a desktop WPF application. The
ItemsSource property of the grid is set to an instance of QueryableCollectionView. What I need is to hook to an event that is raised whenever the user tries to select a different row in the grid and then be able to cancel the change, depending on some user input. I tried using the CurrentChanging event of the QueryableCollectionView and set “e.Cancel = true”. As this approach works just fine with a normal WPF ListView, RadGridView doesn’t pick up the result from the CurrentChanging event of the QueryableCollectionView and the selection of the RadGridView is still moved to the new row (although the CollectionView’s current item does not change!). Can you give me a solution? Thank you!

Schokoolero50
Top achievements
Rank 1
 answered on 12 Jul 2011
3 answers
147 views
Hello Telerik team,

Not sure if this is possible using Telerik grid export.

I was able to export the data of a hierarchical grid having upto 3 levels of hierarchy using

ElementExported event.


But I want the expand collapse for different levels in the excel too.


Regards,
Mausami

 
Mausami
Top achievements
Rank 1
 answered on 12 Jul 2011
2 answers
223 views
I am using the Q1 2011 release of RadControls for Silverlight and wish to create a custom Map Provider by using the ImageProvider.  I have worked with an earlier version using the mapBaseProvider and realized you have made some significant changes that should support a lot more gis scenarios. I am using a MapServer to generate my images and have not tiled the output, the server is configured as a WMS.  I have two requests:

1. Can I use the ImageProvider option to create a custom Map Provider that will be able to render the images generated by the MapServer wms ?

2. Can you provide me with links to source code examples or documentation ?

Thanks,

Sunil
 
Sunil
Top achievements
Rank 1
 answered on 11 Jul 2011
2 answers
113 views
Hi All,

I am working on WPF 4.0 and have a requirement to custom the default style on header which we get while doing sorting on RadGridView. Instead of black triangle on header top , I need that triangle at the right side of the header while sorting.

Kindly let me know how to do it.

Parul
Top achievements
Rank 1
 answered on 11 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?