Link to home
Start Free TrialLog in
Avatar of shinymoon
shinymoon

asked on

question about DataGridView

Hi,

I have a DataGridView with two columns. I want to use the first colum to display line numbers and the second one to display information. I chose DataGridViewTextBoxColumn to use. But, I don't know how to display my information with this object. I looked through msdn DataGridViewTextBoxColumn methods, but couldn't figure out. Any better way to do this is also welcomed . Thank you :)

ps. the information is not one line but multiple lines.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shinymoon
shinymoon

ASKER

Hi Bob,

Thanks for your answer.
So, am I supposed to write the name of data source file to DataPropertyName? But, I don't have the data as one source file. What I want to do is showing the data that is in String type to this DataGridView. I used to display this data using String builder and TextBox before, but now the situation got more complicated and need to show line numbers and other things too.  Is there any way that I can do using DataGridViewTextBoxColumn?

Thank you again :)

I am not quite sure if you are saying that you don't have the DataSource property set, and you are trying to use the DataGridView in virtual mode.  If you are trying to work with the DataGridView with VirtualMode = true, then there are events that you need to handle.

Bob
Hi Bob,

I figured out the way. Thanks :)