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

  • Home
  • SEARCH
  • 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 8387081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:07:05+00:00 2026-06-09T18:07:05+00:00

I am converting a bunch of code from vb.net to c# and I don’t

  • 0

I am converting a bunch of code from vb.net to c# and I don’t know vb.net very well so I am running into a lot of issues.

Can someone help me see what is wrong here?

protected void GenerateSalaryPunchesTable()
        {
            this.dgvPunchs.Rows.Clear();

            string[] DateRange = this.cboPayPeriods.SelectedItem.Text.ToString().Replace(" ", "").Split('-');

            while (Convert.ToDateTime(DateRange[0]) <= Convert.ToDateTime(DateRange[1]))
            {
                if (Convert.ToDateTime(DateRange[0]).DayOfWeek != DayOfWeek.Saturday & Convert.ToDateTime(DateRange[0]).DayOfWeek != DayOfWeek.Sunday)
                {
                    Infragistics.WebUI.UltraWebGrid.UltraGridRow nRow = new Infragistics.WebUI.UltraWebGrid.UltraGridRow();

                    nRow.Cells.Add();
                    // Date Cell
                    nRow.Cells.Add();
                    // Worked CB
                    nRow.Cells.Add();
                    // Vacation CB
                    nRow.Cells.Add();
                    // Sick CB
                    nRow.Cells.Add();
                    // Holiday CB
                    nRow.Cells.Add();
                    // Error

                    nRow.Key = Convert.ToDateTime(DateRange[0].ToString()).ToShortDateString();
                    nRow.Cells[0].Value = Convert.ToDateTime(DateRange[0].ToString()).ToShortDateString();
                    nRow.Cells[1].Value = 0;
                    nRow.Cells[2].Value = 0;
                    nRow.Cells[3].Value = 0;
                    nRow.Cells[4].Value = 0;
                    nRow.Cells[5].Value = "";

                    this.dgvPunchs.Rows.Add(nRow);
                }

                DateRange[0] = Convert.ToDateTime(DateRange[0]).AddDays(1);
            }

        }

Here is the error it is giving me:

Error 4 The best overloaded method match for ‘Infragistics.Web.UI.GridControls.ControlDataRecordCollection.Add(Infragistics.Web.UI.GridControls.ControlDataRecord)’ has some invalid arguments
Error 5 Argument 1: cannot convert from ‘Infragistics.WebUI.UltraWebGrid.UltraGridRow’ to ‘Infragistics.Web.UI.GridControls.ControlDataRecord’

And here is the control:

<ig:WebDataGrid ID="dgvPunchs" runat="server" Height="350px" Width="400px">
                        </ig:WebDataGrid>

It was converted from VB.net and an older version of Infragistics. I cannot figure this out so far.

EDIT:

I tried this and it didn’t work either…

Infragistics.Web.UI.GridControls.ControlDataRecord nRow =
  Infragistics.Web.UI.GridControls.ControlDataRecord();
//Infragistics.WebUI.UltraWebGrid.UltraGridRow nRow = new Infragistics.WebUI.UltraWebGrid.UltraGridRow();
  • 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-06-09T18:07:07+00:00Added an answer on June 9, 2026 at 6:07 pm

    The exception is happening because your adding an UltraGridRow to a WebDataGrid or a WebHierarchicalDataGrid’s rows collection and the UltraGridRow was used with the UltraWebGrid.

    Since you have changed the grid that is being used there will not be a 1:1 mapping for the code so this will add complexity to the conversion. You will be better off looking at what you want to accomplish and then writing the code needed for the newer grid control.

    Typically for data rows the WebDataGrid uses GridRecord objects and you could test creating one of these to add a new row to the grid.

    Note that from the method that you are calling it appears that you are dynamically creating all of the data for the grid and if that it the case then you would be better off creating a DataTable and binding the grid to the DataTable rather than using the grid directly since the grid is designed to be bound to data.

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

Sidebar

Related Questions

I'm converting a bunch of tables into divs, the layout itself is very simple
I am converting a bunch of code from C++ in to C. Is there
I've been converting a bunch of old C++ code into C++/CLI code, and I
Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is
I'm given a task of converting a bunch of code written in Python 2
I've been converting a bunch of files from Coldfusion to C#, and all has
Converting json to oher type should be easy. From the Play! documentation : var
For converting a integer into an enum (out of a json file), I declared
I am converting absolute file-system path to relative path using following code. public static
Currently working with converting SQLException error messages into messages that are more useful for

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.