or
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" OnSelecting="ObjectDataSource1_Selecting" SelectMethod="select_AllWeek" TypeName="Planning.WeekDAL" DataObjectTypeName="Planning.Week" UpdateMethod="update_Week"> <SelectParameters> <asp:Parameter Name="IdFrame" Type="Int32" /> </SelectParameters> </asp:ObjectDataSource>[DataObjectMethod(DataObjectMethodType.Select)] public static List<Week> select_AllWeek(int IdFrame) {...}<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="select_Alldays" TypeName="Planning.DayDAL"></asp:ObjectDataSource>[DataObjectMethod(DataObjectMethodType.Select)] public static List<Day> select_AllDays() { ....}<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"> <MasterTableView DataSourceID="ObjectDataSource1" EditMode="InPlace"> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" Groupable="False" HeaderText="Week" UniqueName="Week" DataField="Libelle"> </telerik:GridBoundColumn> <telerik:GridDropDownColumn DataSourceID="ObjectDataSource2" ListTextField="Code" ListValueField="Id" DataField="Monday.Id" UniqueName="Monday" HeaderText="Monday" FooterStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" AllowFiltering="False" AllowSorting="False" Groupable="False"> </telerik:GridDropDownColumn> <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" Groupable="False" HeaderText="Tuesday" UniqueName="Tuesday" DataField="Tuesday.Code"> </telerik:GridBoundColumn> <telerik:GridEditCommandColumn> </telerik:GridEditCommandColumn> </Columns> <EditFormSettings> <EditColumn UniqueName="EditCommandColumn1"> </EditColumn> </EditFormSettings> </MasterTableView> <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default"> </HeaderContextMenu> </telerik:RadGrid>public class Week: IEnumerable
{ #region Fields protected List<Day> Days= new List<Day>(); private int _id; ...
# region properties
public Day Monday
{
get{return Days[0];}
set{Days[0] = value;}
}
public class Day { #region Fields private int _id; private string _code; ... #endregion #region Properties public int Id { get { return _id; } set { _id = value; } } public string Code { get {return _code;} set { _code = value;} } ... ][DataObjectMethod(DataObjectMethodType.Update)] public static void update_Week(Week oneweek) { PrepareConnexion(); connexion.Open(); ... Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 537: { Line 538: ((IStateManager)myRadFilter.RootGroup).LoadViewState(DoFilterSerialize(new BL.GPSearchFilterBL(RequestParam.RequestParamIntValue("SID")).SearchFilter)); Line 539: myRadFilter.RecreateControl(); Line 540: Line 541: myRadFilter.FireApplyCommand(); Source File: C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web.Map.TG\UI\WebControls\ResultsControl\ResultsControl.cs Line: 539 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.UI.RadFilterDataFieldEditor.CreateEditorFrom(RadFilterDataFieldEditor baseEditor) +9 Telerik.Web.UI.RadFilterDataFieldEditorCollection.RetrieveEditorForFieldName(String fieldName) +106 Telerik.Web.UI.RadFilterSingleExpressionItem.SetupFunctionInterface(Control container) +55 Telerik.Web.UI.RadFilterExpressionItem.CreateFunctionalInterface() +72 Telerik.Web.UI.RadFilter.CreateFilterItems() +286 Telerik.Web.UI.RadFilter.CreateControlHierarchy() +13 Telerik.Web.UI.RadFilter.CreateChildControls() +87 System.Web.UI.Control.EnsureChildControls() +87 Telerik.Web.UI.RadFilter.get_RootGroupItem() +21 Telerik.Web.UI.RadFilter.RecreateControl() +12 AmbiSIG.GeoPortal.Web.Map.TG.UI.WebControls.ResultsControl.ResultsControl.DoOnLoad(EventArgs e) in C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web.Map.TG\UI\WebControls\ResultsControl\ResultsControl.cs:539 AmbiSIG.GeoPortal.Web.UI.BaseCompositeControl.OnLoad(EventArgs e) in C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web\UI\BaseCompositeControl.cs:109 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 <AjaxSettings> <telerik:AjaxSetting AjaxControlID="button_launcher"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="panel" /> </UpdatedControls> </telerik:AjaxSetting></AjaxSettings>