tim
Posted
on Mar 30, 2010
(permalink)
I've been playing with this for a week or so now with no luck.
I have a grid....
And need to populate the DropDownList (HeaderDropDown) from a seperate datasource than what populates the Grid in general.
Currently, in the code behind, I have...
I have a breakpoint set at the if statement and I'm never stepping into it.
Thanks.
Reply
Posted
on Mar 30, 2010
(permalink)
I believe this help article should be of use to you.
Also, if the RadGrid syntax you posted is what your actually using then I noticed that you didn't attach the handler to the grid control. If you do have it attached then I don't understand why it doesn't work since your code matches the help article, although it does add a check to ensure the item being bound is a GridEditableItem.
I hope that helps.
Reply
tim
Posted
on Mar 30, 2010
(permalink)
This is the actual code. Can you elaborate on, "attach the handler to the grid control"?
Reply
Posted
on Mar 30, 2010
(permalink)
You need to attach the handler to the RadGrid control in order for the event to be raised.
Below is the modified version of the RadGrid declaration with the event handler attached:
You'll notice that I've added OnItemDataBound="Grid1_ItemDataBound" to the RadGrid declaration. That's how you attach events.
Reply
tim
Posted
on Mar 31, 2010
(permalink)
does this do the same thing?
Reply
tim
Posted
on Mar 31, 2010
(permalink)
I changed the routine to the following...
and am FINALLY stepping into the if statement. However, I cannot find "HeaderDropDown". Any suggestions, PLEASE?
Reply
Posted
on Mar 31, 2010
(permalink)
The reason your not finding the control is because your looking for a
GridDataItem, instead of a
GridEditableItem. So if you change
GridDataItem to
GridEditableItem in your code, you should be able to find the control.
I hope that helps.
Reply
tim
Posted
on Mar 31, 2010
(permalink)
Nope, now I have...
and STILL not finding the drop down.
Thanks.
Reply
Pavlina
Pavlina
Posted
on Apr 1, 2010
(permalink)
Hello Tim,
Please take a look at the following resources demonstrating how the desired by you functionality can be achieved:
Column Types
Customize/Configure GridDropDownColumn
Different edit forms on edit and insert
I hope this gets you started properly.
All the best,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the
Telerik Public Issue Tracking system and vote to affect the priority of the items.
Reply
tim
Posted
on Apr 1, 2010
(permalink)
I have gone through all of this already. And as noted by someone else above, my code matches the examples in these docs. Are you able to get this to work?
Reply
Posted
on Apr 1, 2010
(permalink)
Well the only difference between your code and the one shown in the help is that it checks if the item is in edit mode.
Maybe that will make a difference.
Reply
tim
Posted
on Apr 1, 2010
(permalink)
I started out with that. When I add "
&& e.Item.IsInEditMode" I never step into the if statement. So, it's not in edit mode but the dropdown is in a <EditItemTemplate> block. I just don't get it.
I've tried working numerous AJAX samples and have never had luck getting any of them to work, as written.
Reply
Posted
on Apr 1, 2010
(permalink)
I think you should place the DropDownList inside of
ItemTemplate, instead of
EditItemTemplate, since it looks like your not using the edit functionality of the RadGrid (you don't have a button that initiates the edit mode of the grid). Then change your code back to using
GridDataItem, instead of
GridEditableItem.
I hope that helps.
Reply
tim
Posted
on Apr 1, 2010
(permalink)
This did it, thanks!!
Reply