Click here to Skip to main content
13,140,613 members (51,784 online)
Rate this:
Please Sign up or sign in to vote.
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.

Posted 22-Sep-12 0: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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 22 Sep 2012
Copyright © CodeProject, 1999-2017
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