Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
2.7K+ views
Dear all,

please suggest me how to find controls in grid on client side

i have radgrid controle in that ItemTemplate i have Radcombobox but i am not able to get that RadcomboBox on client side
my code is below

<telerik:RadGrid ID="RadGrid_ECNEntity" runat="server" AutoGenerateColumns="False"
GridLines="None" OnNeedDataSource="RadGrid_ECNEntity_OnNeedDataSource" OnInsertCommand="DoInsert">
<MasterTableView CommandItemDisplay="Top" EditMode="InPlace">
         <Columns>
               <telerik:GridTemplateColumn DataField="EntityName" HeaderText="EntityName" UniqueName="EntityName"
                    SortExpression="EntityName">
                     <ItemTemplate>
                      <asp:Label ID="lblECNEntityName" runat="server" Text='<%#Bind("EntityName") %>' />
                     </ItemTemplate>
                 <EditItemTemplate>
                     <telerik:RadComboBox ID="RadComboBox_EntityName" runat="server" EnableLoadOnDemand="true"
                                            DataTextField="Value" DataValueField="Key" OnItemsRequested="RadComboBox_EntityName_OnItemsRequested"
                                            AllowCustomText="true" ShowMoreResultsBox="true" OnClientSelectedIndexChanged="LoadECnEntityKeys" />
                  </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="EntityKeyName" HeaderText="EntityKeyName"
                                    UniqueName="EntityKeyName" SortExpression="EntityKeyName">
                        <ItemTemplate>
                          <asp:Label ID="lblECNEntityKeyName" runat="server" Text='<%#Bind("EntityKeyName") %>' />
                         </ItemTemplate>
                       <EditItemTemplate>
                         <telerik:RadComboBox ID="RadComboBox_EntityKeyName" runat="server" EnableLoadOnDemand="true" EnableViewState="false"
                              DataTextField="Value" DataValueField="Key" OnItemsRequested="RadComboBox_EntityKeyName_OnItemsRequested"
                              AllowCustomText="true" ShowMoreResultsBox="true" OnClientItemsRequested="ItemsLoaded"/>
                         </EditItemTemplate>
                  </telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
  
  
<telerik:RadScriptBlock ID="scriptBlock" runat="server">
    <script type="text/javascript">
      
        function LoadECnEntityKeys(sender, eventArgs) {
             
            var EntityKeyName = $find("<%= RadGrid_ECNEntity.ClientID%>").get_masterTableView().get_item().findControl("RadComboBox_EntityKeyName");  
  
            var item = eventArgs.get_item();
            EntityKeyName.set_text("Loading...");
              
            // if a Entity is selected
            if (item.get_index() > 0) {
                // this will fire the ItemsRequested event of the 
                // EntityKey combobox passing the EntityID as a parameter
                EntityKeyName.requestItems(item.get_value(), false);
            }
            else {
                // the -Select a Entity- item was chosen
                EntityKeyName.set_text(" ");
                EntityKeyName.clearItems();
            }
        }
  
        function ItemsLoaded(sender, eventArgs) {
            if (sender.get_items().get_count() > 0) {
                // pre-select the first item
                sender.set_text(sender.get_items().getItem(0).get_text());
                sender.get_items().getItem(0).highlight();
            }
  
            sender.showDropDown();
        }
  
    </script>
</telerik:RadScriptBlock>


I am getting error for this line
var EntityKeyName = $find("<%= RadGrid_ECNEntity.ClientID%>").get_masterTableView().get_item().findControl("RadComboBox_EntityKeyName");  
Eyup
Telerik team
 answered on 31 Jul 2018
5 answers
182 views
Hello,

Browing a database with thousand of elements hierarchicaly related, I would appreciate having radTreeview load on demand working like radCombobox or RadGrid: as I may have thousand nodes on same tree level, I don't want to read them all but need only to paginate with a fixed page size.

Actual version doesn't offers this , is there something todo ?

Thanks CS
ShareDocs
Top achievements
Rank 1
 answered on 31 Jul 2018
5 answers
224 views
I've got two RadEditors collecting static content to put above and below some data driven content that will wind up rendering out on the page like

<body>
<< content from RadEditor1 >>
<< data driven content >>
<< content from RadEditor2 >>
</body>

I'd like to allow a <div> or <table><tr><td> to be left open in RadEditor1 to be followed by </div> or </td></tr></table> in RadEditor2 (this would be entered in the HTML view of the editor).

I've tried setting the ContentFilters to None and the RadEditor automatically closed the tags. So RadEditor HTML would start with <table><tr><td> and when I switch to the designer and back to HTML I now see <table><tbody><tr><td></td></tr></tbody></table>. 

Is is possible to force RadEditor to not fix the HTML for me?

