473,503 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Settings values in DataGrid

I need to know how I set an (C# code behind) variable with an selected item
into datagrid in a itemtemplate column. I can delete, redirect, select, but I
can assing values to any variable...

I apreciatte any help to do this
Ronald Morales
Nov 16 '05 #1
1 1074
Hi Ronald:

One way to do this is catch the ItemDataBound event. In this event the
sender parameter is a DataGridItem, and DataGridItem contains all of
the controls you defined in the ItemTemplate. You can call FindControl
on the item and pass the name of your control, which should give you a
reference to the control so you can modify it programmatically. Of
course you'll need to do some type casting along the way.

Maybe my article here could help:
http://odetocode.com/Articles/116.aspx

This gives several examples of extracting values, it's easy to figure
out how to change that to setting values!

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 26 Oct 2004 11:01:03 -0700, "Ronald Morales"
<Ro***********@discussions.microsoft.com> wrote:
I need to know how I set an (C# code behind) variable with an selected item
into datagrid in a itemtemplate column. I can delete, redirect, select, but I
can assing values to any variable...

I apreciatte any help to do this
Ronald Morales


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1974
by: Gamze | last post by:
Hi, How can i get values from datagrid to combobox and should select the same name as in datagrid row on the combobox control In my vb.net windows application ,i have combobox which is...
2
1998
by: Balamurukan | last post by:
How to retrive property values from our own property window
0
272
by: Gamze | last post by:
Hi, How can i get values from datagrid to combobox and should select the same name as in datagrid row on the combobox control In my vb.net windows application ,i have combobox which is...
0
349
by: Gamze | last post by:
Hi, How can i get values from datagrid to combobox and should select the same name as in datagrid row on the combobox control In my vb.net windows application ,i have combobox which is...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7348
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.