Solved

SetColumnValueAtRow

Posted on 2006-06-22
13
235 Views
Last Modified: 2008-03-04
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
Comment
Question by:TheSonics
  • 7
  • 6
13 Comments
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
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
 

Author Comment

by:TheSonics
Comment Utility
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
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
Tell me your requirement.  What problem are you trying to solve?

Bob
"The Bigger Picture Guy"
0
 

Author Comment

by:TheSonics
Comment Utility
Loading data from a file into a DataGridTextBoxColumn so the box value is refreshed with the value found into the data file.
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
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
 

Author Comment

by:TheSonics
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
Comment Utility
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
 

Author Comment

by:TheSonics
Comment Utility
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
 

Author Comment

by:TheSonics
Comment Utility
Cannot bind to every textbox of my column.

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

I'd like to bind every textbox.
   
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
How does that relate to SetColumnValueAtRow?  You can do both.

Bob
0
 

Author Comment

by:TheSonics
Comment Utility
how can i bind every textbox of my column to an object ?
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
Can you show me more of how dgtbMeasDataColStyle is created, please?

Bob
0
 

Author Comment

by:TheSonics
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now