-
Feb 14th, 2025, 06:00 PM
#1
Thread Starter
Member
Multi line Datagridview cell
I have a Datagridview that I add multiple lines of text to each cell. I have that working fine. Now I'm trying figure out how to be able to delete a single line of text without deleting all text in the cell. Any suggestions?
-
Feb 14th, 2025, 06:46 PM
#2
Thread Starter
Member
Re: Multi line Datagridview cell
-
Feb 14th, 2025, 09:02 PM
#3
Thread Starter
Member
Re: Multi line Datagridview cell
One more question, How to Split each line and put them into separate text boxes.
-
Feb 15th, 2025, 12:34 AM
#4
Re: Multi line Datagridview cell
Are you asking how to do it in the UI or programmatically? I assume the latter. In that case, the Value of the cell is a String, just like any other. If you have line breaks in the text, rather than just relying on word wrap, you can split the String on the line breaks, remove the desired line from the result and then join the remaining lines back together. This applies to any String and has nothing specific to do with your grid. String.Split and String.Join are the tools you want.
-
Feb 16th, 2025, 05:02 PM
#5
Thread Starter
Member
Re: Multi line Datagridview cell
Tanks FordPrefect that's exactly what I ended up doing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|