We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Checking if a key already exists

How can i check if this cell type already exist before executing this statement?

gridControl1.CellModels.Add("TreeCell", new TreeCellModel(gridControl1.Model));

1 Reply

AD Administrator Syncfusion Team February 28, 2007 08:08 PM UTC

Hi Adnan,

You can use the ContainKey() method to determine the specfic CellType in GridCellModelCollection.

if( ! gridControl1.CellModels.ContainsKey("TreeCell"))
gridControl1.CellModels.Add("TreeCell", new TreeCellModel(gridControl1.Model));

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon