Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid Button Column - Change the value 1

Status
Not open for further replies.

netangel

Programmer
Feb 7, 2002
124
PT
This is another DataGrid question: How can I get and set the value of a Button Column (Select)?

I usually use '>' or '->' as the select row string, but now I must change it by code (depending on user preferences).

Is this possible? Can I set it in run time?
NetAngel
 
When you say "Change the Value", do you mean that you wish to change the text of the button?

If so (and even if not), then use the onItemDataBound event.

And assuming the button was the only control in the first cell of the datagrid, and the button is a pushButton, then the guts of this routine might look something similar to this:

if e.item.itemType = listItemType.item or e.item.itemType = listItemType.alternatingItem then
ctype(e.item.cells(0).controls(0),button).text = "myNewText"
end if

But you could change any other attribute of that button in the same fashion.
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top