日期:2014-05-17 浏览次数:20731 次
<dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server"
DataSourceID="masterDataSource" KeyFieldName="id" Width="100%">
<asp:SqlDataSource ID="masterDataSource" runat="server"
providerName="System.Data.SqlClient" SelectCommand="select * from table">
</asp:SqlDataSource>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack){
string connStr =
WebConfigurationManager.ConnectionStrings["MySql"].ConnectionString;
masterDataSource.ConnectionString = connStr;
grid.DataBind();
grid.DetailRows.ExpandRow(0);
}
}
<dx:ASPxGridView ID="Grid" class="Colsed" runat="server" AutoGenerateColumns="False"
Settings-VerticalScrollableHeight="300" KeyFieldName="DEPTNAME"
Theme="BlackGlass" ClientInstanceName="grid" OnCustomUnboundColumnData="Grid_CustomUnboundColumnData"
EnableViewState="False" EnableTheming="True" SettingsBehavior-AllowFocusedRow="true">