Silverlight Page Crash + GRId Row loaded event

6 posts, 0 answers
  1. Nikhil
    Nikhil avatar
    23 posts
    Member since:
    May 2009

    Posted 29 Jul 2009 Link to this post


    Can you please help me with following issue ? 

    we are using SL 2.0 and most recent version of the Telerik controls. On SL page we have a telerik Grid which has a Radio Button Column. 

    We have implemented a  Search functionality on SL page , On click of Search button it calls a Web Service (with required Search criteria )  and the result received from Web Service is displayed in Telerik RAD GRId. User then select a particular Row in GRid  by Checking the Radion button corresponding for that Row and another function is called with Selected Row data as parameter.

    Grid shows 5 records at one shot and if the user needs to see more data he needs to Scroll Down in Grid , using  Grids Vertical Scroll bar  

    My application works perfectly fine if User don't do any scrolling in Telerik Grid, i.e i can call Search any number of times without any problem....every time it will call web service with out any problem.

    but if user scroll down i in Grid to see more search results .. and after that try to Search with another criteria .... My Silverlight application Crashses ..,,,,and a blank screen shows up ...i tried to debug this but it don't show any exception ...this is happenign very consistently ..if  don't do any scrolling in Telerik grid ...application works perfectly fine...but crashes if we do scrolling to select another row,,,or to see all the data and then try search again.

    Below is My GRID .XAML  and Code For ROWLOADED Event

    I have implemented following method on Rowloaded event for RadGrid ..which I have received earlier from telerik to ensure that only one Radion button is selected in the RADIO Button Column and user cannot check multiple radio buttons..with below code user can select only radio button at one time

    I also tried to comment all the code in ROWLOADED event and test my application but if i Scroll down in Telerik Grid and try searching again application crashes while calling Web Service

    1. ROWLoaded EVENT

           void RadGridView1_RowLoaded(object sender, RowLoadedEventArgs e)

                if (!(e.Row is GridViewNewRow) && !(e.Row is GridViewHeaderRow))
                    var cell = e.Row.Cells.Where(c => c.Column.UniqueName == "").FirstOrDefault();
                    if (cell != null)
                        var radioButton = cell.ChildrenOfType<RadioButton>().FirstOrDefault();
                        if (radioButton != null)
                                new Binding("IsSelected") { Source = e.Row.Record, Mode = BindingMode.TwoWay });

                            POCount = POCount + 1;


    <StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,35,0,0"  >

                                   <twcgv:RadGridView x:Name="RadGridView1"
                                   Margin ="0,-30,0,0"
                                   Style="{StaticResource BPRadGridViewStyle}"
                                   RowStyle="{StaticResource RowStyle}"
                                   AlternateRowStyle="{StaticResource RowStyle_Alternate}"

                                        <twcgv:RadGridView.Columns  >
                                            <twcgv:GridViewColumn UniqueName="">
                                                        <RadioButton   Checked="RadioButton_Checked"  MaxWidth="20" MinWidth="20"  />

                                            <twcgv:GridViewDataColumn HeaderText="PO#" UniqueName="PONumber" Width="90" />
                                            <twcgv:GridViewDataColumn HeaderText="Vendor Name" UniqueName="VendorName" Width="200" />
                                            <twcgv:GridViewDataColumn HeaderText="Description" UniqueName="MaterialDescription" Width="200" />
                                            <twcgv:GridViewDataColumn HeaderText="Cost Center" UniqueName="CostCenter" Width="120" />
                                            <twcgv:GridViewDataColumn HeaderText="WBS" UniqueName="WBS" Width="90" />
                                            <twcgv:GridViewDataColumn HeaderText="Plant Name" UniqueName="PlantName" Width="200"/>



    With thanks and regards
    Nikhil Jain

  2. Hristo
    Hristo avatar
    832 posts

    Posted 03 Aug 2009 Link to this post

    Hello Nikhil,

    Could you send us the project so we can investigate this further?

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Simone Ravetto
    Simone Ravetto avatar
    7 posts
    Member since:
    Dec 2009

    Posted 03 Feb 2010 Link to this post

    I have a similar problem using Q3 controls in silverlight 3.
    I put into a GridView some data using RowLoaded method, used to set checked property in a GridViewSelectColumn. When I scroll down I have an error because some cells seems to be null.
    My code:

            private void rg_RowLoaded(object sender, RowLoadedEventArgs e)
                GridViewRow row = e.Row as GridViewRow;
                string data = "example data";

                if (row != null && data != null)
                        // setting checkbox value
                        if (data != null)
                            (row.Cells[0].Content as CheckBox).IsChecked = true;
                            (row.Cells[0].Content as CheckBox).IsChecked = false;

    Sometimes row.Cells[0].Content is null.
    Can I use direct databinding? How?
  4. Vlad
    Vlad avatar
    11100 posts

    Posted 08 Feb 2010 Link to this post


    Since this column CheckBox is two way bound to IsSelected row property you can use this property instead and the column CheckBox will respect this immediately.

    Kind regards,
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  5. abdul rahman
    abdul rahman avatar
    7 posts
    Member since:
    Sep 2004

    Posted 27 Mar 2010 Link to this post

    Hi ,

    I have the same problem with Q1 2010 (2010.1.309.1030)

    When ever i scroll,
    i get the  row.Cells[0].Content  as null.??

    Can you please help
  6. Vlad
    Vlad avatar
    11100 posts

    Posted 29 Mar 2010 Link to this post


    I've checked this however everything worked fine on my end - the content is CheckBox.

    Kind regards,
    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.
Back to Top