Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
61 views

Hello everyone,

I am trying to accept users' credit card number into 4 maskedtextboxes. When user completes every four digit in the box, I shift the focus to the next text box.

For that reason I tried to check the carret position whenever user presses a key. But unfortunately everytime the carretPosition results with 0.

Is there any work around or is it natural for carretPosition to be 0 in keypressed event on client side?

You can find the code below :

 <script type="text/javascript">

               function goNextCreditCardTextBox(sender, args) {
            
                if (args._keyCode > 47 && args._keyCode < 58) {
                   alert(  $find(sender._clientID).get_carretPosition());
                }
            }
   </script>



<telerik:RadMaskedTextBox ID="creditCardNumberTextBox1" runat="server" Mask="####"  Width="27">
          <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
</telerik:RadMaskedTextBox>
<telerik:RadMaskedTextBox ID="creditCardNumberTextBox2" runat="server" Mask="####"  Width="27">
          <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
</telerik:RadMaskedTextBox>

<telerik:RadMaskedTextBox ID="creditCardNumberTextBox3" runat="server" Mask="####"  Width="27">
          <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
</telerik:RadMaskedTextBox>
<telerik:RadMaskedTextBox ID="creditCardNumberTextBox4" runat="server" Mask="####"  Width="27">
          <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
</telerik:RadMaskedTextBox>

Tsvetoslav
Telerik team
 answered on 07 Jul 2009
1 answer
68 views
Go to the online demo: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/slider/defaultcs.aspx and choose Advanced-style Pager "NextPrevNumericAndAdvanced", page through the grid and you will see the behavior (may need to page more than once to see it). Tested on IE6 only.
This happens with different skins.
Pavlina
Telerik team
 answered on 07 Jul 2009
1 answer
127 views
hi
i want to open a radAlert popup with animaiton
for that....
i hav done...

java script!

function

 

