Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Silverlight
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 22-Sep-12 0:19am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

theDataGrid.Columns.Clear();

private void btnClear_Click(object sender, RoutedEventArgs e)
{
  this.sotcDataGrid.ItemsSource = null;
}
Hope it helps...
 
Thanks...
Comments
Mohd Wasif at 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)

  Print Answers RSS
0 OriginalGriff 435
1 Sergey Alexandrovich Kryukov 200
2 Yogesh Kumar Tyagi 180
3 Richard Deeming 180
4 RyanDev 115
0 Sergey Alexandrovich Kryukov 6,405
1 OriginalGriff 5,798
2 CPallini 2,473
3 Richard MacCutchan 1,647
4 Abhinav S 1,530


Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 22 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100