Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
580 views
hi,
when i select the item from RadCombo at that time i want to change lable text.
i select a file in Radasyncupload then i change the another item from combo at that time the which was selected in radasyncupload it was lost after Radcombo's postback fired.
 
plz see my code for more information..
<div>
        <telerik:RadAjaxManager ID="RadAjaxManager2" runat="server" ClientEvents-OnRequestStart="conditionalPostback">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgInquiry">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgInquiry" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
            <script type="text/javascript">
        // <![CDATA[
                //On insert and update buttons click temporarily disables ajax to perform upload actions
                function conditionalPostback(sender, eventArgs) {
                    var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                    if (eventArgs.get_eventTarget().match(theRegexp)) {
                        var upload = $find(window['UploadId']);
 
                        //AJAX is disabled only if file is selected for upload
                        if (upload.getFileInputs()[0].value != "") {
                            eventArgs.set_enableAjax(false);
                        }
                    }
                }
 
                function validateRadUpload(source, e) {
                    e.IsValid = false;
 
                    var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);
                    var inputs = upload.getFileInputs();
                    for (var i = 0; i < inputs.length; i++) {
                        //check for empty string or invalid extension
                        if (inputs[i].value != " " && upload.isExtensionValid(inputs[i].value)) {
                            e.IsValid = true;
                            break;
                        }
                    }
                }
            // ]]>
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" />
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowSorting="True"
            AllowPaging="True" PageSize="10" GridLines="None" OnUpdateCommand="rgInquiry_ItemUpdated"
            OnItemCommand="rgInquiry_ItemCommand" OnDeleteCommand="rgInquiry_ItemDeleted"
            OnCancelCommand="rgInquiry_CancelCommand" OnInsertCommand="rgInquiry_ItemInserted"
            AllowFilteringByColumn="true" OnNeedDataSource="rgInquiry_NeedDataSource" OnItemDataBound="rgInquiry_ItemDataBound"
            OnItemCreated="rgInquiry_ItemCreated">
            <MasterTableView CommandItemDisplay="Top" DataKeyNames="InquiryID" AllowMultiColumnSorting="True"
                GroupLoadMode="Server" CommandItemSettings-AddNewRecordText="Add New Inquiry">
                <Columns>
                </Columns>
                <EditFormSettings ColumnNumber="2" CaptionFormatString="Add/Edit properties of Inquiry : "
                    EditFormType="Template">
                    <FormTemplate>
                        <div>
                            <telerik:RadComboBox ID="rcbClientNew" runat="server" Width="300px" EmptyMessage="Select Client"
                                DataTextField="ClientID" Filter="Contains" AllowCustomText="true" AutoPostBack="true"
                                OnSelectedIndexChanged="rcbClient_SelectIndexChanged" CausesValidation="false">
                            </telerik:RadComboBox>
                            <asp:Label ID="lblClientName" SkinID="LabelU" runat="server">
                                <br />
                                <asp:Label ID="Label1" SkinID="LabelU" runat="server" Text="Attach File: "> </asp:Label>
                                <telerik:RadProgressManager ID="radProgreesManager1" runat="server" EnableTheming="true" />
                                <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" MultipleFileSelection="Automatic">
                                </telerik:RadAsyncUpload>
                                <telerik:RadProgressArea ID="radProgressArea1" runat="server" EnableTheming="true">
                                </telerik:RadProgressArea>
                                <br />
                                <div class="DynButton">
                                    <asp:Button ID="btnParentSubmit" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                        CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                                </div>
                                <div class="DynButton">
                                    <asp:Button ID="btnPatentReset" runat="server" Text="Cancel" CausesValidation="false"
                                        CommandName="Cancel" />
                                </div>
                        </div>
                    </FormTemplate>
                </EditFormSettings>
            </MasterTableView>
        </telerik:RadGrid>
    </div>

Thanks,
Jayesh Goyani
Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Mar 2011
3 answers
154 views
Hi.

I´m trying to export a grid in the ExcelML format but the columns are generated dynamically and the DataFormatString is set dynamically too.

I can´t use the ExcelMLExportStylesCreated because in this moment I don´t know which format is the column.

Have RadGrid some method to set the excel export format during the column create? For example, I need to show a column in a specific date format!

Thanks.
Daniel
Telerik team
 answered on 19 Mar 2011
9 answers
202 views

