Click here to Skip to main content
15,891,926 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a grid in a silverlight page and generating columns dynamically differently on two button.

In one button click event I am creating 2 rows and 5columns and displaying data in dynamic Textblock in each column and on another button click I am creating 2 rows and 30 columns and displaying data .

But it is giving data from both the button. means it is showing data created on 1 click button and of second button.

I want to clear all the record of previous data generated and new record should be shown on each click event.


Thanks
Posted

1 solution

Please go through the discussion in Clear all data from DataGrid[^] and article Silverlight DataGrid - The Basics[^] where they are talking techniques like below.

C#
theDataGrid.Columns.Clear();


C#
private void btnClear_Click(object sender, RoutedEventArgs e)
{
  this.sotcDataGrid.ItemsSource = null;
}

Hope it helps...

Thanks...
 
Share this answer
 
Comments
Mohd Wasif 23-Sep-12 0:54am    
Thanks But I am taking about grid control not a datagrid control.
Please help

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