How do I adress a ButtonColumn in ItemCreated?

L

Lars Netzel

Hey!

I have a ButtonColumn (PushButton) which I need to address in the DataGrid's
ItemCreated to be able to set the Text on the ButtonColumn (yes I need to
change this in runtime).

regards
/Lars Netzel
 
S

stefano mostarda

Hi Lars,

in the ItemCreated signature you have the e argument;
It contains a reference to the created row.
if you use this sintax
e.Item.Cells
you have the collection of all cells in the grid row;
then if you want to look for a particular object in the row you have to use:

e.Item.Cells[cellnumber].FindControl("ControlName")

and then set the property.

HTH,
Stefano Mostarda MCP
Rome Italy
 
L

Lars Netzel

I fixed it myself!

Dim myButton as e.Item.Cell(0).Control(0)
myButton.Text = "mytext"

/
Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top