Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
132 views
I have a Radgrid in an Update Panel. It has a template for "Add new Record". This template has a dropdownlist and a RadAsyncUpload control in a panel. When a value is selected from the dropdown and a file is uploaded, the Upload button is enabled. Else it is disabled.  For this I have a javascript function as follows:
function SetUploadButtonEnabled(controlPanel, fileUploadId) {
     var docTypesList = controlPanel.find("select");
     var gotListVal = docTypesList.val() != "";
     var fileUpload = $find(fileUploadId);
     var gotFileVal = fileUpload.getUploadedFiles().length > 0;
     var enable = gotListVal && gotFileVal;
     if (enable) {
         controlPanel.find(".GxButtonBlue").removeAttr("disabled");
     }
     else {
         controlPanel.find(".GxButtonBlue").attr("disabled", true);
     }
 }
I am trying to call it from code behind as follows, but the function is not being called:
string script = "<script type=\"text/javascript\">"
                + "\n  $(document).ready(function (){"
                    + "\n    $(document).on(\"change\", \"#" + this._DdDocumentTypes.ClientID + "\", function(event){"
                    + "\n      var docUploadControlPanel = $(this).closest(\"#" + this._DocUploadControlPanel.ClientID + "\");"
                    + "\n      SetUploadButtonEnabled(docUploadControlPanel, \"" + this._fiInput.ClientID + "\");"
                    + "\n    });"
                    + "\n  });"
                    + "\n "
                    + "</script>";
 
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "DocumentAjaxUploadCtrlScript_" + this.ClientID, script);
Since an Update Panel is there I even tried:
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "DocumentAjaxUploadCtrlScript_" + this.ClientID, script, true);

But the javascript function is never called! Can you suggest a solution?
Shinu
Top achievements
Rank 2
 answered on 05 Jun 2014
1 answer
194 views

Hi,

I have two questions here.

I am using a RADGRID and when ME.LOADComplete event is happening I run a procedure which will filter the RAD Grid - roughly about 200 rows by default from the SQL View, it then goes down to about 20 results. The query takes less than 0 seconds to run on SQL Management studio. It takes about 1-2 seconds to display the page and filter the view.

In a different window, I am returning a view which has about 17,000 rows in it and takes about 4 seconds to run in SQL Management Studio but then it takes about 14 seconds to display and filter the page. It takes about 8 seconds to load without being filtered. Both RADGRIDs has the data source set in the ASPX page but I was wondering is there not a more efficient way to filter it first and then if the user changes the filter, it will apply accordingly? The number of results would be about 400 or so. I was thinking I need to use OnNeedDataSource and filter directly from SQL instead of the programmatically way of
rgCompanyTickets.MasterTableView.FilterExpression = strFilter
rgCompanyTickets.Rebind()

My other issue is that, in the RADGRID I have added a new column so the user can check the box and when the user presses a button on the screen, it displays a  RadWindow which says enter comment and click a button so that it can update the db. The issue I am facing is that when the page gets loaded from the first button click is that it is removing the state the checkboxes are in. So when I press the 2nd button, it doesn't know what rows I have selected before the post back. I believe the reason why it is doing this is due to me using the rebind statement during the filter process.

Do you know guys have any solutions or ideas about this?

<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="False" >
        <ItemTemplate>
          <asp:CheckBox ID="CheckBox1" runat="server"
          />
        </ItemTemplate>
        <HeaderTemplate>
          <asp:CheckBox ID="headerChkbox" runat="server"
      />
        </HeaderTemplate>
      </telerik:GridTemplateColumn>



Thanks,
Alex


Princy
Top achievements
Rank 2
 answered on 05 Jun 2014
3 answers
110 views
Hi,
Currently I have a 'add' button on a webform.

When clicked, a RadWindowsManager dialog window is displayed.

Clicking 'save' in that dialog, closes the dialog, adds a record to database table, and uses the client 'RefreshGrid' to update a grid on-screen with that extra record.

This all works fine- thanks to the great Telerik documentation!

However, as the record is added to the bottom of the grid, I would like the client to automatically scroll to the bottom.

I've tried using javascript before and after the '_doPostBack' call in 'refreshGrid', but the browser ignores it.

Do you have any suggestions?

Thanks,
Steve
Princy
Top achievements
Rank 2
 answered on 05 Jun 2014
1 answer
99 views
Hello,

My data source looks like:
RadGrid1.DataSource = TubesLoad;
where TubesLoad is ObservableCollection from my dll(from references).

I know, what i mast handle events RadGrid1_ItemUpdated, RadGrid1_ItemCreated etc. for each action with dataGrid. But i can't find the way to update data in my collection using Telerik.
Can u help me?

Thanks.
Ivan.
Ivan
Top achievements
Rank 1
 answered on 05 Jun 2014
1 answer
493 views
I have try to use CustomValidator with telerik:RadTextBox but it is not fired?

