This is a migrated thread and some comments may be shown as answers.

Set and get Button ID in RADGrid VB.Net

2 Answers 156 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 27 Apr 2011, 12:00 AM

Hello


I need to set the ID of a repeated button in a RADGrid and then get that ID in the VB code on the server side when it is clicked.


Hers what I’m looking to do...

1) Using a  RADGrid I want a Button in one of the columns (Got it/Can do)

2) When that button is clicked it calls a set of code (function/sub) server side VB

  - I want to give each button a defend ID using the record ID in dataset the data set that’s building out the table for the grid.

  - The code that is called will be the same no matter what button in the list is clicked

  - The code it calls can know/get what button ID was clicked so that it may use the ID to drill in to the DB.
(I know how to do the DB work, just need the Button ID that was clicked, sever side VB)


-Problems/help??

   - I can’t see how to set the ID via the RADGrid designer

      -- I do see how to for "tool tip" and the like but not the button ID (not the button text)

   - Where do I set it to call a sub or function that I have in the VB code page?
   - What code would go in go in the Sub:

Sub GridButtonEdit()

   BtnClkd = Get.GridButtonEdit.ID
End Sub
--- Something like that???? ---


If it’s not possible to set the Button ID (as I see it’s some random long string now) then is there something I could set that I could then get in the code that it calls?


Thanks for the help!

Shane

2 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 29 Apr 2011, 12:18 PM
Hi Shane,

You have taken the wrong direction. There is a much easier way to achieve your requirement and I have demonstrated that in the attached sample.

Hope it helps. 

Regards,
Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Shane
Top achievements
Rank 1
answered on 10 May 2011, 11:02 PM
Hi Tsvetoslav,

Yes thats what I needed to do, thanks so much for the help!

Shane
Tags
General Discussions
Asked by
Shane
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Shane
Top achievements
Rank 1
Share this question
or