DataGrid Dynamic Row Size 
Author Message
 DataGrid Dynamic Row Size

I'm trying to update a datagrid's row preferredcolumnwidth...

Am i missing something, this doesnt seem to be working.  It works when I
place it in the Form1_Loan event function but not in the form resize
function.

private void Form1_Resize(object sender, System.EventArgs e)
{
int dataGridWidth = Form1.ActiveForm.Width - 35;
dataGrid1.Width = dataGridWidth;
int eachRowSize = (dataGridWidth) / 7;
dataGrid1.PreferredColumnWidth = eachRowSize;
textBox1.Text = dataGridWidth1.ToString();
textBox1.Update();

dataGrid1.PreferredColumnWidth = eachRowSize;
//dataGrid1.Update();

Quote:
}



Sat, 28 May 2005 02:14:36 GMT  
 DataGrid Dynamic Row Size
I guess that should have said dynamic column size, not rowsize...


Quote:
> I'm trying to update a datagrid's row preferredcolumnwidth...

> Am i missing something, this doesnt seem to be working.  It works when I
> place it in the Form1_Loan event function but not in the form resize
> function.

> private void Form1_Resize(object sender, System.EventArgs e)
> {
> int dataGridWidth = Form1.ActiveForm.Width - 35;
> dataGrid1.Width = dataGridWidth;
> int eachRowSize = (dataGridWidth) / 7;
> dataGrid1.PreferredColumnWidth = eachRowSize;
> textBox1.Text = dataGridWidth1.ToString();
> textBox1.Update();

> dataGrid1.PreferredColumnWidth = eachRowSize;
> //dataGrid1.Update();
> }



Sat, 28 May 2005 02:43:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to avoid user from entering a new row into the datagrid[which already contains rows]

2. changing row colors in DataGrid (not a web DataGrid)

3. How to disable adding, inserting ord deleting Rows in the DataGrid (System.Windows.Forms.DataGrid)

4. Getting current ROW information in DataGrid

5. Readonly rows in DataGrid

6. DataGrid Row Colours

7. finding a row and selecting it in a datagrid

8. Readonly rows in DatagRid

9. Add Row To dataGrid through loop

10. DataGrid Header Row Height

11. Highlighting rows in a datagrid

12. DataTable.Rows.InsertAt vs. DataGrid

 

 
Powered by phpBB® Forum Software