5 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 27 Jan 2012, 05:00 AM
Hello Scott,
You can reference the controls in ItemDataBound event. ItemDataBound is fired only when grid binds to data. Here is the sample code.
C#:
-Shinu.
You can reference the controls in ItemDataBound event. ItemDataBound is fired only when grid binds to data. Here is the sample code.
C#:
protected
void
grid_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridCommandItem)
{
GridCommandItem item = (GridCommandItem)e.Item;
CheckBox chk = (CheckBox)item.FindControl(
"CheckBox1"
);
}
}
-Shinu.
0

Miky
Top achievements
Rank 1
answered on 25 Oct 2012, 12:08 PM
I have this exact same problem, but in my case it's a RadComboBox. It's important that I get the value in the NeedDataSource event because this decide which databinding i'm doing as of the "Select"...
The RadComboBox works perfectly, and teh data is filled and kept between each postback, but i dunno how to go get my value.
Regards,
The RadComboBox works perfectly, and teh data is filled and kept between each postback, but i dunno how to go get my value.
Regards,
0
Hi Michel,
NeedDataSource event fires too early in the control's lifecycle in order to get the command item. Therefore, you will need to use a Session or ViewState variable to save the selected item's value. Another approach would be to try the following:
http://www.telerik.com/help/aspnet-ajax/grid-changing-structure-dynamically.html
I hope this will prove helpful.
Greetings,
Eyup
the Telerik team
NeedDataSource event fires too early in the control's lifecycle in order to get the command item. Therefore, you will need to use a Session or ViewState variable to save the selected item's value. Another approach would be to try the following:
http://www.telerik.com/help/aspnet-ajax/grid-changing-structure-dynamically.html
I hope this will prove helpful.
Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0

Miky
Top achievements
Rank 1
answered on 31 Oct 2012, 11:31 AM
Hi
Thnx for the answer.
Since I can't use the session in this case (too long to explain) do you have an example of how I would do it with the viewstate ?
Kind regards,
Michel
Thnx for the answer.
Since I can't use the session in this case (too long to explain) do you have an example of how I would do it with the viewstate ?
Kind regards,
Michel
0
Hello Michel,
I have created a sample RadGrid web site where I implemented the described functionality. Could you please check out the attached application and let me know about the result?
Kind regards,
Eyup
the Telerik team
I have created a sample RadGrid web site where I implemented the described functionality. Could you please check out the attached application and let me know about the result?
Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.