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();