Jeffrey,
Thank you showing this. Feel free to tell me this direct, it shows me that I
have to take more time in the datagridview. It is not I did that already,
but I see that it is not enough, I base my answers still to much about the
datagrid.
Do you mind, if I set your (a little bit changed and in VB) sample on our
website. Please tell than if that is OK that I than tell that you made it
(not referencing microsoft) just as newsgroup contributer or without that.
I would like it with your name otherwise it looks if we did make that.
Your sample gave me however the errors below when I did try it in VBNet (I
would use next time the loaddatarow, that is much easier to create a
datatable).
Cor
Error 1 End of statement expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 1 14
WindowsApplication1
Error 2 Syntax error. C:\Documents and Settings\cor\Mijn documenten\Visual
Studio 2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb
2 1 WindowsApplication1
Error 3 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 3 5
WindowsApplication1
Error 4 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 4 5
WindowsApplication1
Error 5 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 5 5
WindowsApplication1
Error 6 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 6 5
WindowsApplication1
Error 7 Statement cannot appear outside of a method body. C:\Documents and
Settings\cor\Mijn documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 8 5
WindowsApplication1
Error 8 Syntax error. C:\Documents and Settings\cor\Mijn documenten\Visual
Studio 2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb
9 5 WindowsApplication1
Error 9 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 10 9
WindowsApplication1
Error 10 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 11 9
WindowsApplication1
Error 11 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 12 9
WindowsApplication1
Error 12 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 13 9
WindowsApplication1
Error 13 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 14 9
WindowsApplication1
Error 14 Syntax error. C:\Documents and Settings\cor\Mijn documenten\Visual
Studio 2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb
15 5 WindowsApplication1
Error 15 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 16 5
WindowsApplication1
Error 16 Syntax error. C:\Documents and Settings\cor\Mijn documenten\Visual
Studio 2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb
18 1 WindowsApplication1
Error 17 End of statement expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 20 14
WindowsApplication1
Error 18 Syntax error. C:\Documents and Settings\cor\Mijn documenten\Visual
Studio 2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb
21 1 WindowsApplication1
Error 19 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 22 5
WindowsApplication1
Error 20 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 23 1
WindowsApplication1
Error 21 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 24 5
WindowsApplication1
Error 22 Declaration expected. C:\Documents and Settings\cor\Mijn
documenten\Visual Studio
2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb 25 1
WindowsApplication1
Error 23 Syntax error. C:\Documents and Settings\cor\Mijn documenten\Visual
Studio 2005\Projects\Tests\WindowsApplication1\WindowsApplication1\Form1.vb
26 1 WindowsApplication1
"Jeffrey Tan[MSFT]" said:
Hi Steve,
Thanks for your post!
I have tried to use the code snippet below to set all the cells' left and
right border to none:
private void Form1_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("column1", typeof(int));
dt.Columns.Add("column2", typeof(string));
dt.Columns.Add("column3", typeof(string));
for (int i = 0; i < 20; i++)
{
DataRow dr = dt.NewRow();
dr["column1"] = i;
dr["column2"] = "item"+i.ToString ();
dr["column3"] = "column3";
dt.Rows.Add(dr);
}
this.dataGridView1.DataSource = dt;
}
private void button1_Click(object sender, EventArgs e)
{
this.dataGridView1.AdvancedCellBorderStyle.Left =
DataGridViewAdvancedCellBorderStyle.None;
this.dataGridView1.AdvancedCellBorderStyle.Right =
DataGridViewAdvancedCellBorderStyle.None;
}
This works well on my side. It has the effect of merging all the cells in
a
row into a single cell. Does it meet your need?
Hope it helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.