Click here to Skip to main content
11,433,997 members (57,122 online)
Rate this: bad
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.

Posted 22-Sep-12 1:19am

1 solution

Rate this: bad
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.


private void btnClear_Click(object sender, RoutedEventArgs e)
  this.sotcDataGrid.ItemsSource = null;
Hope it helps...

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)

Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 22 Sep 2012
Copyright © CodeProject, 1999-2015
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