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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid change selectedindex with javascript onclick

Status
Not open for further replies.

intrex

IS-IT--Management
Apr 14, 2002
70
US
Hello,

Has anyone been able to use a javascript onclick event to change the selectedindex property of a datagrid?
 
The onclick event of what? A checkbox, button, datgrid cell?

And for what purpose? To set the selected index to the row that a user selects?

You'll have to give a bit more info if you want a better reponse...

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
sorry,

I am trying to have the row onclick event change the selectedindex. I think I have an ugly solution that might work. I am going to bind the onclick event to each row in the item_databind. The event is going to redirect back to the same page with a querystring of which row sent the response. I am a newb with javascript so I am not quite sure if this will work as expected. There is probably a cleaner way to do it also. Any suggestions would be greatly apreciated.
 
ok,

That didn't work as I expected. I am now trying to make a select command column that I can make invisible (but have it show up in the html). Then I am going to try to make javascript fire the select button for the desired row that was clicked.
 
I have this all worked out except for one problem. I can't seem to get the html id of the select control that is created from a select command button in a datagrid. I thought that there would be some way to get the html id in the datagrid_itemcreated event but I haven't found a way to do it yet. Is there no way to get the html id that is going to be rendered from the server side code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top