Click here to Skip to main content
15,914,350 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to add a MSProject to other MSProject Pin
Cracked-Down23-Mar-09 2:32
Cracked-Down23-Mar-09 2:32 
AnswerRe: How to add a MSProject to other MSProject Pin
fan15823-Mar-09 15:51
fan15823-Mar-09 15:51 
AnswerRe: How to add a MSProject to other MSProject Pin
moon_stick23-Mar-09 2:39
moon_stick23-Mar-09 2:39 
AnswerRe: How to add a MSProject to other MSProject Pin
fan15823-Mar-09 15:56
fan15823-Mar-09 15:56 
QuestionCrystal Report Page Setup Pin
Yathish hatter23-Mar-09 0:00
Yathish hatter23-Mar-09 0:00 
AnswerRe: Crystal Report Page Setup Pin
Henry Minute23-Mar-09 5:09
Henry Minute23-Mar-09 5:09 
Questioncrystal reports Pin
ShivarajKumar22-Mar-09 23:52
ShivarajKumar22-Mar-09 23:52 
QuestionDataGridView seems to lose databinding Pin
Nigel Mackay22-Mar-09 23:37
Nigel Mackay22-Mar-09 23:37 
Hi
I have a gridview, dgvDepartments linked to a dataset, dsDepartments.
bool InitialiseDepartments()
{
   rmDepartments = (IUserList)Activator.GetObject(typeof(IUserList),
		      System.Configuration.ConfigurationManager.AppSettings
		      ["UserListUrl"]);
   try
   {
      dsDepartments = null;
      dsDepartments = rmDepartments.GetDepartments();
      bsDepartments.DataSource = dsDepartments;
      bsDepartments.DataMember = "Departments";
      dgvDepartments.DataSource = bsDepartments;
      dgvDepartments.Refresh();
   }
   catch (Exception ex)
   {
      ShowError("Unable to load Departments. " +
                "Server possibly not running. \n\n" +
		"System Error: " + ex.Message);
      return false;
   }
   return true;
}

If I make changes to the gridview and click SaveChages, the changes are saved.
If I then make more changes, when I click SaveChanes, it reports No changes to save. This is from the code:
Validate();
BindingContext[dsDepartments, "Departments"].EndCurrentEdit();
DataSet changes = dsDepartments.GetChanges();
if(changes != null)

which resolves to false. To me, this means that the link between the gridview and the dataset has gone. Here is the code that executes when a change is saved (Without try blocks and error handling):
dsDepartments.AcceptChanges();
dsDepartments = null;
dsDepartments = rmDepartments.GetDepartments();//  Do this because of identity column which must be updated
dgvDepartments.Refresh();

I can't find any changes to gridview datasource and the like, but once I have saved a change, changes in the gridview are no longer reflected in the dataset.
I can't think what value I should monitor to see where the link gets broken.
AnswerRe: DataGridView seems to lose databinding Pin
Spunky Coder23-Mar-09 0:23
Spunky Coder23-Mar-09 0:23 
QuestionWeird behaviour Pin
Mustafa Ismail Mustafa22-Mar-09 23:23
Mustafa Ismail Mustafa22-Mar-09 23:23 
AnswerRe: Weird behaviour Pin
DaveyM6922-Mar-09 23:59
professionalDaveyM6922-Mar-09 23:59 
GeneralRe: Weird behaviour Pin
Mustafa Ismail Mustafa23-Mar-09 0:28
Mustafa Ismail Mustafa23-Mar-09 0:28 
GeneralRe: Weird behaviour Pin
DaveyM6923-Mar-09 0:53
professionalDaveyM6923-Mar-09 0:53 
GeneralRe: Weird behaviour Pin
Mustafa Ismail Mustafa23-Mar-09 4:32
Mustafa Ismail Mustafa23-Mar-09 4:32 
GeneralRe: Weird behaviour Pin
DaveyM6923-Mar-09 5:06
professionalDaveyM6923-Mar-09 5:06 
GeneralRe: Weird behaviour Pin
Mustafa Ismail Mustafa23-Mar-09 5:25
Mustafa Ismail Mustafa23-Mar-09 5:25 
AnswerRe: Weird behaviour Pin
#realJSOP23-Mar-09 2:42
professional#realJSOP23-Mar-09 2:42 
GeneralRe: Weird behaviour Pin
Mustafa Ismail Mustafa23-Mar-09 5:26
Mustafa Ismail Mustafa23-Mar-09 5:26 
GeneralRe: Weird behaviour Pin
#realJSOP23-Mar-09 9:03
professional#realJSOP23-Mar-09 9:03 
GeneralRe: Weird behaviour Pin
Mustafa Ismail Mustafa23-Mar-09 9:27
Mustafa Ismail Mustafa23-Mar-09 9:27 
QuestionHow to find multiple occurrence in a string. Pin
CodingLover22-Mar-09 23:22
CodingLover22-Mar-09 23:22 
AnswerRe: How to find multiple occurrence in a string. Pin
Spunky Coder22-Mar-09 23:34
Spunky Coder22-Mar-09 23:34 
AnswerRe: How to find multiple occurrence in a string. Pin
Luc Pattyn23-Mar-09 1:28
sitebuilderLuc Pattyn23-Mar-09 1:28 
AnswerRe: How to find multiple occurrence in a string. Pin
#realJSOP23-Mar-09 2:52
professional#realJSOP23-Mar-09 2:52 
AnswerRe: How to find multiple occurrence in a string. Pin
#realJSOP23-Mar-09 3:17
professional#realJSOP23-Mar-09 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.