views:

1155

answers:

5
A: 

img didnt work. this si second take.

http://img17.imageshack.us/img17/7054/20090306190547.png' border='0'/>

A: 

Maybe this link is of some help.

kgiannakakis
A: 

thanks, i now got below code but it has no effect on column width

        DataTable dt = new LoadGenres().Load(strFullPathToMyFile).Tables[0];        genreGrid.DataSource = dt;            
        DataGridTableStyle ts1 = new DataGridTableStyle();
        ts1.MappingName = dt.TableName.ToString();
        DataGridColumnStyle textCol1 = new DataGridTextBoxColumn();
        textCol1.MappingName = dt.Columns[0].ColumnName.ToString();
        textCol1.HeaderText = "genre";
        textCol1.Width = 300;
        ts1.GridColumnStyles.Add(textCol1);
A: 

above code is in

MainForm_Load

section but even if i put it in

InitializeComponent()

it still doesnt effect column width

A: 

got it with

DataTable myTable = new DataTable(); myTable = new LoadGenres().Load(strFullPathToMyFile).Tables[0]; genreGrid.DataSource = myTable; DataGridTableStyle tableStyle = new DataGridTableStyle(); tableStyle.MappingName = myTable.TableName.ToString(); DataGridTextBoxColumn tbcName = new DataGridTextBoxColumn(); tbcName.Width = Screen.PrimaryScreen.WorkingArea.Width; tbcName.MappingName = myTable.Columns[0].ColumnName.ToString(); //tbcName.HeaderText = myTable.Columns[0].ColumnName.ToString(); tableStyle.GridColumnStyles.Add(tbcName); genreGrid.TableStyles.Clear(); genreGrid.TableStyles.Add(tableStyle);

nLL