Click here to Skip to main content
Sign Up to vote bad
good
See more: C#4.0
Dear Friends,
How to Add Rows in Existing Rich Text Box table.
 
For Example, If I will open RTF File and in that RTF file already have Table ,So I need to add more rows On that Table.
Posted 4 Jan '13 - 3:55
Edited 4 Jan '13 - 19:25

Comments
Sandeep Mewara - 4 Jan '13 - 9:58
Rich Text Box table? Can you elaborate what are you trying to do?
Sergey Alexandrovich Kryukov - 4 Jan '13 - 11:36
This is quite possible, if I'm not much mistaken. I added even the images... —SA
Sandeep Mewara - 4 Jan '13 - 11:37
? I didn't get you SA. You wrote the comment to correct question?
Sergey Alexandrovich Kryukov - 4 Jan '13 - 11:39
No, I decided to give this note to OP the way you could also read it. I want to say that I think this question is correct. OP already has a table as Rich Text, wants to modify it. —SA
Sandeep Mewara - 4 Jan '13 - 11:46
Basically, I was confused by statement: "I added even the images..." Sounds like you were trying to convey, not just adding rows, but adding images are possible in rich textbox table. Further, now when I read it few times, I guess I got what richtextbox table is. Thanks to your comment. :)
shaikh-adil - 4 Jan '13 - 12:15
http://www.codeproject.com/Questions/521745/transferingplustheplustextplusfromplusdynamicallyp can you help me sir please if you can
Sergey Alexandrovich Kryukov - 4 Jan '13 - 16:09
I don't think so. How could it help? —SA
Sergey Alexandrovich Kryukov - 4 Jan '13 - 16:08
Yes. Sorry, I was quick but not clear. I mean, I personally tried to add images to the rich text to help some of members; and this cannot be done directly using the API. You need to handle the format at low level, buy I simply used clipboard (which is apparently not a good solution). Same thing with tables, bit a clipboard cannot help OP. It really takes digging in the format (or use some 3rd-party tool which does that to extend the API)... —SA
Sandeep Mewara - 4 Jan '13 - 22:21
Thanks SA. All clear. :)
Sergey Alexandrovich Kryukov - 4 Jan '13 - 23:30
Yee... I mean, look at the answer by Mike Hankey... I upvoted... —SA
mayuryewale - 5 Jan '13 - 6:59
How to Add Rows in Existing Rich Text Box table. For Example, If I will open RTF File and in that RTF file already have Table ,So I need to add more rows On that Table.

1 solution

You have to know the Rich Text Format(RTF) to be able to manually modify the text in an RTF buffer.
An RTF table is defined as a collection of rows that contain cells.
 
An example;
|---------------------------|
|  Row1Cell1  | Row1Cell2   |
|---------------------------|
 
The corresponding RTF is;
{
  \trowd \trgraph180
  \cellx1440\cellx2800
  \pard\intbl Row1Cell1 \cell
  \pard\intbl Row1Cell2 \cell  
  \trow
}
 
The curly brackets are optional and added for readability
\trgraph180 - This row has cells with internal margins of at least 180 twips
\cellx1440\cellx2800 - This row contains 2 cells the fist ends at 1440 twips from left margin and the second 2800 twips from left margin.
\pard\intbl Row1Cell1 \cell - Cell contents
\pard\intbl Row1Cell2 \cell - Cell contents
  Permalink  
Comments
Sergey Alexandrovich Kryukov - 4 Jan '13 - 23:28
Ah, somebody knows all that foolery, "pard", "trowd", has patience... Respect, a 5. —SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 415
1 Arun Vasu 399
2 Sergey Alexandrovich Kryukov 368
3 Tadit Dash 198
4 Maciej Los 191
0 Sergey Alexandrovich Kryukov 9,955
1 OriginalGriff 7,589
2 CPallini 4,028
3 Rohan Leuva 3,422
4 Maciej Los 2,949


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 5 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid