• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

SetColumnValueAtRow

I want to load value from a file into a DataGridTextBoxColumn

using :

SetColumnValueAtRow(ByVal source As CurrencyManager, ByVal rowNum As Integer, ByVal value As Object)

The problem is i do not understand the CurrencyManader. How do I get it ? For the moment I overrided the Edit event:

ByVal source As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal bounds As System.Drawing.Rectangle, ByVal readOnly As Boolean)

And I copy the correncymanager to a global var which is not a good thing. Anyone idea?
0
TheSonics
Asked:
TheSonics
  • 7
  • 6
1 Solution
 
Bob LearnedCommented:
1) Why are you doing this?

2) The CurrencyManager is an underlying entity that manages navigating a DataTable that the DataGrid is bound to

Bob
0
 
TheSonicsAuthor Commented:
1) I was doing that because i had to make something temp instead of searching was under the gun. But i know it's temp.

2) Aight, Tell me more i'm francophone or find some kind of schema, not that clear.


Thanks.
0
 
Bob LearnedCommented:
Tell me your requirement.  What problem are you trying to solve?

Bob
"The Bigger Picture Guy"
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
TheSonicsAuthor Commented:
Loading data from a file into a DataGridTextBoxColumn so the box value is refreshed with the value found into the data file.
0
 
Bob LearnedCommented:
1) What kind of file?

2) Would binding the DataGrid to a DataTable be a possibility?

3) It sounds like what you are attempting could be done more simply, but I am not sure.

Bob
0
 
TheSonicsAuthor Commented:
Well, it is a simple text file. I link the value of the .txt file to the datagrid and it's working fine. The DataGrid is already binded to a DataTable. But just to be sure, define binded i'm francophone
0
 
Bob LearnedCommented:
Databinding example:

    Me.DataGrid1.Datasource = table

Look here:
  Custom Object Data Binding with .NET
  http://www.15seconds.com/issue/040908.htm

If you set the DataGrid.Datasource to a datatable, then you won't need SetColumnValueAtRow, unless you are trying to do something special.

Loose translation:
Si vous placez le DataGrid.Datasource à un datatable, alors vous n'aurez pas besoin de SetColumnValueAtRow, à moins que vous essayiez de faire quelque chose de spécial. (translated)

Bob
0
 
TheSonicsAuthor Commented:
I already have a datasource linked to a datatable. My datatable has a textboxcolumn in which i want to set a value. I want the value to appear in the user interface.
0
 
TheSonicsAuthor Commented:
Cannot bind to every textbox of my column.

                  dgtbMeasDataColStyle.TextBox.DataBindings.Add("Text", ATPCollection(i), "Test")

I'd like to bind every textbox.
   
0
 
Bob LearnedCommented:
How does that relate to SetColumnValueAtRow?  You can do both.

Bob
0
 
TheSonicsAuthor Commented:
how can i bind every textbox of my column to an object ?
0
 
Bob LearnedCommented:
Can you show me more of how dgtbMeasDataColStyle is created, please?

Bob
0
 
TheSonicsAuthor Commented:
I've solved my problem, I don't have the answer in my mind. But really big thanks for trying to get the noob out of me.
I'll answer back tomorrow, i'd still like to get some explanation.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now