F
flyingfeather
Unregistered / Unconfirmed
GUEST, unregistred user!
在ColumnStyle中的ENTITYCODE列无法显示出来,选择到的列竟然是ENTITYCODE列的内容??!!! 请各位帮忙,看问题在哪里????
代码如下:
private void CreateStylesDetail ( DataGrid dg )
{
// Create a DataGridTableStyle for the customers table
DataGridTableStyle style = new DataGridTableStyle ( ) ;
// Map this style to the Customers DataTable
style.MappingName = "ENTITY_COLUMNLIST" ;
// Setup each alternate row in a different colour
style.AlternatingBackColor = System.Drawing.Color.Bisque ;
DataGridListBoxColumnStyle ENTITYCODE = new DataGridListBoxColumnStyle ( ) ;
ENTITYCODE.HeaderText = "实体代码" ;
ENTITYCODE.MappingName = "ENTITYCODE" ;
ENTITYCODE.Width = 100 ;
ENTITYCODE.DataSource = this.dsMaster.Tables["ENTITY_COLUMNLIST"];
ENTITYCODE.ValueMember = "ENTITYCODE";
ENTITYCODE.DisplayMember = "ENTITYCODE";
style.GridColumnStyles.AddRange ( new DataGridColumnStyle [] { ENTITYCODE, TABLECODE,COLUMNCODE ,COLUMNALIAS } ) ;
dg.TableStyles.Add ( style ) ;
}
代码如下:
private void CreateStylesDetail ( DataGrid dg )
{
// Create a DataGridTableStyle for the customers table
DataGridTableStyle style = new DataGridTableStyle ( ) ;
// Map this style to the Customers DataTable
style.MappingName = "ENTITY_COLUMNLIST" ;
// Setup each alternate row in a different colour
style.AlternatingBackColor = System.Drawing.Color.Bisque ;
DataGridListBoxColumnStyle ENTITYCODE = new DataGridListBoxColumnStyle ( ) ;
ENTITYCODE.HeaderText = "实体代码" ;
ENTITYCODE.MappingName = "ENTITYCODE" ;
ENTITYCODE.Width = 100 ;
ENTITYCODE.DataSource = this.dsMaster.Tables["ENTITY_COLUMNLIST"];
ENTITYCODE.ValueMember = "ENTITYCODE";
ENTITYCODE.DisplayMember = "ENTITYCODE";
style.GridColumnStyles.AddRange ( new DataGridColumnStyle [] { ENTITYCODE, TABLECODE,COLUMNCODE ,COLUMNALIAS } ) ;
dg.TableStyles.Add ( style ) ;
}