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

FormTemplate

8 Answers 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 07 Jan 2008, 01:02 PM
I added a radCombobox to a Fromtemplate, but the control is not listed in the combobox in the code-behing window where normal all controls are listed. So I can't use the ItemRequests event to fill the combbox list. What's wrong?

8 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 08 Jan 2008, 11:56 AM
Hello Markus,

Indeed, in such a situation the control will not be visible, since it is nested in another control. You will need to dynamically get a reference to it and assign the event handler as needed.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 1
answered on 08 Jan 2008, 12:08 PM
Thanks for Information, but how can I do that? Is there an example available?
0
Yavor
Telerik team
answered on 08 Jan 2008, 12:55 PM
Hi Markus,

Basically, if the combo is nested in a template of the grid, you can directly add the event handler. This is demonstrated in the code sample below:

.aspx
<EditItemTemplate>                        
<rad:RadComboBox AutoPostBack="true" 
 ID="RadComboBox1" runat="server" 
 DataSourceID="AccessDataSource1" DataTextField="ProductName" 
 DataValueField="ProductName" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">  
</rad:RadComboBox> 
</EditItemTemplate>       

Dynamically assigning the handler may be something like this:

.cs
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridDataItem && e.Item.IsInEditMode)  
        {  
            GridDataItem dataItem = (GridDataItem)e.Item;  
            RadComboBox combo = (RadComboBox)(dataItem["ProductName"].FindControl("RadComboBox1"));  
            combo.ItemsRequested += new RadComboBoxItemsRequestedEventHandler(RadComboBox1_ItemsRequested);  
        }  
    } 

Since you mentioned, however, that you will need to use the ItemsRequested event handler, please keep in mind that if RadComboBox is not initially visible on your ASPX page, you may need to use streamers (the ExternallCallBackPage property) For additional information on this aspect, please, read our online documentation on this problem for details
http://www.telerik.com/help/radcombobox/v2%5FNET2/combo_externalcallbackpage.html

I hope this information helps.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 1
answered on 10 Jan 2008, 08:49 AM
On the page you mention for "ExternallCallBackPage " is a link to a demo available but on this demo (Combo with Grid) the ExternallCallBackPage -Property is not used. Is there an example somewhere available?
0
Yavor
Telerik team
answered on 14 Jan 2008, 12:06 PM
Hi Markus,

I believe you will find the following example useful. I hope this information helps.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 1
answered on 14 Jan 2008, 01:36 PM
Thanks for inforamtion but the example uses the normal ASP.NET controls. I use the prometheus controls and in the combobox I can't find an ExternallCallBackPage-property. I need the "TextChanged" property also to be fired and also for radTextBox (Prometheus) and radDateTimePicker (Prometheus) in a EditFormTemplate. As far as I can see, this currently not supported neither for radCombbox not for other controls. Am I correct?
0
Yavor
Telerik team
answered on 17 Jan 2008, 07:43 AM
Hi Markus,

The TextChanged event is avaiable for the radTextBox (Prometheus) and radDateTimePicker (Prometheus). This however is a server side event and it will only be fired on a postback. You can also take a dvantage of the client side API of the controls, and for example use the onvaluechanged event handler, as in the code snippet below:

.aspx
<telerik:RadTextBox ID="RadTextBox1" runat="server">  
   <ClientEvents OnValueChanged="ValueChanged" /> 
</telerik:RadTextBox> 

As for RadComboBox - the ExternalCallBackPage property has been removed from the Prometheus version. You can use a WebService to populate the combobox. An example can be seen at:
Populate from WebService

Also, RadComboBox Prometheus provides a TextChanged event. For more details, please check the following article:

TextChanged event

Regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 1
answered on 17 Jan 2008, 12:38 PM
Thanks for information, but I will not use the feature it's to complicate for implementation. I use third pary controls to make my live easier and and not to make it more difficult.
Tags
Grid
Asked by
Markus
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Markus
Top achievements
Rank 1
Share this question
or