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

Sub Objects and Filtering

3 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aayam
Top achievements
Rank 1
Aayam asked on 25 Apr 2010, 03:24 PM
Hi Experts,

We have a Grid that we bind using the Simple Object collection.
The Format of the Object is such that:
ParentObject
            ChildObjectCollection
                        ChildObjectProperty

Hence when we bind our grid we provide the collection of ParentObject to it.
We have a GridBoundColumn there with following settings:
    .UniqueName = "MyColumn"

    .DataField =

"ChildObject(0).sFullName"  or "ChildObject.(0).sFullName" 

 

    .DataType =

GetType(String)

This work perfectly fine and we are able to see the data as required.
But the issue is that when we are  trying to filter on this column its not responding at all and seems like its not able to find the column itself.Hence the grid is still intact with same number of rows.
We have also set the EnableLinqExpressions = false, hence filtering operation is more close to SQL version.
I also tried setting the FilterExpression manually before the NeedDataSource Event and check that expression is still there.But still same result.
Please let me know if you have ideas.
Thanks for  your help in advance

Regards,
Aayam Singh

 

3 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 28 Apr 2010, 09:28 AM
Hi Aayam,

I have tried to reproduce the problem in the attached sample but to no success. Could you take a look at it and get back with more details on how to reproduce the issue.

Thanks.

Regards,
Tsvetoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Aayam
Top achievements
Rank 1
answered on 30 Apr 2010, 05:51 AM
Hi Tsvetoslav,
Thanks you for replying.
We had a look at the sample you had attached and its working fine.
The only deviation from out requirement is that , say in Movie Class we store the collection of SkuAvail object rather than just one instance.
Hence the property would look something like

 private SkuAvail() _SkuAvailability;

    public SkuAvail() SkuAvailability
    {
        get { return _SkuAvailability; }
        set { _SkuAvailability = value; }
    }

Hence if we would need to assign the Description property from SkuAvail object to a GridBoundColumn when the datasoruce is collection of Movie object would be something like:

Dim objGridDescriptionColumn as New GridBoundCOlumn
With objGridDescriptionColumn
    .UniqueName = "Description"
    .Datafield = "SkuAvailability(0).Desciption"
..........

or .Datafield = "SkuAvailability.(0).Desciption"
End With

and this works fine and data is displayed in the Column of Grid.
But when i filter on this coulmn it return same number as before.

So just wanted to confirm if we can achieve something like this.

Regards,
Aayam Singh

0
Tsvetoslav
Telerik team
answered on 05 May 2010, 11:00 AM
Hello Aayam,

Thanks for the clarification. I am afraid such a scenario is not supported by the RadGrid control - what you need to do is to flatten your custom object into another one that will have only single object properties.

Regards,
Tsvetoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Aayam
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Aayam
Top achievements
Rank 1
Share this question
or