private object source;
#if NET_2_0
//private string dataSourceId;
+ IDataSource boundDataSource = null;
private bool initialized;
private bool requiresDataBinding;
private DataSourceSelectArguments selectArguments;
if (DataSourceID.Length == 0)
return null;
- IDataSource ds = null;
+ if (boundDataSource == null)
+ ConnectToDataSource ();
- if (NamingContainer != null)
- ds = (NamingContainer.FindControl (DataSourceID) as IDataSource);
-
- if (ds == null) {
- if (Parent != null)
- ds = (Parent.FindControl (DataSourceID) as IDataSource);
-
- if (ds == null)
- throw new HttpException (Locale.GetText ("Coulnd't find a DataSource named '{0}'.", DataSourceID));
- }
-
- DataSourceView dsv = ds.GetView (String.Empty);
+ DataSourceView dsv = boundDataSource.GetView (String.Empty);
dsv.Select (SelectArguments, new DataSourceViewSelectCallback (SelectCallback));
return data;
}
if ((Page != null) && !Page.IsPostBack)
RequiresDataBinding = true;
+ if (IsBoundUsingDataSourceID)
+ ConnectToDataSource ();
+
initialized = true;
base.OnLoad (e);
}
return false;
}
}
+
+#if NET_2_0
+ void ConnectToDataSource ()
+ {
+ if (NamingContainer != null)
+ boundDataSource = (NamingContainer.FindControl (DataSourceID) as IDataSource);
+
+ if (boundDataSource == null) {
+ if (Parent != null)
+ boundDataSource = (Parent.FindControl (DataSourceID) as IDataSource);
+
+ if (boundDataSource == null)
+ throw new HttpException (Locale.GetText ("Coulnd't find a DataSource named '{0}'.", DataSourceID));
+ }
+ DataSourceView dsv = boundDataSource.GetView (String.Empty);
+ dsv.DataSourceViewChanged += new EventHandler (OnDataSourceViewChanged);
+ }
+#endif
}
}
+2006-06-14 Vladimir Krasnov <vladimirk@mainsoft.com>
+
+ * BaseDataList.cs: added ConnectToDataSource method that called from
+ OnLoad, fixed GetData method
+ * Wizard.cs: fixed bug when called MoveTo after that control hierarchy
+ has been created
+
2006-06-14 Andrew Skiba <andrews@mainsoft.com>
* Menu.cs: add CssStyle value to the rendered class attribute