This is a migrated thread and some comments may be shown as answers.

Using RadDomainDataSource in Childwindow

1 Answer 49 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
Almond
Top achievements
Rank 1
Almond asked on 21 Jun 2012, 01:25 PM
Dear Telerik Gurus,

Good pm.

I just downloaded the trial version of Telerik and tried to implement to implement a childwindow calling a childwindow and returning a value.

I have a childwindow with a RadDataForm for CRUD.  In this childwindo a placed a button where in it call another childwindow with a RadGridview where I select the value I want to place in a textbox in the Parent Childwindow.  Please see the codebehind how i implement the call to the other Childwindow.

private void searchType_Click(object sender, RoutedEventArgs e)
{
    ServiceTypeSearch searchServiceTypeHldr = new ServiceTypeSearch();
    searchServiceTypeHldr.Closed += new EventHandler(searchServiceTypeHldr_Closed);
    searchServiceTypeHldr.Show();
}
 
void searchServiceTypeHldr_Closed(object sender, EventArgs e)
{
 
    ServiceTypeSearch searchServiceTypeResult = (ServiceTypeSearch)sender;
 
    if (!string.IsNullOrEmpty(searchServiceTypeResult._serviceTypeHldr))
    {
        MessageBox.Show("Returned Value Not Null");
        serviceTypeBoxHldr.Value = searchServiceTypeResult._serviceTypeHldr;
        //sender = null;
    }
 
    else
    {
        MessageBox.Show("Returned Value Null");
        //serviceTypeBoxHldr.Value = "";
     
    }
}

ServiceTypeSearch is my 2nd Childwindow.  In this childwindow form I a RadGridview populated
by a RadDomainDataSource as below:

<telerik:RadDomainDataSource x:Name="serviceTypeDS" AutoLoad="True" QueryName="GetV_servicetypeQuery"
                                 DomainContext="{StaticResource csisDC}"
                                 PageSize="14" Margin="15,10,320,12" Grid.Row="1"
                                 Grid.Column="1" LoadingData="serviceTypeDS_LoadingData"
                                 LoadedData="serviceTypeDS_LoadedData">
    <telerik:RadDomainDataSource.SortDescriptors>
        <telerikData:SortDescriptor Member="servicetype_desc"
                        SortDirection="Ascending"/>
    </telerik:RadDomainDataSource.SortDescriptors>
</telerik:RadDomainDataSource>

My problems is that the childwindow only populate the Grid on my initial click of the button.  If I close 
the childwindow and try and open it again using the button, the RadGridview has no data and the
RadDomainDataSource also does fire and load. 

Can anyone point me out and a solution for the said problem?  I actually have 2 other buttons that calls
other childwindow and the if I click any one of them, only the the first load of the childwindow populates
the RadGridView.  All other childwindow with RadGridViews are empty. 

Thank you in advance for your help.

oh i forgot to mention, I am a newbie in Silverlight development.

regards,
almond
 

1 Answer, 1 is accepted

Sort by
0
Almond
Top achievements
Rank 1
answered on 03 Jul 2012, 05:16 AM
Please disregard my inquiry and mark my post answered.

I finally had it working using the MVVM.

Thanks again.

regards,
almond
Tags
DomainDataSource
Asked by
Almond
Top achievements
Rank 1
Answers by
Almond
Top achievements
Rank 1
Share this question
or