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

WindowManager Exception

2 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 19 Aug 2011, 12:38 PM
Hi

I am trying to call a RadWindow Alert from a RadGrid ItemCommand but get this exception

"Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object."

I am trying to test for some selected items within a sub-grid, so my code is:

public static void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            RadGrid RadGrid1 = (RadGrid)sender;
            if (e.CommandName == "AddToCart")
            {
                if (RadGrid1.SelectedIndexes.Count == 0)
                {
                    RadWindowManager1.RadAlert("No documents have been selected", 250, 100, "Add to Document Cart", "");
                    return;
                }
                GridCommandItem Item = (GridCommandItem)e.Item;
                ImageButton btnAddToCart = (ImageButton)e.Item.FindControl("btnAddSelectedToCart");
                ....
                ..... rest of code...
            }
}

This errors on the RadAlert line...
Any clues please.

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 19 Aug 2011, 01:07 PM
Hello,

I am not able to generate this error.

Please check below link
http://www.telerik.com/community/forums/aspnet-ajax/ajax/pagerequestmanagerservererrorexception.aspx

Note : may be this issue is not from control side its your from your page.

Let me know if any concern.

Thanks,
Jayesh Goyani
0
Simon
Top achievements
Rank 1
answered on 19 Aug 2011, 02:53 PM
Thanks Jayesh,

I created a new form and added the code bit by bit and now it is working ??
There was obviously some corruption in the form.

The links you provided were very useful background information.

Kind regards

Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Simon
Top achievements
Rank 1
Share this question
or