Telerik Forums
UI for WPF Forum
2 answers
96 views
Hi,
I have a TabControl where a list of my view model objects are bound.
The ContentTemplate uses a UserControl:

<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid Margin="-30,0,10,10">
<Views1:ControlUnitView Margin="10" />
                                    
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
I had expected that each tab item gets its own copy of the user control. This seems not to be the case. Instead only one user control is created but the data context is switched between each tab selection. Is this the expected behavior?

Within my user control, I have a grid. I want to copy the selected items from my view model to the SelectedItems property of the grid after the tab changed. I tried to use the datacontext-Changed event. However, when i set the SelectedItems list during this event, the items are not highlighted. But that's the only event I get within my user control. Is there a better way to accomplish this?
Thanks
Kind regards
Hartmut
Dr. Hartmut Kocher
Top achievements
Rank 1
 answered on 31 Mar 2010
1 answer
184 views
I am able to bind an 'IndicatorList Value' in XAML to a source. But if I try to bind 'Min' and 'Max' of a 'Linear/RadialScale', it throws an error. How can I do that, as in my project these three values come from a class.
Andrey
Telerik team
 answered on 31 Mar 2010
2 answers
76 views
Hi team !!

I use the following code to expand a group in my grid:

goalsDataGrid.ExpandGroup(goalsDataGrid.Items.OfType<IGroup>().ElementAt(1));

The groups are of type "Essential" and "Desired". But suppose i haven't added any record of type "Desired", ElementAt(1) refers to a record of type "Desired". 
Now, when i have not yet added an item of type "Desired", obviously the above-mentioned single line of code will throw an ArgumentOutOfRangeException. How do i manipulate the code to expand a group only if it is present?

Regards,
Jimit.
jimit r
Top achievements
Rank 1
 answered on 30 Mar 2010
9 answers
110 views
Mr.
In the TreeView Data Binding sample, I set IsDragDropEnabled="True". Then tried to drap and drop a Team from one Division to another Division, but it didn't work.

By the way, how could I change the post title. I want to change the post title to be "Problem of Drag and Drop in TreeView Data Binding".
Tina Stancheva
Telerik team
 answered on 30 Mar 2010
3 answers
55 views
Hi Telerik,

I've recently upgraded to Q1 2010. In my code I have had a radchart bound to an observablecollection. The first display of the chart works fine, however when I use either collection.Clear() or ItemsSource = null I receive the following error:

InvalidCastException  
Unable to cast object of type 'System.Windows.Style' to type 'System.Collections.Generic.IList'1[System.Windows.Style] 

This occurs when using a BarSeriesDefinition, however when I use a LineSeriesDefinition it works fine. Also, this used to work previously in both SeriesDefinitions.

Any Ideas?

Rav
jackd doh
Top achievements
Rank 1
 answered on 30 Mar 2010
4 answers
3.0K+ views

WPF and C#: Problem: 1. How to Refresh Radgridview when i Insert,update and Delete Record in database anrecord. 2.when i am Insert or Update Record than in radgridview that row is selected.

i am useing sql server 2005.

i am use to set data source of radgridview like " radgridview1.ItemsSource = ds; " ==> ds is dataset.

i am beginner so if possible than tel me by code it is easy to understand.......

can u help me as early as possible ....

i give some code which i am useing for update RadGridview

con.ConnectionString = @"Data Source=(local);Initial Catalog=DigiDms;Integrated Security=True"
 
        cmd1.Connection = con; 
        con.Open(); 
        cmd1.CommandType = CommandType.StoredProcedure; 
        cmd1.CommandText = "Pro_Insurance_Master_Select"
        da1.SelectCommand = cmd1; 
        da1.Fill(ds1); 
        con.Close(); 
 
        //dataGrid.clear(); 
        //dsGrid.Reset(); 
        //dsGrid = dataGrid.GetData("Pro_Insurance_Master_Select"); //set datasource of gridview 
 
        gridShowData.ItemsSource = null; // At hear i get Error
        gridShowData.ItemsSource = ds1; 

doing this ,

when i am delete or update record than folloning error generated... Error: >> "Object reference not set to an object"
when i am doing the "gridShowData.ItemsSource = null;"

and when i am doing insert operation than this error is not generated and RadGridview also updated.....

so pls help me as early as possible.... i am beginer ........
Rikin Patel
Top achievements
Rank 1
 answered on 30 Mar 2010
10 answers
162 views
I am wondering if this is possible.  I am binding a self-referencing table to a treeview.  One of the columns is SortOrder.  The users have the ability of moving the items in the treeview up and down within a parent node, or moved to another node and up and down in that one.  When the user has made all the moves they want and click save, what has to be saved then is what order the nodes are in under each node.  So for example it should be saved like:

NFL
- Name: AFC East SortOrder:1
-- Name: Patriots SortOrder:1
-- Name: Jets SortOrder:2
- Name: AFC South SortOrder: 2
-- Name: Colts SortOrder: 1
-- Name: Titans SortOrder: 2

I was thinking of looping through each node and checking maybe the child index and saving that.  Not sure if that would work.  Ideally, I would love to be able to Bind the SortOrder to like the child index so it would automatically change if it was moved.
Tihomir Petkov
Telerik team
 answered on 30 Mar 2010
5 answers
97 views

( I re-post correctly here my message that I've already posted in the scheduler-section - it was a mistake)

Hi everybody,
I upgraded today my project from Q3-2009 to Q1-2010 and I've found an error opening Windows and UserControl into the VS2008 editor: (i'm on a Windows7 64 bit)

Cannot create instance of 'GenericTheme' defined in assembly 'Microsoft.Windows.Design.Interaction, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Exception has been thrown by the target of an invocation. 

In expression Blend it's OK ...

Is it a problem of the new version?
Is there a way to solve it?

thanks in advance
Michele

Milan
Telerik team
 answered on 30 Mar 2010
1 answer
94 views
Is it possible to set focus to the beginning of the ComboBox displaying text? What I want is the result shown at pict2.jpg(attached) instead of the pict1.jpg(also attached). The problem with pict1.jpg is that when I select an item, the focus goes to the end of my string instead of going to start. Does the control support this?
Hristo
Telerik team
 answered on 30 Mar 2010
1 answer
120 views
Can you tell me if this is possible with your chart control.  I need to build a geological chart.  I have a couple of images, but stratcolumn is more what I am trying to accomplish.  Essentially, it is like three or more charts, side by side, all based on the same scale.  So you have a Y scale which represents millions of years, then a type of stack chart where you have a series of polygons of different height, width, and colors; then two point charts.  But they all act as one unit for zooming, scaling, panning, etc.  Each chart would have its own seperate datasource.

In looking at your charts, I see things simliar to the stacked Polygon chart I need, but not exactly.  But there can also be gaps as well,  Plus, not with Height, Width being variable.  The line charts are easy as you have them.  It is just a matter of how would I display these three together as almost one chart for zooming purposes, exporting, etc.

Any suggestions or maybe it just can't do it? 
Dwight
Telerik team
 answered on 30 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?