protected override void DataBind(BaseDataBoundControl dataBoundControl)
 {
     IEnumerable designTimeDataSource = this.GetDesignTimeDataSource();
     string dataSourceID = dataBoundControl.DataSourceID;
     object dataSource = dataBoundControl.DataSource;
     dataBoundControl.DataSource = designTimeDataSource;
     dataBoundControl.DataSourceID = string.Empty;
     try
     {
         if (designTimeDataSource != null)
         {
             dataBoundControl.DataBind();
         }
     }
     finally
     {
         dataBoundControl.DataSource = dataSource;
         dataBoundControl.DataSourceID = dataSourceID;
     }
 }
Ejemplo n.º 2
0
 public static void Bind2Gridview(BaseDataBoundControl gdv, DataTable dt)
 {
     gdv.DataSource = dt;
     gdv.DataBind();
 }
Ejemplo n.º 3
0
 // This function binds the given ListView with the given data table.
 public static void Bind2DetailsView(BaseDataBoundControl dv, DataTable dt)
 {
     dv.DataSource = dt;
     dv.DataBind();
 }
Ejemplo n.º 4
0
 protected override void DataBind(BaseDataBoundControl dataBoundControl)
 {
     try
     {
         dataBoundControl.DataBind();
     }
     catch
     {
         base.DataBind(dataBoundControl);
     }
 }