Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 642837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:13:01+00:00 2026-05-13T21:13:01+00:00

With the NetVantage Windows Forms 9.1 UltraGrid, I want to add some unbound columns

  • 0

With the NetVantage Windows Forms 9.1 UltraGrid, I want to add some unbound columns to do some simple calculations. The first time this code is entered in the InitializeLayout delegate, it finds that the columns don’t exist yet and then adds them. Suprisingly, when I get new data, rebind the grid, and then enter this delegate again, it still finds that these columns don’t exist and then tries to add them. An exception is then thrown, “Key already exists.”

UltraGridColumn changeColumn, pctChgCol;

if (e.Layout.Bands[0].Columns.Contains("Change"))
{
    changeColumn = e.Layout.Bands[0].Columns["Change"];
    pctChgCol = e.Layout.Bands[0].Columns["Percent Change"];
}
else
{
    changeColumn = e.Layout.Bands[0].Columns.Add("Change");
    pctChgCol = e.Layout.Bands[0].Columns.Add("Percent Change");
}
changeColumn.Formula = "[Publish Price] - [Override Price]";
pctChgCol.Formula = "if(0=[Publish Price] , 0 , ([Publish Price] - [Override Price])/[Publish Price] )";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:13:02+00:00Added an answer on May 13, 2026 at 9:13 pm

    This was an RTFM. I should have called a different method:

    Change

    if (e.Layout.Bands[0].Columns.Contains("Change")) 
    

    to

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

    The problem here is Contains checks for an object, not a key. I was checking to see if the columns collections contains a string object. Exists returns true of an object with that key is in the collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've played some on-line demos of silverlight component packs, like Telerik, NetAdvantage and ComponentOne
How do I get rid of this build error in my winforms app? Error
At the risk of having this question downvoted into oblivion or closed as Too
I'm sorry if this is a Uhh RTFM type of question, but I've checked
I am looking people's opinion and experience on using chart controls within an ASP.NET
We have a requirement to allow the user to customize (position/resize) their panes as
We have got .NET app written in VB .NET 4.0 / VS2010, compiled with
I downlaoded netadvantage ultimate 2012 vol2 and installed it . In earlier versions I
We are currently an Infragistics NetAdvantage Select customer and have been for a few
I'm looking into both of them, and while I have been quite pleased with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.