We are using Version 2010.3.121735 of the RAD Controls. According to “What's New in RadScheduler for ASP.NET AJAX Q1  SP2 â€œ there is get_height / set_height property available.

What's New in RadScheduler for ASP.NET AJAX Q1  SP2 2009 (Version Number 2009.1.527) 

  • Implemented support for custom appointment classes
  • Implemented ResourceCollection.getResourceByType
  • Implemented ResourceStyles support when using web service data binding
  • New client-side property: get_height / set_height
  • New property: WebServiceAppointmentController.AppointmentFactory; Allows you to work with custom appointment classes when using web service data binding
  • New client-side appointment property: cssClass; Sets the appointment CSS class
  • The web service methods can now return additional information alongside the appointments 

 

However, it only seems to work in IE and not other browse; which is a must have for our web application. The following code shows that the change occurs in IE, but not other browsers.

var splitter = $find("<%= RadSplitter1.ClientID %>");                  

var scheduler = $find("<%=RadScheduler1.ClientID%>");

alert("splitter.get_height = " + splitter.get_height());

scheduler.set_height(splitter.get_height());

alert("scheduler.get_height = " + scheduler.get_height())


In IE the alert displays the correct value; however in other browsers it displays a value that was set by the height attribute of the scheduler .


<telerik:RadScheduler runat="server" ID="RadScheduler1" Height="425px" …


How do we dynamically set the height client-side on all browsers?

 

Thanks in advance,

Keith E.

Peter
Telerik team
 answered on 19 Mar 2011
5 answers
321 views

 

In the Telerik Recurrence Editor control I want to hide "No End Date" while leaving "End After" and "End By".  I can't allow my clients the ability to make recurring reservations with no end date.

I was able to hide the option button by finding the id of the control but there is no id for the label of that option button.  So, I can hide the radio button but not the label for it.

Can anyone provide some code for this?

One work around would be to validate that the No End Date option is not selected after post back but I'd rather not do that.

Thanks,
Rob

 

 



 



Peter
Telerik team
 answered on 19 Mar 2011
1 answer
102 views
Hello,

I'm currently putting results of a Web Service call, into an ArrayList and binding successfully (columns auto generated). During binding I hide certain columns and the next step is to start formatting. I've looked through numerous articles on using OnColumnCreated/Creating, PreRender, and whatever I do to change the DataFormatString and DataType doesn't work when sorting. I'm trying to format the Amount column as System.Decimal, format as currency and sort but it is still sorting as a string (the native type in ArrayList).

EDIT: Over the course of a day I've done better troubleshooting and found that I expected the grid to convert values to the specific DataType. In my case, all JSON deserialized types were System.String. I now convert from IList to DataTable and change the DataType of the Amount column before populated. This works and sorts correctly now. Hope that helps someone.
Veli
Telerik team
 answered on 19 Mar 2011
3 answers
113 views
I am attempting to use a checkbox in a grid. I know there are many posts on this tompic but I just can't seem to get the checked values to work for me.

Here is my code:

   Protected Sub btn_ModifyPerms_Click(sender As Object, e As System.EventArgs)
  
        For Each grdItem As GridDataItem In rgd_TaskPermissions.Items
            Dim cbx_Select As CheckBox = DirectCast(grdItem.FindControl("cbx_Select"), CheckBox)
            'Do Something   
            If cbx_Select.Checked = False Then
                Session("PermSelect") = 0
            Else
                Session("PermSelect") = 1
            End If
  
            Dim DatabaseName As String = Session("DBName")
            Dim Table As String = Session("Table")
            Dim TaskRole As String = Session("TaskRole")
  
            Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
            Dim command = New SqlCommand("aa_task_table_permissions_select", connectionString)
  
            command.CommandType = CommandType.StoredProcedure
  
            command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName
            command.Parameters.Add("@Table", SqlDbType.VarChar).Value = Table
            command.Parameters.Add("@TaskRole", SqlDbType.VarChar).Value = Session("TaskRole")
            command.Parameters.Add("@PermSelect", SqlDbType.Int).Value = Session("PermSelect")
  
            command.Connection.Open()
            command.ExecuteNonQuery()
            command.Connection.Close()
  
  
  
        Next
  
End Sub


