Skip to content

Change font size from the datagridview

Enos

Asked Apr 2, 2015, 6:28 AM EDT1 answer
Share
LinkedInX
I have a combo box and label which am using to change the font size of the lable. Now what i want is to pass it to the datagridview.

from the datagridview that i have.

I have five rows and one of the cells is a combo box with items(2.4.6.8). now i want to be able to select from the combo box and it must change the font size of the cell that i made changes on

here is my code



TypeScript
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblEnos.Font = new Font(lblEnos.Font.FontFamily, Convert.ToInt32(comboBox1.SelectedItem), lblEnos.Font.Style);
        }

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Vithal Wadje
    +1
    if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover",
     
                               "this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='#FF9955';");
    }
    +1