Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
5.6K+ views
Hi,
This seems like it should be so simple - but I can't get it to work. I have a RadGrid , using AjaxManager and NeedDataSource.  I execute different queries - depending on the search criteria selected and return a dataset that is set to the DataSource:

this.RadGrid1.MasterTableView.DataSource = ds;

this.RadGrid1.MasterTableView.DataMember = ds.Tables[0].ToString();


This works great - however I have a clear button that I am trying to clear the grid with - the code is executed but the rows still are in the grid on the screen  - I set the DataSource and DataMember to null and rebind.

protected

void btnClear_Click(object sender, EventArgs e)

{

this.RadGrid1.MasterTableView.DataSource = null;

this.RadGrid1.MasterTableView.DataMember = null;

this.RadGrid1.DataSource = null;

this.RadGrid1.Rebind();

}

So when that didn't work I thought I would manually try to remove the rows and I can't seem to find any RowsCollecion to iterate through and remove.

What am I missing here?? Any help is appreciated. Thanks!

Edited to add - I have EnableViewState set to True on the grid

Edited again - I was able to get the functionality I wanted by creating an empty table and setting the dataset to the datasource and the empty table to the datamember and then doing the this.RadGrid1.Rebind(); 

I would still be curious as to why setting the datasource and datamember to null would not work. It seems as though this functionality works when the NeedDataSource event is called automatically without having to do a Rebind.

joni

Attila Antal
Telerik team
 answered on 07 Aug 2019
1 answer
197 views
     We have a RadGrid with a RadNumericTextBox in a GridTemplateColumn.  How can we have the grid highlight the row where the keyboard focus is?  So as the user Tabs to the next RadNumericTextBox in the next row, the highlighted row of the grid should change.
Attila Antal
Telerik team
 answered on 07 Aug 2019
6 answers
197 views

Hi,

Using the RadGrid in Batch Editing mode and the EditType is set to row.

What is the best way to implement a RangeValidation for a GridNumericColumn ? I 

I just want the user having to enter a value between 1 and 999. If this is not the case, a small message indicates the error.

Thanks in advance to show me the way :)

 

Attila Antal
Telerik team
 answered on 07 Aug 2019
3 answers
416 views

I am looking to get the URL from the radWindow from javascript.  I would rather not have to set it via javascript but not doing this it won't be able to resize the radwindow as it returns an error.  I would like to get the NavigateURL from the radWindow

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript" src="/scripts/ValidateFileType.js"></script>
    <script src="/scripts/ModalWindow.js" type="text/javascript"></script>
    <script type="text/javascript">
 
    function openWinNavigateUrl() {
            var oWnd = $find("<%= rwApplication.ClientID%>");
        oWnd.setUrl("/Repository/Application/2_CompletedPDF.pdf");
        sizeRadWindow(oWnd, 50, 55);
        oWnd.show();
    }
 
    function sizeRadWindow(oWnd, width, height) {
        var browserWidth = $telerik.$(window).width();
 
        var browserHeight = $telerik.$(window).height();
        oWnd.setSize(Math.ceil(browserWidth * width / 100), Math.ceil(browserHeight * height / 100));
        oWnd.center();
 
    }
    </script>
</telerik:RadCodeBlock>

 

                    <telerik:RadLinkButton runat="server" Text="View Completed Application"
                        OnClientClicked="openWinNavigateUrl" AutoPostBack="false" ID="_appLink">
                    </telerik:RadLinkButton>
<telerik:RadWindow RenderMode="Lightweight" runat="server" ID="rwApplication" NavigateUrl="/Repository/Application/2_CompletedPDF.pdf"
    Modal="true" InitialBehaviors="Maximize" RestrictionZoneID="NavigateUrlZone" AutoSize="false" VisibleStatusbar="false" ShowContentDuringLoad="false"
    Behaviors="Close, Maximize" Title="Completed Application">
</telerik:RadWindow>
Vessy
Telerik team
 answered on 07 Aug 2019
1 answer
168 views

Hi all, 

 

Wondering you can help.

We have found that we have to set the width of the radtabstrip in PX to get the scrolling to work.  Can we use 100% so that it uses the full browser width and enables the scroll feature if the width of the tabs is greater than width of the page.  

When we us 100% it errors, however if we set to say 500px it doesn't resize on the different size screens.

Cheers

Joel

 

Rumen
Telerik team
 answered on 07 Aug 2019
1 answer
112 views

Hello,

I am having a hard time triggering OnClientMouseOver event on parent RadMenuItem after the slide the slide containing the RadMenuItem children had been expanded. For example, take the picture below. When I hover over each sub menu item of Guitars menu item, I should have content of .rmSlide .rmVertical:before changed. It does that onClientMouseOver, but it does not change if I hover back from the slide menu items (like ClassicalGuitars, Steel String Guitars and so on) to the Guitars menu item. Is there any way I can do this easily, some functionality provided by the framework or what do you think it is the best practice in this case ? 

 

I am looking forward to your reply. 

Thank you! :)

 

Eric R | Senior Technical Support Engineer
Telerik team
 answered on 06 Aug 2019
1 answer
87 views

  Hi,

