Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
112 views

I have a radgrid with an export button which I was able to exclude from using ajax via ajaxmanager. 
However I now require a prompt to the user to choose an option which affects the data that will be exported.
I use a custom rad prompt template to get a dropdownlist option and use a callback function in javascript which makes
an ajax request passing the parameter containing the dropdownlist option selected and then call my export function which no longer
works. Is there a good workaround so my export will still work after a prompt to the user?

 Thanks for the help.

 

protected void rg_ClientCalculators_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "ExportCalculator")
        {
            ViewState["CalculatorID"] = int.Parse(e.CommandArgument.ToString());
            RadWindowManager1.RadPrompt("Show all line items?", "callbackFn", 300, 300, null, "Calculator Export", " ");     
        }
    }
 
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Yes")
            ExportCalculator(true);
        else if (e.Argument == "No")
            ExportCalculator(false);       
    }
 
 private void ExportCalculator(bool showAllLineItems)
    {
        Company UsersCompany = DAL.GetCompanyInfo(CurrentUser.UserID);
        var calculatorID = (int)ViewState["CalculatorID"];
        DataTable CalculatorClientInfo = DAL.ExportCalculatorClientInfo(calculatorID);
 
        ReportProcessor Processor = new ReportProcessor();
        InstanceReportSource ReportSource = new InstanceReportSource();
        ClientTrackerReports.CalculatorExport Report = new CalculatorExport();
        Report.ReportParameters["CalculatorID"].Value = calculatorID;
        Report.ReportParameters["CompanyName"].Value = UsersCompany.CompanyName;
        Report.ReportParameters["ClientName"].Value = CalculatorClientInfo.Rows[0]["ClientName"];
        Report.ReportParameters["AnotherVendor"].Value = CalculatorClientInfo.Rows[0]["AnotherVendor"];
        Report.ReportParameters["DateOfStatementProvided"].Value = CalculatorClientInfo.Rows[0]["DateOfStatementProvided"];
        Report.ReportParameters["ShowAllLineItems"].Value = showAllLineItems;
        ReportSource.ReportDocument = Report;
        ViewState.Remove("CalculatorID");
 
        Hashtable DeviceInfo = new Hashtable();
        RenderingResult Result = Processor.RenderReport("PDF", ReportSource, DeviceInfo);
 
        string FileName = CalculatorClientInfo.Rows[0]["ClientName"].ToString() + "-Pricing." + Result.Extension;
 
        Response.Clear();
        Response.ContentType = Result.MimeType;
        Response.Cache.SetCacheability(HttpCacheability.Private);
        Response.Expires = -1;
        Response.Buffer = true;
 
        Response.AddHeader("Content-Disposition", string.Format("{0};FileName=\"{1}\"", "attachment", FileName));
        Response.BinaryWrite(Result.DocumentBytes);
        Response.End();
 
    }

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function callbackFn(arg) {
                    if (arg) {
                        $find("<%=RadAjaxManager1.ClientID %>").ajaxRequest(arg);
                    }
 
                }
            </script>
        </telerik:RadCodeBlock>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
         <PromptTemplate>
                <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                    <script type="text/javascript">
                        function closePrompt(winid) {
                            var select = document.getElementById('select' + winid);
                            var selectedValue = select.options[select.selectedIndex].value;
 
                            var confirmWnd = $find(winid);
                            confirmWnd.close(selectedValue);
 
                        }
                    </script>
                </telerik:RadCodeBlock>
                <div class="windowpopup radprompt">
                    <div class="dialogtext">
                        {1}
                    </div>
                    <div>
                        <select id="select{0}">
                            <option value="Yes">Yes</option>
                            <option value="No">No</option>
                        </select>
                    </div>
                    <div>
                        <input type="button" onclick="closePrompt('{0}');" value="OK" />
                        <input type="button" onclick="$find('{0}').close();" value="Cancel" />
                    </div>
                </div>
                </div>
            </PromptTemplate>
    </telerik:RadWindowManager>

Marin Bratanov
Telerik team
 answered on 16 Jun 2015
0 answers
74 views

Hello,

Does anyone can help me with a simple example for the data validation inside radwindow as modal dialog.

Thank you.

Ahmed
Top achievements
Rank 1
 asked on 16 Jun 2015
1 answer
153 views