The goal is for me to pass either a 1 or a 0 to a SQL Stored Procedure. I just can't seem to pass the correct parameter. I am not set on using a Session Variable. Any way I can get the 0 or the 1 to the @PermSelect variable is good by me.
Martin
Telerik team
 answered on 19 Mar 2011
2 answers
101 views
Hi
I want change font of

AddNewRecordText for my grid
what do?

Salman
Top achievements
Rank 1
 answered on 19 Mar 2011
3 answers
229 views
I'm following the examples to perform a batch update in a radgrid.

However, the HashTable contains the old value for the RadNumericTextBox. I want whatever the user has just typed in. I have some client-side script that format the numbers.

How can I get the most recent value that the user typed in as the qty value?

Here's the template column markup:

<telerik:GridTemplateColumn DataField="Qty" DataType="System.Decimal" HeaderText="Qty"
    SortExpression="Qty" UniqueName="Qty">
    <EditItemTemplate>
        <telerik:RadNumericTextBox Width="40px" MinValue="0" MaxValue="9999999.99" Type="Number"
            ID="QtyTextBox" Text='<%# Bind("Qty") %>' InvalidStyleDuration="1000" NumberFormat-DecimalDigits="2"
            runat="server" MaxLength="20">
            <ClientEvents OnLoad="RemoveZeros" OnBlur="RemoveZeros" OnValueChanged="RemoveZeros" />
        </telerik:RadNumericTextBox>
        <asp:RangeValidator ID="rngQty" runat="server" ControlToValidate="QtyTextBox" ErrorMessage="<br />Must be a number"
            Display="Dynamic" MinimumValue="0" MaximumValue="999999999" Type="Double"></asp:RangeValidator>
        <asp:RequiredFieldValidator ID="reqQty" ControlToValidate="QtyTextBox" runat="server"
            Display="Dynamic" ErrorMessage="<br />A quantity is required."></asp:RequiredFieldValidator>
    </EditItemTemplate>
    <ItemTemplate>
        <asp:Label ID="QtyLabel" runat="server" Text='<%# FormatDecimalWithoutUnusedDecimals( Eval("Qty")) %>'></asp:Label>
    </ItemTemplate>
    <ItemStyle Width="55px" />
    <HeaderStyle Width="55px" />
    <FooterStyle HorizontalAlign="Right" />
    <FooterTemplate>
    </FooterTemplate>
</telerik:GridTemplateColumn>

Here's the code:

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, _
              ByVal e As Telerik.Web.UI.GridCommandEventArgs) _
              Handles RadGrid1.ItemCommand
    Dim newValues As New Hashtable
    If e.CommandName = "UpdateAll" Then
        UpdateShipment(Nothing, Nothing)
        For Each editedItem As GridEditableItem In RadGrid1.EditItems
            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)
            Dim QtyTextBox As RadNumericTextBox
            QtyTextBox = CType(editedItem("Qty").FindControl("QtyTextBox"), RadNumericTextBox)
            UpdateRowValue(newValues)
        Next
        RadGrid1.EditIndexes.Clear()
        RadGrid1.Rebind()
    End If
End Sub

Here's the Javascript:

function RemoveZeros(sender, args) {
    var tbValue = sender._textBoxElement.value;
    if (tbValue.indexOf(".00") != -1)
        sender._textBoxElement.value = tbValue.substr(0, tbValue.indexOf(".00"));
}
Veli
Telerik team
 answered on 19 Mar 2011
8 answers
1.0K+ views
I use the RadMenu and it works fine on my pc. When I move the project to the web server, I get the following error:


Could not load file or assembly 'Telerik.Web.Design, Version=2010.1.309.35,Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies.The system cannot find the file specified

What am I missing? 

Appreciate your help
Le Duc Hieu
Top achievements
Rank 2
 answered on 19 Mar 2011
2 answers
73 views
hi,

i am using a RadEditor in a Multipage with Tab control, located in a radwindow.
in IE8 there is a strange behaviour, that when you are typing, the cursor jumps to the first position of the editor and no text is displayed. when you switch to another tab, after switching back to the editor, the typed text is displayed.
it works properly in compatibility mode and in firefox.
there is a workaround, using a

<

 

meta http-equiv="X-UA-Compatible" content="IE=7" />  tag on the page, but thats not really an acceptable solution.

thanks for any suggestions.

peter

 

Carrie
Top achievements
Rank 1
 answered on 18 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?