Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a datagridview and a dev express gridcontrol in my window application (VS2005) ,
in my datagridview i have all the tables from my Database (SQL) . So when i double click a table in the datagridview all the data in that particular table is shown the gridcontrol.
My problem is that the devexpress gridcontrol does not clear the previous querry , so instead of showing only the selected table , it shows all the previous selected tables. I tried using :
C#
gridControl1.DataSource = null;
              gridView1.Columns.Clear();


but it does not work.
Can somebody please help me...I'm very new to C# so i ve no idea how to solve my problem.

Thanks :-)
Posted

try this,
C#
gridControl1.DataSource = null;
gridControl1.DataBind();


I try this myself :)
 
Share this answer
 
SQL
while (gridView1.RowCount!=0)
            {
                gridView1.SelectAll();
                gridView1.DeleteSelectedRows();
            }
 
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