dataGrid1.TableStyles.Remove(tblStyle); ?

  • Thread starter Thread starter Ralf
  • Start date Start date
R

Ralf

Hi NG,

if there a way to Clear a DataGrid

dataGrid1.TableStyles.Clear(); or
dataGrid1.TableStyles.Remove(tblStyle); or
dataGrid1.TableStyles.RemoveAt(intDG); or
not work!?

dataGrid1.TableStyles[0].GridColumnStyles.RemoveAt(0);

this work fine but i need to remove the rows an after
remove fill with new data

Thanxs for Help
Ralf
 
Do you want to remove all the rows that you see in the datagrid?

If the DataSource of the DataGrid is a DataTable ---> DataTable.Clear();


im Newsbeitrag
news:[email protected]...
 
Hi Ralf
If what you want to do is to clear the rows from the datagrid then you
have to options to do that.
Either you remove these row from your data source, the data source that is
bind to the grid , for example if it was a table you can clear it
DataTable.Clear();
One other option you have unbound the grid from the source so make its data
source = null means it is not bind to a source any more .
Choosing any of those choices depend on your logic , if you just want to
remove the display of the rows ( and keep the source as is) then just
remove the binding . however if you do want to delete that data , then
remove it from your source

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top