Questions tagged [currencymanager]
17 questions
15
votes
5 answers
Add a Row After Setting DataSource to Datagridview
I had lots of questions related to datasource binding of datagrid. I had a DatagridView to which I am setting DataSource from a list
List li = new List();
MyClass O = new MyClass();
O.Name = "Aden";
O.LastName = "B";
O.Id =…

Amit Bisht
- 4,870
- 14
- 54
- 83
3
votes
2 answers
How to prevent CurrencyManager from calling BeginEdit()/EndEdit() methods for bound objects
I've got a form with several textboxes and one datagrid. One business entity can be bound to this form. For example, BO looks like this:
class BO : IEditableObject, INotifyPropertyChanged
{
public string FirstName {get; set;}
public string…

Dmitry
- 1,220
- 2
- 11
- 18
2
votes
1 answer
How to cycle continuously through DataGridView rows?
This might seem like a repeated question, but I am looking for a specific function. I have looked through similar questions on StackOverflow and Google and tried using many different code examples, but up to now, without success?
What I Am…

John Michael Wilkinson
- 135
- 1
- 10
2
votes
3 answers
C# Binding: How can I disable the CurrencyManager in BindingList so Current Item position is not maintained and not signaled?
I've got two ListBox'es that are databound to the same BindingList.
The issue is that when changing the selected item from the GUI it's changing the position in the BindingList and then the BindingList signals the other ListBox to change its…

Ran
- 534
- 6
- 12
2
votes
2 answers
Getting base field type when databinding to a Decimal (or Object) property
I've got a custom NumericEditor control that has a nullable Decimal property called Value. When I bind a data field to Value, I'd like to retrieve the underlying Type of the data that's bound, so that I can restrict the use of decimal places if the…

MCattle
- 2,897
- 2
- 38
- 54
1
vote
2 answers
Control binding with CurrencyManager without BindingSource
I decided not to use bindingSource class but implement binding functionality on my windows form application. I succeed to some points but little complication occurs. I would like to find out the reason.
I have DataTable filled from datasource and…

Fredrick Gauss
- 5,126
- 1
- 28
- 44
1
vote
1 answer
Binding DataGridView to DataSource - Throws CurrencyError IndexOutOfRangeException
I've been puzzling over this one for a few days now and it's got me pretty beaten, but to be honest I'm not all that experienced yet and I'm having trouble with DataGridView - which seems a common topic.
public partial class frmMain : Form
{
…

HeWhoWas
- 601
- 1
- 10
- 22
1
vote
1 answer
Update CurrencyManager Position
I have a ContextMenuStrip that is used on a DataGridView, the DataGridView is inside of a SplitContainer panel. My users have requested that they be able to right click on any of the rows in the grid and the row they right-click on will then become…

Taryn
- 242,637
- 56
- 362
- 405
1
vote
0 answers
EnforceConstraints throws NullReferenceException
I've faced with a strange behavior, when I try to change EnforceConstraints value "false" > "true" it throws a NullReferenceException.
dataSet1.EnforceConstraints = true;
The most strange thing is that exception is thrown when I try to save data…

Bikutotoro
- 47
- 2
- 9
1
vote
2 answers
Display new form based on GridView data
I have a GridView, radGvA133s, on my main form, MainForm. I would like to be able to double-click on a row of the GridView and have that open up a new form, A133Form, to allow editing of the selected row.
Here is the double-click code:
private…

Sesame
- 3,370
- 18
- 50
- 75
0
votes
1 answer
CurrencyManager PositionChanged-Event stops working after Form gets detached from its MDIParent
I encountered a weird issue that when I detach an MDIChild from its parent, the CurrencyManager PositionChanged event stops working. I got this behaviour in my main application and was able to reproduce it in a simple test app.
It's a WinForms App…

Wombat
- 19
- 4
0
votes
1 answer
Fetch thrown and swallowed Exception from CurrencyManager
The .NET Windows Forms CurrencyManager swallows exceptions that are thrown while navigating (see "Bug in CurrencyManager.OnPositionChanged - eats exceptions" on MSDN Social).
I, however, need to catch or fetch an exception that may be thrown in a…

Matthias Meid
- 12,455
- 7
- 45
- 79
0
votes
1 answer
Trying to hide a row in my DataGridView when a bool is changed to true
I've seen a few questions on this very topic posted on SO, but the proposed fix has no change in my code.
Here's what I have.
public void cell_formatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
{
…

MrDysprosium
- 489
- 9
- 20
0
votes
1 answer
“No row can be added to a DataGridView control that does not have columns. Columns must be added first.” when adding rows to DataTable
I'm getting the following message when trying to add rows to a DataTable: “No row can be added to a DataGridView control that does not have columns. Columns must be added first.” Interestingly enough, the DataTable that I'm trying to add the row to…

Serenus
- 56
- 1
- 7
0
votes
1 answer
Hiding DataGridView Row 0 produces error
In my DataGridView, it fails to hide a row, if that row is index 0.
row associated with the currency manager's position cannot be made
invisible
Dim cm1 As CurrencyManager = CType(BindingContext(dgv.DataSource),…

adam
- 2,930
- 7
- 54
- 89