I'm experiencing a strange behavior and I've spent many hours trying to figure out what's going on to no avail. The situation is that I have several labels that are databound to database fields, and that after I run a fill command on the tableadapters that these labels are databound to (which the data inside changes), the labels do NOT reflect the changes made in the tableadapter UNTIL I click another textbox-like control on the screen (ex. A datagridview cell, any textbox) OR clicking any button. Note that these controls have no code at all that relates to these labels.
This program is written in C# and unfortunately I'm not sure if any code snippets will help.
This program was inherited by me and made by another programmer so unfortunately I'm not too familiar with how it works, but I've been tasked with fixing this bug and keep coming up short. I have checked all the code in all the events that could possible relate to it and nothing is working. Any help is much appreciated, thanks in advance!
Try calling Invalidate() on the parent control of the labels.
Related
I'm working on an application that contains a lot of datagridviews.
Randomly, after I've worked on a form in designer mode, when i build the project, one of the datagridviews becomes crazy.
The columns order change, the visible / invisible properties are lost, even the column names are sometimes reset to default.
The problem isn't specific to one datagridview, I've experienced this on many of them, randomly.
It's not specific to one form neither, I've seen this in several forms.
The autoGenerateColumns properties is set to false for all of the datagridviews.
I have renamed all the columns using unique names because i read that it could be a problem related to names allready used elsewhere> it's still happening.
It's like if the designer.cs sometimes becomes crazy and reset one of the datagridview.This is pretty annoying, each time i make a new build of the application, i can end with a broken datagridview even if i didn't touch it.
Is there a known issue with datagridviews that could explain this ?
I'm on .NET Framework 3.5
Can a newer Framework version solve this ?
I didn't post any code because it's not really related to any code...
Thanks in advance for any idea / information
PS : sorry for my english
Currently, I am using an Infragistics UltraGrid in Windows Forms application. I have columns generated in the grid dynamically. I have nearly 20 columns inside the grid and therefore also has a horizontal scroll bar in the grid. I have all my columns in disabled state (read-only) except the last one.
But now the problem is, whenever I open the application, the grid is loaded with the scroll bar on the extreme right side to show the active column. But I want the scroll bar to be on left side so always the first column of the grid is visible. I could not find any scroll bar position related properties in the grid. I also tried seeing some scrollbar related events but nothing worked. Do anyone have any idea what can be done. I have also posted this question in Infragistics forum and waiting for answer. Could you please help me to get around this problem?
I am also unable to understand what code sample is to be posted. I dont think of any helpful code extract for this problem.
I try to reproduce your issue using our latest available version - 13.2.20132.2010, but without success. The grid show the first column. Could you please tell me what is your current version. Are you able to upload small sample that reproduce this issue. I`ll be glad to research it for you.
Are you using Save/Load layout methods of your grid, because this is one possible reason for this behavior or maybe somewhere into your code you call Scroll methods.
Let me know if you have any questions.
I have a WinForm project that I used DevExpress buttons and labels to create. It turns out that not all devs have a license for DevExpress, so I need to change all references to it to the standard WinForm buttons and labels. The problem is that this is a complex form with over fifty elements on numerous (DevExpress) tabs.
It would be nice an easy to go in and change the DevExpress to the correct Windows buttons, labels and tabs except editing auto generated code just gives VS something to change back to what it wants. However, it sounded like changing Form.Designer.cs may be possible from one of the answers here.
My question is, can I make permanent changes to Form.Designer.cs, or will they be overwritten at some point by VS. If they will be overwritten, is there a simple way to swap out buttons and labels, if I want everything to stay the same except using the WinForm button rather than DevExpress button. Replacing them could work, but I have the tab controls to worry about.
Is my best bet to start a new WinForm, copy the code I wrote, and recreate the design?
Thanks for any suggestions.
I've got a table from an existing LabView VI (ewww!) that I need to replicate in C#. The table is shown in the image below. Each field will be populated with data returned by status queries to an external device, likely from within a dedicated status thread (when I implement it...). Is there any control, or direction I should take when extending an existing control for the table-like display of my query results? DataGridView seems like overkill for this, but the table layout container populated with TextBox controls seems inelegant. I'd like some insight, if anyone can offer it. Also, please feel free to shut me down if this has been asked already (though my search turned up nothing I could relate to...). Thanks.
DataGridView is the only suitable control here. Anything else either doesn't have enough grid editing capabilities (like ListView) or is fugly-slow like individual controls in a TLP.
I've been using VS 2005 and VS 2008, and never asked this question, but now I'm having a hard time using controls in VS 2003. A dataGridView does not exist, and I'm forced to use DataGrid control to show some data. The problem is, that I want to edit some of the values displayed by this control, and to reflect those changes in database, and I'm not finding a way to achieve this. Already "googled", no relevant results found, so please give me some little help. I'm coding in C#.
There's a reason that DataGrid was replaced with DataGridView... I expect you'll need to find a 3rd-party grid control for 1.1 to do this (but that gets harder the older 1.1 gets).
Sorry if this isn't very helpful...
you can use SqlDataAdapter to fill your DataSet and bind this DataSet to DataGrid and after your changes are made on the DataGrid just call SqlDataAdapter.Update method to update the database
I got a link from google, as a new user I am not able post it, when you google with 'DataGrid Windows msdn' words the first result have an example make sure that you change the version of the msnd to 1.1 framework.
Hope this helps.
You can use a listview to list the data from database. You can bind the itemsource of listview to a list which you get from DB. Also you can make the listview editable.
If the listview is not sufficient, you can use WindowsFormHost like
System.Windows.Forms.FlowLayoutPanel advancedFlowLayoutPanel =
this.flowLayoutHost.Child as System.Windows.Forms.FlowLayoutPanel;
advancedFlowLayoutPanel.WrapContents = true;
Inside it you can place DataGrid.