Thanks for your help!
Rumen
Telerik team
 answered on 31 Jul 2018
5 answers
195 views
Hello

I've got a user control featuring the RadEditor, and I've been using the OnClientPasteHtml event handler to strip out html pasted into the content pane via Ctl-V.  I'm maintaining a clients' code base and they report this was working okay until recently.  They're using 2013.2.717.45 of Telerik.Web.UI.

I've found that the unwrapped version of RadEditor fires OnClientPasteHtml just fine.  If I create a usercontrol, add an Editor instance with the exact same configuration, and add the usercontrol to the page, the client side event no longer fires.

Issue occurs in IE11, FF, Chrome and Safari.

Help or guidance would be appreciated, thanks very much.

Michael
Rumen
Telerik team
 answered on 31 Jul 2018
4 answers
291 views
We intially had textarea being used in our application. When we changed to RadEditor, all our old records did not apply line breaks, since there were no <br> tags. They had new line characters. So I am using <pre> tag inside RadEditor to display them in next line. But now there is an issue while we copy and paste text from an editor. The text wrapping does not occur and we get horizontal scroll. Need help to wrap the text.
Yuvaraj
Top achievements
Rank 1
 answered on 31 Jul 2018
8 answers
1.0K+ views
hi

i am having an issue with the programmatic creation of series and data , i have many series to add to a line chart , but the data is based on a time series so i am struggling to get it properly into a system.

would anyone be able to provide an example of programmatic creation of multiple series data based on a time series ?

Peter.

Vessy
Telerik team
 answered on 30 Jul 2018
1 answer
128 views

 

How to show time picker even if I create appointment on month view or week view? any chance to achieve that?

 

Regards

Peter Milchev
Telerik team
 answered on 30 Jul 2018
7 answers
1.5K+ views
Hello.

Inside an UpdatePanel, I have a "search" button and a RadGrid. The grid is programatically data-bound whenever the search button is clicked. I also have a RadAjaxManager which enables the paging (otherwise, "next" and "back" always return the first set of results). The problem is, if I select say the second page of a set of results, then click "search" to create a different set of results, the grid shows the correct results but the paging is still on page 2, and I'd like it to start on page 1.

I have tried to reset the paging index to 1 on my search button onclick, to no avail. I cannot set it on the databind bit, since that is called whenever a new page is selected.

Any help appreciated.

Bérénice
Christopher Lee
Top achievements
Rank 1
 answered on 30 Jul 2018
2 answers
810 views

I am trying to implement server side custom paging and using https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/paging/custom-paging/defaultcs.aspx as a reference. 

Please refer to your following code

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            MyBusinessObjectCollection MyBusinessObjectCollection1 = new MyBusinessObjectCollection();
            int startRowIndex = (ShouldApplySortFilterOrGroup()) ?
                0 : RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
  
            int maximumRows = (ShouldApplySortFilterOrGroup()) ?
                MyBusinessObjectCollection1.SelectCount() : RadGrid1.PageSize;
  
            RadGrid1.AllowCustomPaging = !ShouldApplySortFilterOrGroup();
  
            RadGrid1.DataSource = MyBusinessObjectCollection1.Select(startRowIndex, maximumRows);
        }

 

If the user uses filtering, say in the example, searching for Unit Price 9, in this case, your ShouldApplySortFilterOrGroup() would return a true. That means maximumRows will be count of entire dataset. So, MyBusinessObjectCollection1.Select(0, 100000); would be very expensive.

 

I also noticed, that when filtering, items in pages in the bottom right of the grid doesnt display the correct item count.

 

Do you have another working example of server side paging which allows filtering?

Thank you

Attila Antal
Telerik team
 answered on 30 Jul 2018
2 answers
243 views

I am in the process of adding Time Zone functionality into our existing Scheduler which did not include it.  I am having an issue when I set a TimeZoneId on the Scheduler and then use the Advanced Form with EnableTimeZonesEditing turned on.  The times of the appointment that get stored in UTC reflect the time zone of the Scheduler, not for the appointment.  For example, if I set the TimeZoneId of the Scheduler to "Pacific Standard Time" and add an appointment for July 25, from 1:00 PM to 2:00 PM with a timezone of "Eastern Standard Time", I would expect the stored time of the appointment to be 17:00 to 18:00 UTC.  However, when I view the appointment in the AppointmentInsert event, the start time is 20:00 UTC and then end time is 21:00 UTC, even though the TimeZoneId of the appointment shows as "Eastern Standard Time".

Am I supposed to do the calculation myself when adding an appointment with a different timezone than the Scheduler, or should this be done automatically?  Looking at the code for the Time Zones demo for the Scheduler, I don't see any additional code for this calculation, yet it seems to work as expected.

Peter Milchev
Telerik team
 answered on 30 Jul 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?