Thursday, 25 April 2013

Basics of C#

What is an Object? An object can be considered a "thing" that can perform a set of related activities. Any real entity. For example: The hand can grip something. A fish in water (fish is an object). An idea comes in your mind, and you implement it (the idea is an object). Fruit in an orchard...

Thursday, 18 April 2013

How to Change color in dataGridView cell..

If you  want to change the ForeColor and back ground color in the cell when the text is not in the correct format, I have this code to change the color after the text is entered private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e) { dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.ForeColor = Color.Red; dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor=...

Friday, 12 April 2013

Print Windows form in c#

Print Windows form in c#, just add a printDocument from the toolbox by dragging to the form ..i wrote the code for printing the form on button click....  using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using...

How to add ComboBox dynamically to a Gridview on button click event?

Below i wrote a code by which you can add a combobox to a grid view on button click event.  private void BTN_ADD_Click(object sender, EventArgs e) {  int j=0;           DataGridViewComboBoxCell ColumnItem2 = new DataGridViewComboBoxCell();  // create a combobox cell                 ColumnItem2.ValueMember = "Display";  ...