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

This is probably simple... (finding the index of a control) 1

Status
Not open for further replies.

gbaughma

IS-IT--Management
Staff member
Nov 21, 2003
4,769
11
38
58
US
I'm building an ASP page that has the Telerik RadColorPicker in a template, so it can be repeated several times.

So, I'm able to fire an event when someone changes a color on one of the color pickers, and that's fine... the problem is, I don't know WHICH one sent it.

How can I get the index for the control that fired?

In other words, I need something like sender.parent.selectedindex() to tell me "Oh, yeah, they clicked on the third one down and changed the color."

TIA!



Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
cast the sender to the correct type
Code:
public void MyAction(object sender, EventArgs e)
{
  var ctrl = sender as RadColorPicker;
  if(ctrl == null) return;

  do work with color picker.
}

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
  • Thread starter
  • Moderator
  • #3
That put me on the right track... thanks. :)

Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top