Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys,

i have a datagridview with a databinding. Now i have a Funktion to send mails.
when the mailform opens, im copying each cell.value into a list of strings.
to Format the strings right into my richtextbox (mailform), i insert "Tabs" \t.
Now the mail Looks good in my form, but if i send the mail, the Formation
of the text is truely ugly. Now im asking if there is another, better way
to Format my text?

Here is the code for inserting the cell values into my list:
C#
for (int rowcounter = 0; rowcounter < nV_AUFPDataGridView.Rows.Count - 1; rowcounter++)
{
CellsInRow = nV_AUFPDataGridView.Rows[rowcounter].Cells.Count - 1;

for (int cellcounter = 0; cellcounter < nV_AUFPDataGridView.Rows[rowcounter].Cells.Count; cellcounter++)
{
	string Text = "";
		if (nV_AUFPDataGridView[cellcounter, rowcounter].Value == null)
		{
		Text = "0%\t";
		_MailSetUp.AufpData.Add(Text);
		continue;
		}

		if (cellcounter != 2)
		{
		Text = nV_AUFPDataGridView[cellcounter, rowcounter]
                        .Value.ToString() + "\t";
		}
		else
	        {
		Text = nV_AUFPDataGridView[cellcounter,rowcounter]
                        .FormattedValue.ToString();
	        }


		if (cellcounter == 0)
		{
		continue;
		}
		if (cellcounter == 2 || cellcounter == 5 || cellcounter == 7)
		{
		    if (cellcounter == 5 || cellcounter == 7)
		    {
		      Text = Text + "€";
		    }

		  Text = Text + "\t";
		}

		if (cellcounter == CellsInRow)
		{
		  Text = Text + "\r\n";
		}

		_MailSetUp.AufpData.Add(Text);
		}
								}


Thank you

Greets Niko
Posted
Updated 24-Jan-13 22:06pm
v2

1 solution

Hi..

Can you post some code as to what you have done?
I would suggest to have a CSS class in your form which should apply to the values, such as padding, border, color and stuffs...

-Regards
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900