Click here to Skip to main content
11,433,997 members (59,562 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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 4:55am
Edited 4-Jan-13 20:25pm
v2
Comments
Sandeep Mewara at 4-Jan-13 9:58am
   
Rich Text Box table? Can you elaborate what are you trying to do?
Sergey Alexandrovich Kryukov at 4-Jan-13 11:36am
   
This is quite possible, if I'm not much mistaken. I added even the images...
—SA
Sandeep Mewara at 4-Jan-13 11:37am
   
?

I didn't get you SA. You wrote the comment to correct question?
Sergey Alexandrovich Kryukov at 4-Jan-13 11:39am
   
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 at 4-Jan-13 11:46am
   
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 at 4-Jan-13 12:15pm
   
http://www.codeproject.com/Questions/521745/transferingplustheplustextplusfromplusdynamicallyp
can you help me sir please if you can
Sergey Alexandrovich Kryukov at 4-Jan-13 16:09pm
   
I don't think so. How could it help?
—SA
Sergey Alexandrovich Kryukov at 4-Jan-13 16:08pm
   
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 at 4-Jan-13 22:21pm
   
Thanks SA. All clear. :)
Sergey Alexandrovich Kryukov at 4-Jan-13 23:30pm
   
Yee... I mean, look at the answer by Mike Hankey... I upvoted...
—SA
mayuryewale at 5-Jan-13 6:59am
   
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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 at 4-Jan-13 23:28pm
   
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)



Advertise | Privacy | Mobile
Web02 | 2.8.150428.2 | Last Updated 5 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100