​<telerik:RadTextBox ID="rtbTelefon" MaxLength="50" Width="220px" EmptyMessage="Telefon" ToolTip="Telefon" runat="server" /><telerik:RadTextBox ID="rtbEpost" MaxLength="50" Width="230px" EmptyMessage="E-postadress" ToolTip="E-postadress" runat="server" /> <asp:CustomValidatorid="AtLeastOneContact" ClientValidationFunction="AtLeastOne_ClientValidate"Display="None" ErrorMessage="Telefon <b>eller</b> e-post krävs!"   SetFocusOnError="True"runat="server" />


And in telerik:RadScriptBlock
function AtLeastOne_ClientValidate(source, args) {
    if (document.getElementById("<%= rtbTelefon.ClientID %>").value == "" &&
        document.getElementById("<%= rtbEpost.ClientID %>").value == "") {
        args.IsValid = false;
    }
    else {
        args.IsValid = true;
    }
}


Nothing happand, but if i change to <asp:TextBox it works??
Why does it not work with telerik:RadTextBox?












Shinu
Top achievements
Rank 2
 answered on 05 Jun 2014
1 answer
117 views
I have got the Export settings enabled within my RadGrid, but cannot figure out how to execute or initiate an export of the data that is currently in the Grid.


<telerik:RadGrid ID="RadGrid2" runat="server" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" DataSourceID="OpenAccessLinqDataSource1" Skin="Sunset" CellSpacing="-1" GridLines="Both" AutoGenerateEditColumn="True" AllowFilteringByColumn="True" AllowSorting="True" ShowGroupPanel="True">
<ExportSettings ExportOnlyData="True" FileName="SystemCabCommExport">
<Excel Format="ExcelML" />
</ExportSettings>

How do you go about creating a button or link to execute the enabled Export Settings?
Princy
Top achievements
Rank 2
 answered on 05 Jun 2014
5 answers
245 views
Hi,

The examples I have seen have a button-per-appointment approach. I am interested in exporting all appointments via one button click and preferably, that button is a button that is not integrated into the scheduler, but is a simple .net button elsewhere on the page. Has anyone done this/know if it can be done? Thanks!
SDI
Top achievements
Rank 1
 answered on 05 Jun 2014
1 answer
132 views
Is it possible to get Virtual Scrolling going using ObjectDataSource? I haven't been able to find any good examples except for those on the demo-site (http://demos.telerik.com/aspnet-ajax/dropdownlist/examples/functionality/virtualscrolling/defaultcs.aspx). Unfortunately, the DropDownList doesn't seem to provide the ObjectDataSource with values for "StartIndex" and "ItemsCount" as per the WebService-datasource example.

Below is a simple example, describing the desired scenario. The Facade is in place and works well with other types of solutions, e.g. paging a Grid using an ObjectDataSource.


<asp:ObjectDataSource ID="ODSNotifications" runat="server"
        TypeName="NotificationsFacade"
        SelectMethod="Get"
        OnSelecting="ODSNotifications_Selecting"
        EnablePaging="true"
        SelectCountMethod="GetCount"       
        StartRowIndexParameterName="StartIndex"
        MaximumRowsParameterName="ItemsCount">
        <SelectParameters>
            <asp:Parameter Name="userId" Type="Int32" />
            <asp:Parameter Name="fromDate" Type="DateTime" />
        </SelectParameters>
    </asp:ObjectDataSource>
 
    <telerik:RadDropDownList ID="RDDLNotifications" runat="server"
        DataSourceID="ODSNotifications"
        CssClass="RDDLNotifications"
        DataValueField="Title"
        DataTextField="Id"
        OnItemDataBound="RDDLNotifications_ItemDataBound"
        DropDownWidth="200px"
        DropDownHeight="100px"
        EnableVirtualScrolling="true">
        <ItemTemplate>
            <asp:Panel ID="PNotification" runat="server" CssClass="w_n_outer" onclick="StopPropagation(event);">
                <div class="w_n_inner">
                    <asp:Label ID="LType" runat="server" Font-Size="0.8em" />
                    <br />
                    <asp:Label ID="LTitle" runat="server" Font-Bold="true" />
                    <br />
                    <asp:Label ID="LBody" runat="server" />
                </div>
            </asp:Panel>           
        </ItemTemplate>
    </telerik:RadDropDownList>

Any help would be greatly appreciated!


Nencho
Telerik team
 answered on 04 Jun 2014
2 answers
284 views
I set the background color of the RadToolTip but it doesn't work.

Why is it there?

Also, how do you format the text and title?

Thanks.
Raymond
Top achievements
Rank 1
 answered on 04 Jun 2014
3 answers
93 views
Have an AsyncUpload control with MultipleFileSelection set to Automatic.  User can upload multiple images which are previewed in a listview and user can remove or reorder the images before final save.

Seems the AsyncUpload control uploads the files in alphabetic order as oppose to the order that the user has clicked.
Is there any setting or way to make the upload of the files in the order that the user has clicked using Ctrl Mouse Click?

Thanks

Glenn

Hristo Valyavicharski
Telerik team
 answered on 04 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?