How to clear the grid data

Hi Everybody,

 

 

 

i am a new bee to metastorm.

 

Can anybody tell me that how should i clear the data from a grid bound to a BO with a dataset.

 

I have a button named "Add Rows" on it's click i add some rows into my Grid.

 

for which i have written the code as follows which is working fine:

 

  

DataSet ds = this.Current.bo_CS_SubSkills_ToBeAssigned1.Read();

DataRow dr = ds.Tables[0].NewRow();

dr["Level1Subskills"]= this.Current.Local.varLevel1SubSkill.ToString();

dr["Level2Subskills"]= this.Current.Local.varLevel2SubSkill.ToString();

dr["Level3Subskills"]= this.Current.Local.varLevel3SubSkill.ToString();

dr["Level4Subskills"]= this.Current.Local.varLevel4SubSkill.ToString();

ds.Tables[0].Rows.Add(dr);

this.Current.bo_CS_SubSkills_ToBeAssigned1.Write(ds);

 

 

But, My problem is : I have one more button named "Clear Rows" on it's click i need to clear all the data bound to it (as per to the previous code).

 

 

 

 

If anybody has any idea please suggest.

 

Please also suggest if i have to make some special settings(or any properties to be set) to my BO or my Grid.

 

 

 

 

Thanks in advance.

Tagged:

Comments

  • I would populate the underlying datasource directly (InertDatabaseRows, UpdateDatabaseRows) from your command buttons. Ensure that your BO on the form is set to always refresh and the grid should take care of itself. If you wish to delete rows use the DeleteDatabaseRows function.

     

    Hope this helps.