I am looking for auto resume upload functionality for dropped internet connection. Is this feature implemented in latest version of telerik controls?

 Ref: http://www.telerik.com/forums/lost-connection-during-upload

 

 

Plamen
Telerik team
 answered on 16 Jun 2015
1 answer
130 views

Code:

private void Bind_ddlProduct(RadComboBox p_rcbProduct)
        {
            ProductCollection oProductCollection = new ProductCollection();
            oProductCollection.DAL_Load(null, null, null, null, null, null, null, null, null, true, false, false, null, null, null, null, null, null);
 
            p_rcbProduct.DataSource = oProductCollection;
            p_rcbProduct.DataTextField = "ProductName";
            p_rcbProduct.DataValueField = "ProductID";
            p_rcbProduct.DataBind();
 
            p_rcbProduct.AllowCustomText = false;
            p_rcbProduct.MarkFirstMatch = true;
        }

 

<telerik:RadComboBox ID="rcbProduct" runat="server" Width="180" Height="100px" MarkFirstMatch="true"
                                                    EmptyMessage="Select Product" ClientIDMode="Static" AllowCustomText="false" Filter="None"
                                                    ChangeTextOnKeyBoardNavigation="true" >
                                                </telerik:RadComboBox>

The case:

That code is working on my server. Then I build at production, use same Telerik version. After some weeks this case appears:

Look at Product.jpg

at production server, I try to type : 'Eas' then when I try to type next letter 't', the dropdownlist autocomplete stop working and the text field back to blank.

The datasource there is record showing word 'East'

 

Telerik version attached.

Colleen
Telerik team
 answered on 15 Jun 2015
2 answers
225 views

Hi! It seems to me, I found nothing about adaptive MediaPlayer size at forum. 

The problem is that, if I don't define Width and Height properties, MediaPlayer shrinks to it minimal height.

Well, if we define width via css style to any percent value, MediaPlayer corresponds to this width. But any attempts to set Height (using css, skin, javascript) fail.

.mplayer {
    width: 80%;
    margin: 0 auto;
    height: 100%;
}

I need proportional dimensions, ex. 3:4. I want to set the height to 0.75 of width with any possible way.

Did anybody try to change MediaPlayer size so? Is it possible finally? Thank you in advance!

Alex
Top achievements
Rank 1
 answered on 15 Jun 2015
5 answers
191 views

Hi,

I am using OnClientNodeDragging to track when a node is being dragged. I want to allow dropping only on certain nodes and to display a 'no entry' icon when dragging over an non-drop node. (similar to what the RadTreeview does when you drag a node over itself)

I assume I need to use 'set_allowDrop' but I can only set this on the node being dragged, not the underlying node ie. I want to get a reference to the node being dropped on, not the html object from get_htmlElement.

 

Ivan Danchev
Telerik team
 answered on 15 Jun 2015
1 answer
107 views

I'm having some trouble understanding how the datasource calls are handled on the server side. 

In this scenario i'd like to have the search box only request after either 3 letters are entered, or if the search button is pressed. I'm binding to my own datasource connecting to a BI layer. I don't quite understand how the onSearch event is fired both if the search is pressed, or if data changes in the box. What is the difference then when a user actually selects an item from the list? 

A code example would be helpful.

Dimitar Terziev
Telerik team
 answered on 15 Jun 2015
1 answer
216 views

Hi,

 

I have one Rad Rating control like below

<telerik:RadRating ID="RadRating1" runat="server" Precision="Item" SelectionMode="Continuous" ItemCount="5">

now 5 starts displaying.if i select 3 rd star i want valu "3" using jquery.

can anyone send sample to me.

Slav
Telerik team
 answered on 15 Jun 2015
2 answers
257 views

I'm creating a nested view, for which I am using a DataSource different from the main grid. This is working perfectly, I have the whole thing wired up and looking good.

 However, I need to do some stuff on the server side to change what is displayed in the nested view based on some values in the nested view. Simple stuff like if one value is "NO" then don't show a label. I'm able to detect and manipulate the controls in the nested view so far but I am stuck as to how to get the values from the datasource of the nested view.

 I also don't know when to do the hiding/showing of the items. Do I do it OnItemCreated? OnItemCommand? OnNeedDataSource? Right now I am doing it OnItemCreated but I have no idea if that is the right way.

 Here's my datasource, the Nested View settings, and my ItemCreated. Line 13 in the C# is what I know is wrong.

