Click here to Skip to main content
12,948,567 members (61,911 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
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:55am
Updated 4-Jan-13 19:25pm
v2
Comments
Sandeep Mewara 4-Jan-13 9:58am
   
Rich Text Box table? Can you elaborate what are you trying to do?
   
This is quite possible, if I'm not much mistaken. I added even the images...
—SA
Sandeep Mewara 4-Jan-13 11:37am
   
?

I didn't get you SA. You wrote the comment to correct question?
   
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: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 4-Jan-13 12:15pm
   
http://www.codeproject.com/Questions/521745/transferingplustheplustextplusfromplusdynamicallyp
can you help me sir please if you can
   
I don't think so. How could it help?
—SA
   
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:21pm
   
Thanks SA. All clear. :)
   
Yee... I mean, look at the answer by Mike Hankey... I upvoted...
—SA
mayuryewale 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
   
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
Top Experts
Last 24hrsThis month
OriginalGriff 5,344
CHill60 3,275
Maciej Los 2,703
Jochen Arndt 1,935
ppolymorphe 1,795


Advertise | Privacy | Mobile
Web02 | 2.8.170524.1 | Last Updated 5 Jan 2013
Copyright © CodeProject, 1999-2017
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