/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public double dataGridTitleSizeRatio = 3.35; //3.563492063492063 public double dataGridSearchTermSizeRatio = 5.98; //5.986666666666667 public double dataGridURLSizeRatio = 2.27; //2.273417721518987 private void dataGrid_Resize(object sender, EventArgs e) { dataGrid.Columns[0].Width = Convert.ToInt32((Convert.ToDouble(dataGrid.Width) / dataGridTitleSizeRatio)); dataGrid.Columns[2].Width = Convert.ToInt32((Convert.ToDouble(dataGrid.Width) / dataGridSearchTermSizeRatio)); dataGrid.Columns[3].Width = Convert.ToInt32((Convert.ToDouble(dataGrid.Width) / dataGridURLSizeRatio)); }