AllowFilteringByColumn
="True"
| HtmlInputButton partAddButton = new HtmlInputButton(); |
| partAddButton.ID = "uiPartAddButton"; |
| partAddButton.Value = "Add A Web Part"; |
| partAddButton.Attributes.Add("onclick", "openWin_" + this.UniqueID + "(); return false;"); |
| partAddButton.RenderControl(writer); |
| StringBuilder script = new StringBuilder(); |
| script.Append("<script type=\"text/javascript\">"); |
| script.Append("function openWin_" + this.UniqueID + "() {"); |
| script.Append("var windowMan = GetRadWindowManager();"); |
| script.Append("var windowPane = windowMan.GetWindowByName('uiNewPartsWizard');"); |
| script.Append("windowPane.SetUrl('PortalWebPartCatalogPage.aspx?ControlID=" + this.UniqueID + "&ZoneId=" + this.currentZone.PortalPageZoneID.ToString() + "&Scope=" + this.WebPartManager.Personalization.Scope.ToString() + "');"); |
| script.Append("windowPane.SetTitle('New Web Part Wizard');"); |
| script.Append("windowPane.setSize(1000,650);"); |
| script.Append("windowPane.Show();}"); |
| script.Append("</script>"); |

Hi, all:
I got the "A critical error has occurred. Object reference not set to an instance of an object." error message, and this is b/c the e.NewObject within the LinqDataSource_Inserting event is null when I am inserting data.
The background of the problem:
I have two RadGrids. The top one contains contacts, and the bottom one contains one or more notes concerning a selected contact from the top grid. The user can create his own list of note subjects, from which he can choose only one when creating a new note. This list of subjects is bound to a dropdownlist with the markup below:
<asp:DropDownList ID="ddl_subjects" runat="server"
DataSourceID="LinqDS_Subjects" DataTextField="Subject"
DataValueField="SubjectId"
SelectedValue='<%# Bind("SubjectId") %>'
AppendDataBoundItems="True" >
<asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem>
</asp:DropDownList>
Every time when I create a new note, if I pick one of the bound values, the note inserts fine. But whenever I pick "Select", which has a value of null, to intentionally not assign a subject to the note, I get that error message. I spent hours debugging, but to no avail. So your help is greatly appreciated.
Han