Click here to Skip to main content
15,909,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to convert string into code? Pin
rachelicohen29-Apr-09 6:49
rachelicohen29-Apr-09 6:49 
GeneralRe: how to convert string into code? Pin
SimpleData29-Apr-09 6:56
SimpleData29-Apr-09 6:56 
GeneralRe: how to convert string into code? Pin
rachelicohen29-Apr-09 7:02
rachelicohen29-Apr-09 7:02 
GeneralRe: how to convert string into code? Pin
SimpleData29-Apr-09 7:16
SimpleData29-Apr-09 7:16 
JokeRe: how to convert string into code? Pin
Rolando CC29-Apr-09 7:22
professionalRolando CC29-Apr-09 7:22 
QuestionMessage Removed Pin
29-Apr-09 5:39
professionalN_tro_P29-Apr-09 5:39 
AnswerRe: How to force Settings.Settings to update Pin
Henry Minute29-Apr-09 8:33
Henry Minute29-Apr-09 8:33 
QuestionDatagridview refreshing problems Pin
surfswirl29-Apr-09 5:33
surfswirl29-Apr-09 5:33 
Hi, I encountered a problem with refreshing my Datagridview from a MySQL database.

Basically, my Datagridview is placed in a TabPage. This TabPage is toggled visually by a MenuStripItem. When the menu item is clicked, it will either open or close the TabPage. When it opens the TabPage, I have set an event handler to refresh the Datagridview with new data from the MySQL database.

These are the 2 event handlers for the MenuStripItem.

private delegate void Update_Delegate(DataTable input);
	
	private void db_list_update(DataTable input){
		//db_list.DataSource = null;
		db_list.EndEdit();
		db_list.Refresh();
		db_list.DataSource = input;
	}
	
	private void db_toggle(object sender, EventArgs e){
		if (db_shown){
			tab_control.TabPages.Remove(db_tab);
			num_tabs_shown--;
			check_tab_visibility();
			db_shown = false;
			//Hide_DB_List();
			db_list.Invoke(new Update_Delegate(this.db_list_update), new object[] {db_test.mysql_query(db_query)});
		}
		else if (!db_shown){
			tab_control.Visible = true;
			tab_control.TabPages.Insert(0,db_tab);
			tab_control.SelectedTab = db_tab;
			num_tabs_shown++;
			check_tab_visibility();		
			Show_DB_List();
			db_list.Invoke(new Update_Delegate(this.db_list_update), new object[] {db_test.mysql_query(db_query)});
			db_shown = true;
		}
		db_test = null;
		
	}	


The problem is that the data in the DataGridView refuses to be refreshed after the second click. That is, when I open the DataGridView, it loads from the database. Then I close it and it refreshes itself. When I open it again, it does not refresh thereafter.

Also, I have put in a HitTest to track the DataSource values of the DataGridView. The DataSource values are being updated but the DataGridView does not reflect the updated values from the DataSource despite my attempts to refresh it and reload the DataSource.

Any help will be much appreciated Smile | :)
QuestionWebClient.UploadFile won't upload the file. Pin
Member 441789229-Apr-09 4:06
Member 441789229-Apr-09 4:06 
AnswerRe: WebClient.UploadFile won't upload the file. Pin
Member 441789229-Apr-09 4:13
Member 441789229-Apr-09 4:13 
AnswerRe: WebClient.UploadFile won't upload the file. Pin
Member 441789229-Apr-09 4:19
Member 441789229-Apr-09 4:19 
AnswerRe: WebClient.UploadFile won't upload the file. Pin
jo H20-Jul-09 3:33
jo H20-Jul-09 3:33 
QuestionSample C# code to take the screenshots the application opened in windows mobile Pin
ujjawal kumar29-Apr-09 3:15
ujjawal kumar29-Apr-09 3:15 
AnswerRe: Sample C# code to take the screenshots the application opened in windows mobile Pin
Xmen Real 29-Apr-09 8:21
professional Xmen Real 29-Apr-09 8:21 
AnswerRe: Sample C# code to take the screenshots the application opened in windows mobile Pin
Henry Minute29-Apr-09 8:36
Henry Minute29-Apr-09 8:36 
QuestionMS Access Problem Pin
Star0929-Apr-09 1:39
Star0929-Apr-09 1:39 
AnswerRe: MS Access Problem Pin
musefan29-Apr-09 2:15
musefan29-Apr-09 2:15 
AnswerRe: MS Access Problem Pin
Luc Pattyn29-Apr-09 2:20
sitebuilderLuc Pattyn29-Apr-09 2:20 
QuestionRe: MS Access Problem Pin
Star0929-Apr-09 2:22
Star0929-Apr-09 2:22 
AnswerRe: MS Access Problem Pin
musefan29-Apr-09 2:29
musefan29-Apr-09 2:29 
GeneralRe: MS Access Problem Pin
Star0929-Apr-09 2:31
Star0929-Apr-09 2:31 
AnswerRe: MS Access Problem Pin
Star0929-Apr-09 2:38
Star0929-Apr-09 2:38 
Questionpaint is slow Pin
shefa' isied29-Apr-09 1:16
shefa' isied29-Apr-09 1:16 
AnswerRe: paint is slow Pin
Rolando CC29-Apr-09 3:37
professionalRolando CC29-Apr-09 3:37 
AnswerRe: paint is slow Pin
Xmen Real 29-Apr-09 8:19
professional Xmen Real 29-Apr-09 8:19 

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.