Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
150 views
I am trying to validate the input of a military time.  However, it always rejects whatever I enter for the time in the RadDateInput field, but the validation works just fine in a textbox.  My test code looks like:

Time: 
  <telerik:RadDateInput ID="RadDateInput1" runat="server" DateFormat="HH:mm" Width="50" /> 
  <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
    ErrorMessage="Invalid Time" ControlToValidate="RadDateInput1" Display="Dynamic" 
    ValidationExpression="(([01][0-9])|(2[0-3])):[0-5][0-9]" SetFocusOnError="true" /> 
  <br /> 
Time2: 
  <asp:TextBox ID="txtTime" runat="server" Width="50" />     
  <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
    ErrorMessage="Invalid Time2" ControlToValidate="txtTime" Display="Dynamic" 
    ValidationExpression="(([01][0-9])|(2[0-3])):[0-5][0-9]" SetFocusOnError="true" /> 
  <br />
<asp:Button ID="btnSubmit" runat="server" CausesValidation="true" Text="Submit" />

Can someone please tell me what I am doing wrong?

Many thanks!
Dimo
Telerik team
 answered on 28 Oct 2010
1 answer
165 views

Hello Telerik Team,

I have a requirement for the rad grid to export the results shown in the rad grid dynamically.
I have put this rad grid inside a user control and user control is inside the sharepoint webpart.
I have ajaxified this webpart.
I saw some blogs where it says you cant get the export functionality work if you have ajax.
I have gone through http://www.telerik.com/community/code-library/aspnet-ajax/general/export-radgrid-content-to-excel-word-csv-pdf-with-ajax-enabled.aspx
also..but it would be really helpful if you can send out a sample for ajaxified webpart to use export.
i appreciate your help and support.

Thank you,
Smith

Dimo
Telerik team
 answered on 28 Oct 2010
3 answers
204 views
Hi,

I have a RadGrid inside a RadListView (which has a page size of 1), the problem I'm having is that my RadGrid_OnNeedDataSource gets called before my RadListView_OnNeedDataSource. This is problematic because the data I need to populate my RadGrid with is dependent on the
RadListView's new DataKey: ideally in RadGrid_OnNeedDataSource I'd get the NEW DataKeyValue of the RadListView and use that to
call a stored procedure in the database.

If I try to get the RadListView's current item's datakey in RadGrid_OnNeedDataSource I always get the old RadListView item's datakey (i.e. not the one I just selected).

Is there an easy work around for this?

Regards,
-Carlo
Nikolay Rusev
Telerik team
 answered on 28 Oct 2010
3 answers
196 views
Hello,
How can I scroll automatically horizontal by script? I save the RadGrid1.GridDataDiv object status before the RadGrid change:
<script type="text/javascript">
    var usersmatrix1scrollArea;
  
    function OnClientScript(args) {
        var RadGrid1 = $find("<%= RadGrid1.ClientID %>");
        usersmatrix1scrollArea = RadGrid1.GridDataDiv;
    }
  
    function GridCreated() {
        var RadGrid1 = $find("<%= RadGrid1.ClientID %>");
        var scrollArea = RadGrid1.GridDataDiv;
  
        if (usersmatrix1scrollArea != null) {
            scrollArea = usersmatrix1scrollArea; 
        }
    }
</script>
This works only vertically, no horizontal. How can I scroll to the correct Item horizontal?

Reiner
Dimo
Telerik team
 answered on 28 Oct 2010
1 answer
101 views
Hello!

I need to create chart prommatically with next cridentials:
 - Bar type
 - XAxis values type should be string
 - Zoom and scroll functionality should be present on both axes
In general, my chart should be like chart in attachment.

Could You help me, please?

Thanks,
Volodya.
Volodya Bychko
Top achievements
Rank 1
 answered on 28 Oct 2010
3 answers
256 views
Hi,

I am using a RadComboBox in an EditItemTemplate of a GridTemplateColumn (in a Detail Table). How do I wire it to use the ItemsRequested event? I have tried wiring it in the RadGrid ItemDataBound event but the ItemsRequested event is never fired. I have set the  EnableLoadOnDemand property to true. I am using RadGrid 5.1.1.0 .

