This question is locked. New answers and comments are not allowed.
Hi, I'm trying to use RadDomainDataSource in the code behind of a silverlight 4 application with VS2010 and RIA Services. I have a RadGridView with a RadDataPager.
In my RadGridView I'm loading diferent information, so I need to change the property QueryName each time that I change my data, now I have the code in the xaml but I want to put it in the cs file because is easier to change this property code behind.
Could you please someone tells me how to translate this code in the code behind? or if I keep the code in the xaml, where is the correct place to change QueryName and reload the grid?
<
Grid
x:Name
=
"LayoutRoot"
>
<
Grid.Resources
>
<
local:MillisecondsToTimeSpanConverter
x:Key
=
"LoadDelayConverter"
/>
</
Grid.Resources
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"26"
/>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"35"
/>
</
Grid.RowDefinitions
>
<
telerik:RadNumericUpDown
VerticalAlignment
=
"Center"
Value
=
"500"
Name
=
"loadDelay"
IsInteger
=
"True"
NumberDecimalDigits
=
"0"
ValueFormat
=
"Numeric"
Visibility
=
"Collapsed"
/>
<
telerik:RadDomainDataSource
x:Name
=
"ddsEmployeeSelectUC"
AutoLoad
=
"True"
QueryName
=
"GetEmployee2Query"
LoadDelay
=
"{Binding Value, ElementName=loadDelay, Converter={StaticResource LoadDelayConverter}}"
PageSize
=
"20"
>
<
telerik:RadDomainDataSource.DomainContext
>
<
e:EmployeeDomainContext
/>
</
telerik:RadDomainDataSource.DomainContext
>
<
telerik:RadDomainDataSource.QueryParameters
>
<
telerik:QueryParameter
ParameterName
=
"subsidiary"
Value
=
"{Binding mySubsidiary}"
/>
</
telerik:RadDomainDataSource.QueryParameters
>
</
telerik:RadDomainDataSource
>
<
Border
Grid.Column
=
"0"
Grid.Row
=
"0"
Style
=
"{StaticResource BorderStyleCornerRadiusOnTop}"
>
<
Border.Background
>
<
LinearGradientBrush
EndPoint
=
"0.5,1"
StartPoint
=
"0.5,0"
>
<
GradientStop
Color
=
"#FFD1D1D1"
Offset
=
"0"
/>
<
GradientStop
Color
=
"#00F5FAFC"
Offset
=
"1"
/>
</
LinearGradientBrush
>
</
Border.Background
>
<
TextBlock
x:Name
=
"TextBlockTitle"
Margin
=
"10,10,0,5"
Grid.Column
=
"0"
Grid.Row
=
"0"
Style
=
"{StaticResource ModuleTitleStyle}"
/>
</
Border
>
<
Grid
x:Name
=
"gridSearch"
Grid.Row
=
"1"
Grid.Column
=
"0"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
/>
</
Grid.ColumnDefinitions
>
<
Image
x:Name
=
"imgSearch"
Grid.Column
=
"0"
Margin
=
"10,1,0,3"
Source
=
"/Etelesolv.Telemanager.TME;component/Assets/Images/Icons/search_icon.png"
Stretch
=
"None"
/>
<
TextBox
x:Name
=
"TextBoxSearchEmployee"
Grid.Column
=
"1"
Grid.Row
=
"0"
Margin
=
"2,1,10,3"
HorizontalAlignment
=
"Stretch"
/>
</
Grid
>
<
telerik:RadBusyIndicator
x:Name
=
"rbiEmployeeSelectUC"
Grid.Column
=
"0"
Grid.Row
=
"2"
IsBusy
=
"{Binding IsBusy, ElementName=ddsEmployeeSelectUC}"
>
<
telerik:RadGridView
x:Name
=
"rgvEmployeeSelect"
Grid.Column
=
"0"
Grid.Row
=
"2"
Margin
=
"10,0,10,0"
Cursor
=
"Hand"
AutoGenerateColumns
=
"False"
AlternateRowBackground
=
"{StaticResource GridRowBackgroundColorBrush}"
AlternationCount
=
"2"
CanUserFreezeColumns
=
"False"
CanUserDeleteRows
=
"False"
CanUserInsertRows
=
"False"
ColumnWidth
=
"*"
IsReadOnly
=
"True"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Collapsed"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
ItemsSource
=
"{Binding DataView, ElementName=ddsEmployeeSelectUC}"
/>
</
telerik:RadBusyIndicator
>
<
telerik:RadDataPager
x:Name
=
"dpgEmployeeSelect"
Grid.Column
=
"0"
Grid.Row
=
"3"
DisplayMode
=
"FirstLastPreviousNext"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Stretch"
Margin
=
"10,0,10,0"
Source
=
"{Binding DataView, ElementName=ddsEmployeeSelectUC}"
/>
</
Grid
>