<asp:ObjectDataSource ID="dsViewCredit" runat="server"  
SelectMethod="GetSingleCredit"
            TypeName="ASIGlobalWebSitePublic.AdminPortal.components.AdminCredit">
            <SelectParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>

<NestedViewSettings DataSourceID="dsViewCredit">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" />
</ParentTableRelation>
</NestedViewSettings>
01.protected void Grid_ItemCreated(object source, GridItemEventArgs e)
02.        {
03.            if (e.Item is GridNestedViewItem)
04.            {
05.                 
06.                GridNestedViewItem gridNestedViewItemObj = e.Item as GridNestedViewItem;
07.                GridDataItem parentItemObj = (e.Item as GridNestedViewItem).ParentItem;
08.                if (gridNestedViewItemObj == null || parentItemObj == null)
09.                    return;
10. 
11.                if (gridNestedViewItemObj.OwnerTableView.DataKeyValues != null)
12.                {
13.                    string BillingName = gridNestedViewItemObj.OwnerTableView.DataKeyValues[parentItemObj.ItemIndex]["BillingName"].ToString();
14.   
15. 
16.                    Panel BillingInfo = (Panel)((GridDataItem)e.Item).ChildItem.FindControl("pnlBillingInfo");
17.                    Label BillingSame = (Label)((GridDataItem)e.Item).ChildItem.FindControl("lblBillingSame");
18.                  
19. 
20.                    if (!String.IsNullOrEmpty(BillingName))
21.                    {
22.                        BillingInfo.Visible = true;
23.                        BillingSame.Visible = false;
24.                    }
25.                    else
26.                    {
27.                        BillingInfo.Visible = false;
28.                        BillingSame.Visible = true;
29.                    }
30.}
31.}
32.}

Konstantin Dikov
Telerik team
 answered on 15 Jun 2015
0 answers
144 views

Hello,

 

I've something strange. I've a window like that :

 

@(Html.Telerik().Window()
    .Name("addProfilForm")
    .Visible(false)
    .Title(@ProfilLocalization.AjoutProfil)
    .Modal(true)
    .Buttons(b => b.Close())
    .Content(@<text>
        <div>
            @if (Model != null && Model.Profil != null)
            {
                @Html.Hidden("Profil.Id", Model.Profil.Id, new { id = "idProfil" })
            }
            <div>
                <div class="field">
                    @Html.Label(ProfilLocalization.NameModel)<span class="mandatoryStar">&nbsp;*</span>&nbsp;:
                </div>
                <div class="dataInput">
                    @Html.TextBox("libelleProfil", "", new { @maxlength = "100", onchange = "elementEditedAP(this);" })
                </div>
            </div>
            <div>
                <div class="field">
                    @Html.Label(ProfilLocalization.TypeProfil)<span class="mandatoryStar">&nbsp;*</span>&nbsp;:
                </div>
                    <div class="dataInput">
                    <input id="TypeProfil1" name="TypeProfil1" type="radio" value="TypeProfil1" onclick="EditedAP(this);" onchange="EditedAP(this);" />@ProfilLocalization.Profil1Libelle
                    <input id="TypeProfil2" name="TypeProfil2" type="radio" value="TypeProfil2" onclick="EditedAP(this);" onchange="elementEditedAP(this);"/>@ProfilLocalization.Profil2Libelle
                    </div>
                </div>
        </div>
        <div style="clear:both;"></div>
        <div class="field">&nbsp;</div>
        <a class="t-button ALIGN-center t-grid-update t-button-icon" title="@Html.Raw(ProfilLocalization.Save)" href="#">
            <span class="t-icon t-update" id="btnValidate"></span>
        </a>
        <a class="t-button ALIGN-center t-grid-cancel t-button-icon" title="@Html.Raw(ProfilLocalization.Cancel)" href="#">
            <span class="t-icon t-cancel" id="btnCancel"></span>
        </a>
        </text>))

 But when I call this window like :

function showModalDialogAddProfil() {
        var window = $("#addProfilForm").data('tWindow');
        window.center();
        window.open();
    } 

and i closed it severals times , its height decreases progressively ... WHY ?

 

Thanks for help

C
Top achievements
Rank 1
 asked on 15 Jun 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?