?
Solved

Button click event

Posted on 2009-04-21
20
Medium Priority
?
838 Views
Last Modified: 2012-05-06

If I click on a button, anyway to call ANOTHER event handlder?
  I have button_onClick but when the button is clicked, i want to call this event:

    protected void cbxCode_ItemsRequested(object source, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        RadComboBox cbxCode = (RadComboBox)source;
        string searchCode = e.Text;
0
Comment
Question by:Camillia
  • 10
  • 6
  • 2
  • +2
20 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24197350
Do you mean that you want to call both handlers or one instead of the other?
0
 
LVL 16

Expert Comment

by:burakiewicz
ID: 24197457
you could call an event similar to that but probably not a button click since
 protected void cbxCode_ItemsRequested(object source, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
will be looking for Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs as e
and a button has
EventArgs e  you could do this but you wont have the args
cbxCode_ItemsRequested(null,null);
0
 
LVL 8

Expert Comment

by:JRockFL
ID: 24197486
you wont be able to do that, that event
you can do what burakiewicz suggested, but you will get an object ref error when you try to cast
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 18

Expert Comment

by:David Robitaille
ID: 24197499
in the  button_click event, you could call directly the cbxCode_ItemsRequested(sender,e) sub, but you will may probably have problems to cast the click event "e" parameter to the correct type. ( Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
it it dont work with e, try to create a New  Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs instence to pass to the event.
 
0
 
LVL 7

Author Comment

by:Camillia
ID: 24197505
>> Do you mean that you want to call both handlers or one instead of the other?

I want somehow, to have access to RadComboBoxItemsRequestedEventArgs's event arguments because when the button is clicked, i want to populate the RadCombox box and that's the only way I can think of.

They are 2 different events so I dont think i can do this.

*** i have a button, a textbox, a radcombox . I type in the combox box , it's event is called and i call the DB, etc. Now, I type in the textbox, click the button and want the radcomobox to be populated. Somehow I need to get to that combo box...
0
 
LVL 7

Author Comment

by:Camillia
ID: 24197520
I just saw the other comments. Let me read. Thanks.
0
 
LVL 16

Expert Comment

by:burakiewicz
ID: 24197529
i havent messed with the rad control, but on the button click cant you see what item is selected in the control and use it that way
0
 
LVL 7

Author Comment

by:Camillia
ID: 24197655
>>button click cant you see what item is selected in the control and use it that way

wont help. I know I'm clicking a button. I can get the text of the textbox. I just need to get to the combo box's code and pass that textbox value to it...
0
 
LVL 7

Author Comment

by:Camillia
ID: 24197794
I think burakiewicz: is correct. Will go that route.
0
 
LVL 7

Author Comment

by:Camillia
ID: 24198361
no, didnt work

davrob60: - what do u mean by this:
>> try to create a New  Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs instence to pass to the event.

Pass radcombo to what event?? so i have the button, a new event and the orig combo event. Pass what to what??
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24198449
dont mind, you dont need that. your other comment show me what you are trying to do: i l think  burakiewicz: is correct.
what do you mead by :" no, didnt work "
you could retrieve the rad control using findcontrol and then check it<s value. there many way to call findcontrol depending of the contex. ex: page.findcontrol or you could get the source, cast it as a control and then call findcontrol form it`s parent (useful for a gridview row)
please provide more info for more help.
 
0
 
LVL 7

Author Comment

by:Camillia
ID: 24198479
yes, i will post back how I tried to use "find control" and I kept getting null. Let me get my code and will post back. If i can use "find control", then i think i can do this.
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24198555
the other important thing is to know where the RadComboBox (the containers), where it is compare to the button and if them many of them on the page (repeating structure).
0
 
LVL 7

Author Comment

by:Camillia
ID: 24205933
ok, RadComboBox is in this containers:

Radgrid named :grdBasket
    <MasterTableView
      <dk:EditItemSheet ID="ctlBasketItemSheet"
            <asp:Panel ID="pnlSearch"
                 <table
                      <rad:RadComboBox ID="cbxCode"

** i tried:
RadComboBox cbxCode = (RadComboBox)grdBasket.NamingContainer.FindControl("cbxCode")

but came out as null.

***if we cant figure this out, it's ok.
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24206527
does the button is in the same EditItemSheet than the RadComboBox ?
0
 
LVL 7

Author Comment

by:Camillia
ID: 24206698
Button is actually in MasterTableView:

Radgrid named :grdBasket
    <MasterTableView
          <CommandItemTemplate>
              <asp:LinkButton ID="btnSearch"
           <CommandItemTemplate/>
           <dk:EditItemSheet ID="ctlBasketItemSheet"
            <asp:Panel ID="pnlSearch"
                 <table
                      <rad:RadComboBox ID="cbxCode"
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24206820
i dont know about the Radgrid, but I think you have to get the "item" from the grid. (i guell it s the selected one)
then you could use findcontrol to get your RadComboBox in the grdBasket
0
 
LVL 7

Author Comment

by:Camillia
ID: 24206884
I think you're right. But that "button" is not an "item" in the grid. I really dont think this is doable.
0
 
LVL 18

Accepted Solution

by:
David Robitaille earned 2000 total points
ID: 24206950
forget about that button. If it was beside the combo, we could use the buton.parent.findcontrol, but since it<s not the case, forget it.
"I really dont think this is doable. "
I don`t! there should be functions in the Radgrid to retrieve the items.
you should be able to retrieve the selected item index and then the item from that index.
But, has i said, i dont have the radgrid, so i cannot give you a full solution.
0
 
LVL 7

Author Comment

by:Camillia
ID: 24207482
thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question