We are using RadNumericTextBox inside user control. When this page is rendering on mobile(iOS) RadNumericTextBox is not editable(seems like read only).

Kindly help me to fix this issue as soon as possible.

Code used in user control:

<td style="text-align: center;">
                        <asp:Label SkinID="fieldLabel" ID="Label1" runat="server" Text="Salary and Wages" /></td>
                    <td style="text-align: center;">
                        <telerik:RadNumericTextBox RenderMode="Lightweight" ID="MHI_Salary_Wages_Amount" runat="server" Width="70" MaxLength="8" AllowOutOfRangeAutoCorrect="True" Value="0.00" MinValue="0.00" MaxValue="99999.99" DataType="System.Decimal" Type="Currency"
                            EnableSingleInputRendering="True" Style="text-align: right" AutoPostBack="true" ClientEvents-OnKeyPress="resetValidationState" ToolTip="Salary Wages Amount" SelectionOnFocus="SelectAll">
                            <NumberFormat AllowRounding="true" DecimalDigits="2" KeepNotRoundedValue="True" KeepTrailingZerosOnFocus="True" />
                        </telerik:RadNumericTextBox>
                    </td>

 

Thanks

Loganathan

Rumen
Telerik team
 answered on 06 Aug 2019
1 answer
101 views

Is there a way to get the Required validator in HTML5 to work with the RadAutoCompleteBox box?

I tried using JavaScript to add the required attribute to the '.._Input' control in the markup but it didn't work.

Here is my code:

      <div class="form-group">        
                   <telerik:RadAutoCompleteBox
                                                 ID="txtAddress"
                                                 Runat="server"
                                                 DataSourceID="dsAddressSearch"
                                                 DataTextField="search"
                                                 DataValueField="ID"
                                                 Filter="StartsWith"
                                                 InputType="Text"
                                                 ClientIDMode="Static"
                                                 Skin="Bootstrap" RenderMode="Auto" Width="90%" AllowCustomEntry="True"   >
                                                 <TextSettings SelectionMode="Single"   />
                                             </telerik:RadAutoCompleteBox>
                                            
            <div class="invalid-feedback">Address is required. </div>
        </div>

 

Rumen
Telerik team
 answered on 06 Aug 2019
4 answers
566 views

Hi,

I am using RadDatePicker and I want to make whole week selectable. When user click on any date then whole week row will be selected and input field will be filled with Monday's date. Also I can set default week by date.
In my page, depending on some settings (SomeSettings), I want just the week days be selected (weekends be excluded) when the user clicks on one of the week numbers. Below you can find my solution. As I am calling $(".RadAjax").hide(); currently to solve the AutoPostBack problem after calling sender.selectDate() function, I was wondering if anyone can provide a better solution:

<div id="uxSmallCalendarPanel" style="width: 220px;" runat="server">
    <Telerik:RadCalendar DayCellToolTipFormat="" EnableNavigationAnimation="true" Style="text-align: center;" AutoPostBack="true CalendarTableStyle-BorderWidth="0" Width="100%" EnableMultiSelect="true" BorderStyle="None" runat="server" ID="uxCalendar" SkinID="imcrm" CultureInfo="" >
      <ClientEvents OnRowHeaderClick="confirmRowSelection"/>
   </Telerik:RadCalendar>
 </div>

 

<Telerik:RadAjaxManagerProxy runat="server" ID="uxAjaxManager">
   <AjaxSettings>
      <Telerik:AjaxSetting AjaxControlID="uxSmallCalendarPanel">
         <UpdatedControls>
         <Telerik:AjaxUpdatedControl ControlID="uxSmallCalendarPanel" LoadingPanelID="uxSmallLoadingPanel" />
         </UpdatedControls>
      </Telerik:AjaxSetting>
   </AjaxSettings>
</Telerik:RadAjaxManagerProxy>
 
<script type="text/javascript">
function confirmRowSelection(sender, eventArgs)
{   
     eventArgs.set_cancel(true);

     var year = sender.get_focusedDate()[0];
     var weekNumber = eventArgs.get_domElement().innerHTML;
     var firstDayOfSelectedWeek = new Date(year, 0, (weekNumber - 1) * 7);

 

     for (var i = 0; i < (SomeSettings ? 5 : 7); i++)
     {     
        var selectedDate = new Date(firstDayOfSelectedWeek);
        selectedDate.setDate(selectedDate.getDate() + i);
        sender.selectDate([selectedDate.getFullYear(), selectedDate.getMonth() + 1, selectedDate.getDate()]);
     }

 

     $(".RadAjax").hide();
</script>
Mehdi
Top achievements
Rank 1
Veteran
 answered on 06 Aug 2019
4 answers
206 views

Dear Sir/Madam,

i am using telerik ajax dll version (Telerik.web.ui.dll) 2019.1.215.45 in asp.net application. i have dynamically created radgrid which has more than 70 rows, so when i am trying to export radgrid to pdf using RadClientExportManager [exporting html content to pdf]. The lengthy radgrid is not continuing to next page in pdf. the first 50 rows are printed in first page the rest of the rows are not getting printed in second page.

Peter Milchev
Telerik team
 answered on 06 Aug 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?