RTRIM returns a sting after truncate trailing blanks.
Example:
DECLARE @str varchar(60);
SET @str = 'six spaces after ';SELECT @str + '/';
SELECT RTRIM(@str) + '/';
results:
six spaces after /
six spaces after/
DataTable dt = new DataTable();
dt.Columns.Add("ID", typeof(int));
dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] };
dt.Columns["ID"].AutoIncrement = true;
dt.Columns["ID"].AutoIncrementSeed = 1;
dt.Columns["ID"].ReadOnly = true;
dt.Columns.Add("Name", typeof(string));
dynamic dr = dt.NewRow();
dr("Name") = "John";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr("Name") = "Dan";
dt.Rows.Add(dr);
DataGridView1.DataSource = dt;