Regards,

James


RadComboBox combo2 = (RadComboBox)e.Item.FindControl("RadComboBox2");
            combo2.ItemsRequested += this.list_ItemsRequested;

RadComboBox combo2 = (RadComboBox)e.Item.FindControl("RadComboBox2");
            combo2.ItemsRequested += this.list_ItemsRequested;


                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="RadComboBox2" AppendDataBoundItems="true" Height="200px" runat="server" Skin="WebBlue"  
                                    DataTextField="Temp" DropDownWidth="400px" DataValueField="Code" AllowCustomText="true" MarkFirstMatch="false" 
                                    SelectedValue='<%# Bind("SAPCode")%>' Sort="Ascending" Filter="Contains" HighlightTemplatedItems="True" EnableLoadOnDemand="true">   

<EditItemTemplate> 
                                <telerik:RadComboBox ID="RadComboBox2" AppendDataBoundItems="true" Height="200px" runat="server" Skin="WebBlue"  
                                    DataTextField="Temp" DropDownWidth="400px" DataValueField="Code" AllowCustomText="true" MarkFirstMatch="false" 


  <telerik:GridTemplateColumn HeaderText="SAP Code" UniqueName="SAPCode">  
                          <HeaderTemplate> 
                                        <table style="font-size:11px"> 
                                            <tr> 
                                                <td style="width: 100px;">Code</td> 
                                                <td style="width: 200px;">Info</td> 
                                            </tr> 
                                        </table> 
                            </HeaderTemplate>
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="RadComboBox2" AppendDataBoundItems="true" Height="200px" runat="server" Skin="WebBlue"  
                                    DataTextField="Temp" DropDownWidth="400px" DataValueField="Code" AllowCustomText="true" MarkFirstMatch="false" 
                                    SelectedValue='<%# Bind("SAPCode")%>' Sort="Ascending" Filter="Contains" HighlightTemplatedItems="True" EnableLoadOnDemand="true">   
Princy
Top achievements
Rank 2
 answered on 28 Oct 2010
2 answers
123 views
I have a page with with various input fields and  3 RadComboBox's. They are pre-populated with data  in the .cs code page

I want to modify the page so that when the user changes the first RadComboBox, the other 2 are updated based on the selection made in the first.   Any help.

.aspx.ca  code

//Page event, raised on page load
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {  
     //Code pre-populated here. no problems.
}


.aspx page code

<tr runat="server" id="Tr1">
            <td style="width: 120px;">Your PI/Approver
                <asp:CompareValidator ID="piCompareValidator" runat="server" Text="*" ControlToValidate="piRadComboBox1" ValueToCompare="Select One..." Operator="NotEqual" ErrorMessage="Please select your P.I. in the 'Order Preferences' section"></asp:CompareValidator>
            </td>
            <td>
                <telerik:RadComboBox ID="piRadComboBox1" Skin="Gray" Height="300px"
                    Width="202px" DataTextField="ListName" DataValueField="UserName" AppendDataBoundItems="true" EnableTextSelection="false" runat="server">
                    <items>
                        <telerik:RadComboBoxItem Text="Select One..." Value="Select One..." />
                    </items>
                </telerik:RadComboBox>
                 <a href="#" rel="1" title="This order requires multiple approvers, add another." class="bdrLink jAdd">+ Add another PI/Approver</a> </td>
    </tr>
    <tr runat="server" id="Tr2">
            <td>Your Approver</td>
            <td>
                <telerik:RadComboBox ID="piRadComboBox2" Skin="Gray" Height="300px" Width="202px" DataTextField="ListName" DataValueField="UserName" AppendDataBoundItems="true" EnableTextSelection="false" runat="server">
                    <items>
                        <telerik:RadComboBoxItem Text="Select One..." Value="Select One..." />
                    </items>
                </telerik:RadComboBox>
 
                 <a href="#" rel="2" class="jRemove bdrLink">Remove</a> </td>
    </tr>
        <tr class="alt">
            <td style="width: 120px;">Your Purchaser </td>
            <td>
                <telerik:RadComboBox ID="purchaserRadComboBox" Skin="Gray" Width="202px" DataTextField="ListName" DataValueField="UserName" AppendDataBoundItems="true" EnableTextSelection="false" runat="server">
                    <items>
                        <telerik:RadComboBoxItem Text="Select One..." Value="Select One..." />
                    </items>
                </telerik:RadComboBox>
                <asp:CompareValidator ID="purchaserCompareValidator" runat="server" Text="*" ControlToValidate="purchaserRadComboBox" ValueToCompare="Select One..." Operator="NotEqual" ErrorMessage="Please select your purchaser in the 'Order Preferences' section"></asp:CompareValidator>
            </td>
        </tr>


