Hi,
I am using following code for RadDaominDataSource to load RadGridView, RadDataFilter and RadDataPager.
The above code working good.
Now, I have a chart in the same page and I want populate the grid data, based on the chart item selection.
So I set the Auto Load property to False and I have implemented the following code in the Item click event to load the data in the Grid.
I am setting the Filter descriptors of the RadDomainDataSource when we click on the chart item.
With the above code, I am able to load the GridView properly, when I click on the Chart Item for first time.
When I click on another chart item, then it is loading all the records, instead of the records related to the sected SId.
Please help me in fixing this.
Regards,
SivaPrasad.B
I am using following code for RadDaominDataSource to load RadGridView, RadDataFilter and RadDataPager.
<
telerik:RadDomainDataSource
Name
=
"TDomainDataSource"
QueryName
=
"GetData"
AutoLoad
=
"True"
PageSize
=
"10"
Height
=
"0"
Width
=
"0"
>
<
telerik:RadDomainDataSource.DomainContext
>
<
local:TDomainContext
></
local:TDomainContext
>
</
telerik:RadDomainDataSource.DomainContext
>
<
telerik:RadDomainDataSource.SortDescriptors
>
<
telerik:SortDescriptor
Member
=
"ReferenceNumber"
></
telerik:SortDescriptor
>
</
telerik:RadDomainDataSource.SortDescriptors
>
<
telerik:RadDomainDataSource.FilterDescriptors
>
<
telerik:FilterDescriptor
Member
=
"SId"
Operator
=
"IsEqualTo"
Value
=
"2"
></
telerik:FilterDescriptor
>
</
telerik:RadDomainDataSource.FilterDescriptors
>
</
telerik:RadDomainDataSource
>
<
telerik:RadGridView
Name
=
"customerGridView"
Width
=
"900"
Height
=
"360"
ItemsSource
=
"{Binding DataView, ElementName=TDomainDataSource}"
>
</
telerik:RadGridView
>
<
telerik:RadDataPager
x:Name
=
"radDataPager"
Width
=
"900"
Height
=
"40"
Source
=
"{Binding DataView, ElementName=TDomainDataSource}"
DisplayMode
=
"All"
IsTotalItemCountFixed
=
"True"
/>
<
telerik:RadDataFilter
x:Name
=
"radDataFilter"
Source
=
"{Binding DataView, ElementName=TDomainDataSource}"
>
</
telerik:RadDataFilter
>
The above code working good.
Now, I have a chart in the same page and I want populate the grid data, based on the chart item selection.
So I set the Auto Load property to False and I have implemented the following code in the Item click event to load the data in the Grid.
I am setting the Filter descriptors of the RadDomainDataSource when we click on the chart item.
private
void
TSChartArea_ItemClick(
object
sender, ChartItemClickEventArgs e)
{
SId = ((TransactionsVsSecurityType)e.DataPoint.DataItem).SId;
TDomainDataSource.FilterDescriptors.Clear();
customerGridView.ItemsSource = null;
LoadGridView(SId );
}
private
void
LoadGridView(
int
SId)
{
Telerik.Windows.Data.FilterDescriptor FD =
new
Telerik.Windows.Data.FilterDescriptor();
FD.Member =
"SId"
;
FD.Operator = Telerik.Windows.Data.FilterOperator.IsEqualTo;
FD.Value = SId;
TDomainDataSource.FilterDescriptors.Add(FD);
TDomainContext TnDomainContext;
TnDomainContext = TDomainDataSource.DomainContext
as
TDomainContext;
TnDomainContext.Load<TDTO>(TnDomainContext.GetTransactionsQuery(),
new
Action<LoadOperation<TDTO>>(LoadGridCompleted),
null
);
}
private
void
LoadGridCompleted(LoadOperation<TDTO> args)
{
customerGridView.ItemsSource = args.Entities;
}
With the above code, I am able to load the GridView properly, when I click on the Chart Item for first time.
When I click on another chart item, then it is loading all the records, instead of the records related to the sected SId.
Please help me in fixing this.
Regards,
SivaPrasad.B