Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
440
Check if a UltraGridColumn exists
posted

 

 

If I know just what the column is going to be called like "Model Number" is there a way that I can check if it exists?

Really, what I want to do is hide it if it exists.  However, hiding it when it does not exists causes an exception.  I want to avoid the exception.

e.Layout.Bands[0].Columns[

"Model Number"].Hidden = true;

 

Parents
  • 45049
    Verified Answer
    posted

    You're looking for the Exists() method off the columns collection:

    if (e.Layout.Bands[0].Columns.Exists("Model Number"))

    This method returns true if a column with the given key exists in the columns collection, and false if not.

Reply Children