Yana
Telerik team
 answered on 28 Oct 2010
2 answers
149 views
Hi,
In Radgrid  have onRowDatabound like feature.
actually i want to make a calculation inside gridview with two column and output should come in third column.
and here i also want to use javascript/jquery.
if there are any sample or demo please let me know..


sorry for inconvenience my subject line is below there are typing mistake in my subjec line. 

calculate total=quantity*price



thanks
Shivesh
shivesh
Top achievements
Rank 1
 answered on 28 Oct 2010
1 answer
63 views


the control
<telerik:RadComboBox ID="RadComboBox3" runat="server" Width="500px" Height="150px" Skin="Hay"
                OnClientSelectedIndexChanged="catchSelected" ChangeTextOnKeyBoardNavigation="false"
                Filter="Contains" EnableAutomaticLoadOnDemand="true"
                EmptyMessage="Chose a product.." ShowMoreResultsBox="true" ItemsPerRequest="10" ExpandAnimation-Type="InQuad"
                EnableVirtualScrolling="true">
                <WebServiceSettings Method="GetProductNames" Path="Products.asmx" />
            </telerik:RadComboBox>

and the client function:
function catchSelected(sender, evntArgs) 
        {
            var cmb = $telerik.findComboBox('RadComboBox3');
            var chosen = cmb.get_selectedItem();
            if (chosen) {
                alert(chosen.get_text());
            }
        }


The problem:
i can not determine the selected item if user presses "enter key" on an item, instead of clicking the mouse on that item.
because when ChangeTextOnKeyBoardNavigation is false, Combobox does not change the input box.

do you know how can i find the selected item on pressing the enter key when ChangeTextOnKeyBoardNavigation is false ? 
Yana
Telerik team
 answered on 28 Oct 2010
1 answer
158 views
Im using  a FormTemplate like this

<EditFormSettings EditFormType="Template">
         <FormTemplate>
                    Codigo:
                    <asp:TextBox Width="135" ID="CodigoTextBox" runat="server" Text='<%# Bind("Codigo") %>'>
                    </asp:TextBox>
                    Ordem<asp:TextBox ID="OrdemTextBox" runat="server" Text='<%# Bind("Ordem") %>'>
                    </asp:TextBox>

                    <asp:ImageButton ID="objImaInserir" runat="server" ImageUrl="~/Images/InserirEditar.gif"
                         Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' CommandName='<%#        (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />

                       <asp:ImageButton ID="objBtnCancel" CausesValidation="False" runat="server" ImageUrl="~/Images/Cancel.gif" Text="Cancel" CommandName="Cancel" />
                </FormTemplate>
 </EditFormSettings>


The field Ordem is a nullable  integer, is not required, so when i dont fill the text box
i get this error.
Failed to set one or more properties on type ERC.DAL.Objecto.   is not a valid value for Int32.

Im using automatic updates and inserts.
If i put the text box in a GridTemplateColumn
like this
  <telerik:GridTemplateColumn DataField="Ordem" HeaderText="Ordem" SortExpression="Ordem"
                    UniqueName="Ordem">
                    <EditItemTemplate>
                        <asp:TextBox ID="OrdemTextBox" runat="server" Text='<%# Bind("Ordem") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="OrdemLabel" runat="server" Text='<%# Eval("Ordem") %>'></asp:Label>
                    </ItemTemplate>
  </telerik:GridTemplateColumn>

  i dont get this error anymore
 
 
Veli
Telerik team
 answered on 28 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?