| Author: Rex Sahaya Gregory 15 Oct 2008 | Member Level: Bronze | Rating:    Points: 6 |
string connectionString = @"Provider=Microsoft.Jet. OLEDB.4.0;Data Source=Book1.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
DbDataAdapter adapter = factory.CreateDataAdapter();
DbCommand selectCommand = factory.CreateCommand(); selectCommand.CommandText = "SELECT ID,City,State FROM [Cities$]";
DbConnection connection = factory.CreateConnection(); connection.ConnectionString = connectionString;
selectCommand.Connection = connection;
adapter.SelectCommand = selectCommand;
DataSet cities = new DataSet();
adapter.Fill(cities);
gridEX1.SetDataBinding(cities.Tables[0], ""); gridEX1.RetrieveStructure();
|
| Author: Pradeep Iyer 10 Dec 2008 | Member Level: Diamond | Rating:  Points: 6 |
The BehaviorEditorPart class is an editor control that derives from the EditorPart class, and is used to edit properties that affect the behavior of an associated WebPart or GenericWebPart control.
BehaviorEditorPart – This editor part alters the visibility of verbs
Web parts are reusable pieces of code that are logically grouped together into one unit. They can be a single standard .NET server control, a web user control, or a custom control. Editor part controls can be used to change the design and layout of web parts in the browser at runtime. These controls edit the default properties made available through the web part framework, which are retained through the personalization provider. Some of the properties available from the editors include: title, height, width, chrome type, direction, zone index, and many other properties. The .NET framework offers several editor parts out of the box:
AppearanceEditorPart – This editor part alters the title, width, height, chrome type, and other properties of existing editor parts. BehaviorEditorPart – This editor part alters the visibility of verbs (close, minimize, restore, etc.), as well as editing the description and images used in the web part. LayoutEditorPart – This editor part changes the location of an editor part, through the zone name or the zone index. PropertyGridEditorPart – This editor part edits custom properties; this editor will be discussed in a future article.
Web parts exist within a "zone", a container control that can contain one or more web parts. Zones define regions within the application that web parts must belong in. They also define user interface features of web parts, such as title color and style, as well as the availability of web part verbs (standard or customizable actions that can be performed for web parts and zones, such as the Close or Minimize verbs). Editor parts can only appear within an editor zone, and no other type. This is the same for other types of zones; web parts can only appear in web part zones, as well as catalog parts can only appear in catalog zones.
Regards, Pradeep Iyer
|