hi
how to count the cell text in the gridview.

Recommended Answers

All 2 Replies

How to count cells? - Rows X Columns. Isn't it? Show your work.

Finally!
After 3 threads I think I know what you mean. I think you mean set the text wrap of a cell to true. This means that the text, when you type continues on a second line in the same cell.
Do it like this :

const int thirdColumn = 2;
          
            DataGridViewCell cell = new DataGridViewTextBoxCell();
            cell.Style.WrapMode = DataGridViewTriState.True; //set text wrap to true

            //set text cell template for third column of dataGridView1
            DataGridViewColumn column = dataGridView1.Columns[thirdColumn];
            column.CellTemplate = cell;

Please reply to THIS thread, don't always start a newone when you have something to say.

commented: Yes - you have something to say. +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.