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

How to Find and Access ChildGrids?

1 Answer 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kristine
Top achievements
Rank 2
Kristine asked on 15 Apr 2011, 11:42 AM
Hi Telerik Team,

I have a code that looks like this:

public bool Get_GridRows(Telerik.WebAii.Controls.Xaml.RadGridView RadGrid, StringCollection TaskCodeAry)
{
    bool newrow = false;
    RadGrid.Refresh();
    IList<Telerik.WebAii.Controls.Xaml.GridViewRow> Rows = RadGrid.Find.AllByType<Telerik.WebAii.Controls.Xaml.GridViewRow>();
    foreach(Telerik.WebAii.Controls.Xaml.GridViewRow row in Rows)
    {
        TaskGridRow CurrentRow = new TaskGridRow();
        CurrentRow.TaskCode = row.Cells[CodeColumn].Text;
        CurrentRow.Summary  = row.Cells[TitleColumn].Text;
        Logger.log_success(TestId, string.Format("Reference Code {0}: {1}", CurrentRow.TaskCode, CurrentRow.Summary));
        if(!TaskCodeAry.Contains(CurrentRow.TaskCode))
        {
            TaskCodeAry.Add(CurrentRow.TaskCode);
            Grid.Rows.Add(CurrentRow);
            newrow = true;
            Telerik.WebAii.Controls.Xaml.RadGridView childgrid = row.Find.ByType<Telerik.WebAii.Controls.Xaml.RadGridView>();
            if(childgrid != null)
            {
                foreach(Telerik.WebAii.Controls.Xaml.GridViewRow childrow in childgrid.Rows)
                {
                    TaskGridRow child = new TaskGridRow();
                    child.TaskCode    = childrow.Cells[CodeColumn-1].Text;
                    child.Summary     = childrow.Cells[TitleColumn-1].Text;
                    child.IsChild     = true;
                    child.ParentCode  = CurrentRow.TaskCode;
                    Grid.Rows.Add(child);
                }
            }
        }
    }
    return newrow;
}

The line for finding childgrid in the current row is currently throwing a timout exception. I also tried accessing the ChildGridView attribute of the GridViewRow but I had the same error. Can you please help me pinpoint what's wrong with the above code?


Regards,
Kristine

1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 19 Apr 2011, 02:00 PM
Hello Kristine,
    analyzing code without the application it runs against is a daunting task. Also a couple of variables used in your method ([CodeColumn], [TitleColumn]) are not defined in the method itself so I have no way of telling what values they might take. The class TaskGridRow is also a custom class extending GridRow and there's no way I can tell what exactly it's supposed to do. In order check whether your code is correct please provide the following things:
-access to the part of the application where the code is supposed to run
-a test (containing the code) which can be run instantly (i.e. containing all the necessary definitions)
Basically we need to reproduce the problem before we can begin troubleshooting it. Please give us a test to run which will do that and we'll troubleshoot the code contained within the test. Also please describe the exact purpose of the code.

If you consider the data I'm asking for to be sensitive you can post it in a support ticket. Unlike forum posts support tickets are completely confidential.

Hope to hear from you soon.

Greetings,
Stoich
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
General Discussions
Asked by
Kristine
Top achievements
Rank 2
Answers by
Stoich
Telerik team
Share this question
or