Telerik Forums
UI for WPF Forum
6 answers
2.3K+ views
Hi,

We've got the following code in the application's App class's constructor (the fact that we're doing this in the App class appears to be related to the issue):

            bool allGood = false
            do 
            { 
                LoginWindow loginWindow = new LoginWindow(); 
                loginWindow.ShowDialog(); 
                 
                if (loginWindow.DialogResult.GetValueOrDefault(false)) 
                { 
                    try 
                    { 
                        // Try and do something... 
                        allGood = true
                    } 
                    catch (Exception) 
                    { 
                        lastLoginFailed = true
                    } 
                } 
                else 
                    return
            } while (!allGood); 

In the LoginWindow, there's a button whose Click handler ends with a call to Close(). The "Try and do something" code tries something that may possibly throw an Exception. If it does, then allGood stays false and the loop happens again. If it doesn't throw an exception, allGood is set to true and the job ends.

The problem is this - the first call to ShowDialog works fine. The second call does nothing.

Any idea what we're doing wrong here?

Thanks,
yonadav
Garry Clark
Top achievements
Rank 1
 answered on 31 Mar 2010
1 answer
156 views
hi

am using rad tree view, i want to get the parent value, when am selecting a child
i mean, when i click on sub items in the tree i can get the values by selected items, but i want to get the  child value and corresponding parent value when am cliking the child. how i can do it
Tina Stancheva
Telerik team
 answered on 31 Mar 2010
4 answers
122 views
Hello,
I call Rebind to refresh my data. But I'm using the RowLoaded event to format my data conditionally.
It appears that the Rebind does not call this event.
How can I refresh my data and format it conditionally.
Thank You
Jon
Top achievements
Rank 1
 answered on 31 Mar 2010
1 answer
142 views
My chart has 3 Bar series, the 3 bars are shown next to each other and there's a gap between it and the next group of 3 bars. Is there a way to set the size of this gap? In my case I need it to be 0 (no gap).
Giuseppe
Telerik team
 answered on 31 Mar 2010
2 answers
93 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
179 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
72 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
109 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
46 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
2.9K+ 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?