Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 27th, 2007, 10:44 AM
Authorized User
 
Join Date: Apr 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid won't refresh

I think the problem is in the index of the new rows but I could be

does anyone see where the problem is here?

                    //renumber the existing priorityID's in the lookup table
                    int firstIndex = RenumberPriorityID(frmAddLookupRow.StartingPriorit yID, true, frmAddLookupRow.NumberRows) + 2;

int nextPriorityID = frmAddLookupRow.StartingPriorityID;

// add the number or rows required to the lookup table
                    for (int counter = 0; counter < frmAddLookupRow.NumberRows; counter++)
     {
        TKData.TKSIMSLookupRow newLookupRow = tKData.TKSIMSLookup.NewTKSIMSLookupRow();
        newLookupRow.SiteID = txt_VesselDetail_SiteID.Text;
        newLookupRow.IMONumber = txt_VesselDetail_IMONumber.Text;
        newLookupRow.VesselName = cboVessel.Text;
        newLookupRow.ProjectName = cboProjectName.Text;
        newLookupRow.SisterGroup = cboSisterGroup.Text;
        newLookupRow.PriorityID = nextPriorityID;
        newLookupRow.IsModified = false;
        newLookupRow.ModDescription = "NA";

// tKData.Tables["TKSIMSLookup"].Rows.InsertAt(newLookupRow, firstIndex + counter);
tKData.Tables["TKSIMSLookup"].Rows.Add();

       nextPriorityID = nextPriorityID + 1;

 }
}
dgLookup.AutoGenerateColumns = false;
dgLookup.DataSource = tblLookup;
dgLookup.EndEdit();
dgLookup.Refresh();
}








Similar Threads
Thread Thread Starter Forum Replies Last Post
How to refresh the datagrid? Byock ASP.NET 1.0 and 1.1 Basics 2 December 11th, 2006 05:51 AM
windows forms datagrid - refresh ab_dev General .NET 0 March 1st, 2006 06:37 PM
Refresh DataGrid without PostBack Baby_programmer Classic ASP XML 1 April 2nd, 2005 04:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.