Button1_onclick() {

 

radalert(

"as",300,100,"rock");



 

<

 

telerik:RadWindowManager ID="RadWindowManager1" runat="server" Animation="Resize"> </telerik:RadWindowManager>

THE PROBLEM!!!

when i click the button which brings the alert the animation starts at the left-top position on the page and after the animation is done the alert comes jumps in the center....
plz help

 

Georgi Tunev
Telerik team
 answered on 07 Jul 2009
17 answers
489 views
I've seen this posting a few times in the forums, but no clear answer.

We recently upgraded from 2008.Q1 to 2008.Q2.  After upgrading, we are getting an error that is somewhat predictable.  When the error occurs, the exception is raised within the DataBind() event for the RadComboBox.  In order to make sure the data coming from the stored procedure was not causing the problem, we overwrote the stored proc to return a static set of data.   Considering I have seen other cases reported in the forums for previous versions of this control having the same issue, it looks like your previous fix may have been broken with this most recent release.

Here is the code to populate the combobox - we use almost identical code everywhere we populate the combobox:

                //populate parent categories  
                rcbParentCategory.DataSource = ourDB.Category_GetAvailableParents(CurrentCategoryId);  
                rcbParentCategory.DataValueField = "CategoryId";  
                rcbParentCategory.DataTextField = "CategoryName";  
                rcbParentCategory.ClearSelection();  
                rcbParentCategory.DataBind();  
                rcbParentCategory.Items.Insert(0, new RadComboBoxItem("None Selected", "-1"));  
                rcbParentCategory.SelectedValue =  
                    ((rcbParentCategory.Items.FindItemByValue(category.ParentId.ToString()) != null) ? category.ParentId.ToString() : "-1");  
                rcbParentCategory.DataSource = null

I added the ClearSelection call in line 5 after reading a forum entry, but it does not solve the problem.

In case this information is important... we are using DotNetNuke 4.8.3 and the module in which this code exists is using partial page rendering.  In this situation, the user is selecting a row from a grid and then clicking a button called "edit".  This causes the panel with the grid to dissappear and then a panel with the RadComboBox is made visible, during this button click event is where the combobox population code shown above is called.  The predictability of the error is in that I can select an item, click edit, return (hide panel with combo and make grid panel visible again), select another item, click edit, return, click the original item, click edit...kaboom.  It would not be easy to send a project that isolates the error for you.  The DNN module we have in this case is fairly straightforward, though.  There is nothing fancy happenning, just what I mentioned when the edit button is clicked.

We really need this resolved immediately as we have a major deliverable for a client.  Please advise.

Thanks!

Michael
Simon
Telerik team
 answered on 07 Jul 2009
1 answer
159 views
I have a grid where I allow column resizing by default, have fixed widths for some columns, specifically disallow column resizing for those columns, yet when other (resizable) columns are resized, those fixed columns change size too. How can I get some of my columns to never resize...!

Here's an example of my markup. Specifically, notice my two command columns which happen to be the first and last columns in the grid - the GridEditCommandColumn and the GridButtonColumn which both have Resizable="false". It is especially a problem for the last column in the grid, the GridButtonColumn. The Resizable="false" prevents the right column border from being moved, but if the one to the left, which belongs to a column which can be resized is moved (LoanBalance), it will  change the size of the button column.

Is this a bug?
Thanks, Steve

<telerik:RadGrid ID="rgLiens" runat="server" EnableEmbeddedSkins="false" Skin="RealMax" 
        OnNeedDataSource="rgLiens_NeedDataSource" OnItemCreated="rgLiens_ItemCreated"  
        ondeletecommand="rgLiens_DeleteCommand" oninsertcommand="rgLiens_InsertCommand"  
        onupdatecommand="rgLiens_UpdateCommand" OnPreRender="rgLiens_PreRender" OnItemDataBound="rgLiens_ItemDataBound" 
        OnRowDrop="rgLiens_RowDrop" GridLines="None" ShowFooter="True" > 
    <ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true"
        <ClientEvents OnRowMouseOut="rowMouseOut" OnRowMouseOver="rowMouseOver" OnPopUpShowing="PopUpCentered" /> 
        <Selecting AllowRowSelect="true" /> 
        <Resizing AllowColumnResize="True" /> 
    </ClientSettings> 
        <FilterMenu EnableTheming="True"
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
    </FilterMenu> 
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" EditMode="EditForms" TableLayout="auto" 
            DataKeyNames="LienId,LienIndex,PropertyId">         
      <NoRecordsTemplate><div style="margin:6px">No liens recorded for this property</div></NoRecordsTemplate>        
      <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="false" /> 
      <ItemStyle CssClass="RowMouseOut" /> 
      <AlternatingItemStyle CssClass="RowMouseOut" /> 
      <RowIndicatorColumn HeaderStyle-Width="20px" /> 
      <ExpandCollapseColumn HeaderStyle-Width="20px" /> 
       
      <Columns> 
        <telerik:GridEditCommandColumn EditImageUrl="~/Images/Buttons/edit.gif" ButtonType="ImageButton" Resizable="false" > 
            <HeaderStyle Width="24px" /> 
            <ItemStyle CssClass="CommandColumn" /> 
        </telerik:GridEditCommandColumn> 
        <Telerik:GridBoundColumn DataField="LienIndex" DataType="System.Int16" ReadOnly="true"
            <HeaderStyle Width="20px" HorizontalAlign="Center" /> 
        </Telerik:GridBoundColumn> 
        <telerik:GridNumericColumn DataField="LoanAmount" DataType="System.Decimal" NumericType="Currency"   
            HeaderText="Loan Amount" SortExpression="LoanAmount" UniqueName="LoanAmount" Aggregate="Sum" FooterAggregateFormatString="{0:C}"
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" /> 
            <FooterStyle HorizontalAlign="Right" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridNumericColumn DataField="InterestRate" DataType="System.Decimal" NumericType="Percent"  
            HeaderText="Interest Rate" SortExpression="InterestRate" DataFormatString="{0}%" 
            UniqueName="InterestRate"
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" /> 
            <FooterStyle HorizontalAlign="Right" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridNumericColumn DataField="MonthlyPayment" DataType="System.Decimal" NumericType="Currency"  
            HeaderText="Payment" SortExpression="MonthlyPayment" UniqueName="MonthlyPayment" Aggregate="Sum" FooterAggregateFormatString="{0:C}"
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" /> 
            <FooterStyle HorizontalAlign="Right" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:$#,##0.00;($#,##0.00);#}" DataField="Arrears" DataType="System.Decimal" NumericType="Currency"  
            HeaderText="Arrears" SortExpression="Arrears" UniqueName="Arrears" ItemStyle-ForeColor="Red"
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" ForeColor="Red" /> 
            <FooterStyle HorizontalAlign="Right" ForeColor="Red" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridBoundColumn DataField="rtp_Lender.Name" DataType="System.String"  
            HeaderText="Lender" SortExpression="rtp_Lenders.Name" UniqueName="LenderName"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="LoanNumber" DataType="System.String"  
            HeaderText="Loan Number" SortExpression="LoanNumber" UniqueName="LoanNumber"
        </telerik:GridBoundColumn> 
        <telerik:GridDateTimeColumn DataField="LoanDate" DataType="System.DateTime"  
            HeaderText="Loan Date" SortExpression="LoanDate" UniqueName="LoanDate"  
            DataFormatString="{0:MM/dd/yyyy}"
        </telerik:GridDateTimeColumn> 
        <telerik:GridBoundColumn DataField="rtp_LoanType.Name" DataType="System.String" HeaderText="Loan Type" 
            SortExpression="LoanType" UniqueName="LoanType"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Term" DataType="System.Int32"  
            HeaderText="Term" SortExpression="Term" UniqueName="Term"
        </telerik:GridBoundColumn> 
        <telerik:GridNumericColumn DataField="LoanBalance" DataType="System.Decimal" NumericType="Currency"  
            HeaderText="Loan Balance" SortExpression="LoanBalance" UniqueName="LoanBalance" Aggregate="Sum" FooterAggregateFormatString="{0:C}"
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" /> 
            <FooterStyle HorizontalAlign="Right" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Resizable="false"    
            ConfirmDialogType="RadWindow" ConfirmText="Are you sure?" ConfirmTitle="Delete Lien?"  
            ImageUrl="~/Images/Buttons/delete.gif" Text="Delete" UniqueName="DeleteColumn"
            <HeaderStyle Width="24px" /> 
            <ItemStyle CssClass="CommandColumn" /> 
        </telerik:GridButtonColumn> 
    </Columns> 
 

Georgi Krustev
Telerik team
 answered on 07 Jul 2009
1 answer
127 views
Hi All,

        I want to use  Telerik's RadListbox in my application.But in the toolbar  there is no RadList box avaible . We are using the licensed version of the telerik. The version which we are uisng is 2009.1.527.35.  Is the RadListBox available in this version.
If it is available then what we need to do , so that it is avaible in the toolbar. i have even checked by right clicking  on the toolbar--> choose items, there also it is not available.

Regards
Asra
Simon
Telerik team
 answered on 07 Jul 2009
0 answers
70 views
Hi
 Can we set PDF margin in inches instead of pixels..
If so hoe can i?

Regards,
Appu


Appu
Top achievements
Rank 1
 asked on 07 Jul 2009
1 answer
93 views
I have a screen that has a parent Grid RadGrid1 which has a nested view RadGrid2, which also has a nested view RadGrid3.

When I select a record from RadGrid one it expands RadGrid2.  RadGrid2 is in a panel control and RadGrid3 is also in a panel control.  When a user selects a record from RadGrid2 it expands RadGrid3.  When I change the selection on RadGrid2 all works fine, the issue is when I change the selection on RadGrid1.  RadGrid3 remains open and will appear in the same location on RadGrid2 when it reloads.  So if RadGrid3 was displayed on the 3 record on RadGrid2 then when I change the record on Radgrid1 the new RadgRid 2 opens with the old RadGrid3 data on record 3 on RadGrid2.

I need to find a way to collapse RadGrid3 when RadGrid1 is changed.

Any idea or is this just very confusing?
Eric
Top achievements
Rank 1
 answered on 07 Jul 2009
1 answer
155 views
I have a RadListBox on a page.  Nothing special about it.  If I set the "Enabled" property to false it does not disable.  If I set the Enabled property for the panel that it is contained in to false it also does not disable.  It does not work if I set Enabled=false in the markup or the code-behind.

When I do this for the asp:ListBox, the asp:ListBox works just fine.

Is this a bug or am I just missing something really obvious?
Simon
Telerik team
 answered on 07 Jul 2009
1 answer
128 views
I use a sprite for my toolbar button images. I use the CssClass property of the buttons to specify the correct image. I get the following problem, when a splitbutton child button is selected, then the CssClass of the SplitButton is not replaced by the CssClass of the selected child button.

C# Example:

button0.CssClass = "vf vf0"

button1.CssClass = "vf vf1"
button2.CssClass = "vf vf2"
button3.CssClass = "vf vf3"
...

CSS Example:

 

.vf

 

.rtbIcon

 

 

 

 

{

 

height: 32px;

 

 

width: 32px;

 

 

background-image: url(sprite.png)
background-repeat
: no-repeat;

 

}

 

 

.vf0

 

.rtbIcon { background-position : 0 0px; }

 

 

 

.vf1

 

.rtbIcon { background-position : 0 -32px; }

 

 

 

.vf2

 

.rtbIcon { background-position : 0 -64px; }

 

 

 

.vf3

 

.rtbIcon { background-position : 0 -96px; }

 

 

 

Yana
Telerik team
 answered on 07 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?