Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
69 views
Hi.
I have a problem with the filter by column in my radGrid.
i put the property allowFilterByColumn in "true", but the button that i show in the imagen doesn't work.

in this image link button to which I refer:
http://www.subirimagenes.net/pictures/34004824405bf9d70279cf03f26982d9.png


thanks!!
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 Dec 2012
3 answers
113 views
Hi,

i've a web page where insert a radlistview and connect to list of object...my code is:
As you can see there is a field userid, I wish that the value of the userid is passed on the button, is this possible?

<fieldset style="float: left; width: 340px; height: 195px">
                           <legend>Category:
                               <%# CType(Container.DataItem, PropertyUtente).Category%>
                           </legend>
                           <table cellpadding="0" cellspacing="0" width="95%">
                               <tr>
                                   <td style="width: 75%;">
                                       <table cellpadding="5" cellspacing="0">
                                           <tr>
                                               <td style="width: 25%;">
                                                   Userid:
                                               </td>
                                               <td style="width: 75%; text-align:left">
                                                   <%# CType(Container.DataItem, PropertyUtente).Userid%>
                                               </td>
                                           </tr>
                                           <tr>
                                               <td style="width: 25%;">
                                                   Name:
                                               </td>
                                               <td style="width: 75%; text-align:left">
                                                   <%# CType(Container.DataItem, PropertyUtente).user%>
                                               </td>
                                           </tr>
                                           <tr>
                                               <td>
                                                   City:
                                               </td>
                                               <td style="width: 75%; text-align:left">
                                                   <%# CType(Container.DataItem, PropertyUtente).city%>
                                               </td>
                                           </tr>
                                           <tr>
                                               <td>
                                                   Phone:
                                               </td>
                                               <td style="width: 75%; text-align:left">
                                                   <%# CType(Container.DataItem, PropertyUtente).phone%>
                                               </td>
                                           </tr>
                                           <tr>
                                               <td>
                                                   Cellular:
                                               </td>
                                               <td style="width: 75%; text-align:left">
                                                   <%# CType(Container.DataItem, PropertyUtente).Cellular%>
                                               </td>
                                           </tr>
                                           <tr>
                                               <td>
                                                </td>
                                               <td style="width: 75%; text-align:left">
                                                   <asp:Button ID="Button1" runat="server" Text="Details"  />
                                               </td>
                                           </tr>
                                       </table>
                                   </td>
                                    <td style="vertical-align: top; text-align: right; width: 25%;">
                                        <asp:Image ID="Image1" runat="server" ImageUrl='<%# CType(Container.DataItem, PropertyUtente).imageprofile%>' Height="120px" Width="100px"/>
                                   </td>                            
                               </tr>
                           </table>
                       </fieldset>
Shinu
Top achievements
Rank 2
 answered on 04 Dec 2012
4 answers
60 views
When I have a <ol> list, it works fine, if I use a <ul> list inside of an <ol>, <ol> tag is replaced with <ul>. See example below

1. A
2. B
3. C
  • C1
  • C2
4. D

turns into

  • A
  • B
  • C
* C1
* C2
  • D

Any ideas?
Thanks!
Goksun
Goksun
Top achievements
Rank 1
 answered on 04 Dec 2012
1 answer
87 views
I restricted my fileexplorer to only accept images using SearchPattern property.
Is it possible that we can also control the dimension of the image file that gets uploaded? e.g. only allow people to upload image files with dimension of 500x600.

thanks in advance
Vessy
Telerik team
 answered on 04 Dec 2012
3 answers
110 views
I'm trying to do some client-side initialization that involves calling $find() on the ClientID of some RadComboBoxes.

My code is being run from an event-handler hooked to window load:

Sys.UI.DomEvent.addHandler(window, 'load',
    function()
    {
        // My initialization stuff
    }
);

When this code, $find(clientid) returns null.

If I move my initialization code to a window.setTimeout(), $find() works fine.  So clearly the only problem is that the client-side code hasn't been initialized, when the window load handler executes.

When I browse the forums, I see recommendations to put the initialization code in a pageLoad().  Given the organization of the code in this project, that's not possible. (There can only be one pageLoad() function on a page - we have separate initialization functions for multiple user controls that may be included on a single page.  We'd like to keep the initialization for each encapsulated inside the control, we don't want to pull all the initialization into a single page-level function.)

Are there any of the standard events that we can catch with Sys.UI.DomEvent to which we can add handlers that will fire after the telerik controls have been initialized?

Dathan
Top achievements
Rank 1
 answered on 03 Dec 2012
2 answers
209 views
I am trying to do Insert, Update and delete using the POP Up window. I am doing all my code (Code behind).  The question is when ever the window pops up to add or update it never closes. IT updates the database but never closes. i have press cancel in order to close it.

 <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
       
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <br />
    <div>
        <asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080"></asp:Label>
        <asp:Label ID="Label2" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000"></asp:Label>
    </div>




    <br />
    <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Vista" CssClass="RadGrid" GridLines="None"
        AllowPaging="True" PageSize="5" AllowSorting="True" AutoGenerateColumns="False"   
        ShowStatusBar="true" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
        AllowAutomaticUpdates="True" OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand" OnDeleteCommand="RadGrid1_DeleteCommand"  
        HorizontalAlign="NotSet" Width="681px">
        <MasterTableView CommandItemDisplay="TopAndBottom"
            DataKeyNames="ID" EditMode="PopUp">
            <Columns>
                <telerik:GridEditCommandColumn>
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn UniqueName="id" HeaderText="id" DataField="id">
                    <HeaderStyle Width="60px"></HeaderStyle>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Fname" HeaderText="First Name" DataField="Fname">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Lname" HeaderText="Last Name" DataField="Lname">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="City" HeaderText="City" DataField="City">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Zip" HeaderText="Zip" DataField="Zip">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="column">
                </telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit ID: {0}"
                CaptionDataField="ID" EditFormType="Template" PopUpSettings-Modal="true">
                <FormTemplate>
                    <table id="Table1" cellspacing="1" cellpadding="1" width="250" border="0">
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                First Name:
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox10" Text='<%# Bind( "Fname") %>' runat="server">
                                </asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Last Name:
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox11" Text='<%# Bind( "Lname") %>' runat="server">
                                </asp:TextBox>
                            </td>
                        </tr>
                        
                       
                        <tr>
                            <td>
                                City:
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind( "City") %>'>
                                </asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Zip:
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind( "Zip") %>'>
                                </asp:TextBox>
                            </td>
                        </tr>
                      
                    </table>
                    <table style="width: 100%">
                        <tr>
                            <td align="right" colspan="2">
                                <asp:Button ID="Button1" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                </asp:Button>&nbsp;
                                <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                                </asp:Button>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
        </ClientSettings>
    </telerik:RadGrid>


    </form>



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLayer;
using Telerik.Web.UI;

namespace Telerik
{
    public partial class Test : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = NameManager.GetList();



        }
      
    protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        //Get the primary key value using the DataKeyValue.
       string ID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID"].ToString();
        //Access the textbox from the edit form template and store the values in string variables.
        string FirstName = (editedItem.FindControl("TextBox10") as TextBox).Text;
        string LastName = (editedItem.FindControl("TextBox11") as TextBox).Text;
        string City = (editedItem.FindControl("TextBox5") as TextBox).Text;
        string Zip = (editedItem.FindControl("TextBox6") as TextBox).Text;


        var User = new Name();
        User.id = Convert.ToInt32(ID);
        User.Fname = FirstName;
        User.Lname = LastName;
        User.City = City;
        User.Zip = Zip;
        NameManager.NameUpdate(User);

        
       
    }
    protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
    {
        GridEditFormInsertItem insertedItem = (GridEditFormInsertItem)e.Item;

        //Access the textbox from the edit form template and store the values in string variables.
        string FirstName = (insertedItem.FindControl("TextBox10") as TextBox).Text;
        string LastName = (insertedItem.FindControl("TextBox11") as TextBox).Text;
        string City = (insertedItem.FindControl("TextBox5") as TextBox).Text;
        string Zip = (insertedItem.FindControl("TextBox6") as TextBox).Text;


        var User = new Name();
       // User.id = Convert.ToInt32(ID);
        User.Fname = FirstName;
        User.Lname = LastName;
        User.City = City;
        User.Zip = Zip;
        NameManager.NameInsert(User);



        
     
    }
    protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
    {
       
        }
    }
}
Rajeev
Top achievements
Rank 1
 answered on 03 Dec 2012
3 answers
162 views
We are using Telerik.Wb.UI rev 2010.2.713.20, VB.NET, and IIS 7.

Following is a "telerik:RadCaptcha" element in one of our web pages:

<telerik:RadCaptcha ID="RadCaptcha1" ImageStorageLocation="Session"
           runat="server" ErrorMessage="Page not valid. The code you entered is not valid."
           ValidationGroup="vgAudio"
           ValidatedTextBoxID="rcTextBox1"
           Display="None">
           <CaptchaImage
                EnableCaptchaAudio="true"
                RenderImageOnly="true"
                ImageCssClass="rcCaptchaImage"
                BackgroundColor="#609f0a"
                TextColor="White"
                BackgroundNoise="None" />
</telerik:RadCaptcha>

We have been noticing that each time the page is refreshed/reloaded, a Captcha Image is added to the Session using a new GUID as the key.  The problem we are running into is that the session object gets very large as crawlers load this page many many time over the life of a single session.  The Session gets so large that we have to run a scheduled task to forcefully abandon the session periodically.

We have used the "CaptchaMaxTimeout" property to set the timeout to just a couple of minutes and observe that Captcha images do not seem to be removed from the cache (Session) when the timeout period expires.

How can I prevent/limit caching of Captcha images to avoid this situation?
Slav
Telerik team
 answered on 03 Dec 2012
2 answers
125 views
I am setting a label DataFormatString for my line series and I noticed that it is not taking effect. The datasource I am providing to the chart contains a score as a double. I wanted to provide the {0:F} formatter so that I do not display unnecessarily long precision. 

With the following markup:
<LabelsAppearance DataFormatString="{0:F}">
    <TextStyle Bold="true" Color="#003366" />
</LabelsAppearance>

If the data is 56.1, the label is 56

With this markup:
<LabelsAppearance>
    <TextStyle Bold="true" Color="#003366" />
</LabelsAppearance>

If the data is 56.1, the label is 56.1

Is my data format string incorrect, or is it just not working?
DuelingCats
Top achievements
Rank 2
 answered on 03 Dec 2012
3 answers
62 views
How can I set values for two handlers in a rad slider... When I move my handlers, the respective value of my handler should be displayed.. Can anyone help me??? I do not need the tool tip sample.. I want to display in two textboxes..
Slav
Telerik team
 answered on 03 Dec 2012
3 answers
177 views
I'm trying to manually insert a row into an SQL table through the RadGrid's insert row function.  My problem is that the InsertCommand event will not fire.  Here's some code:

<telerik:RadGrid ID="grdDesc" runat="server" AutoGenerateColumns="false">
    <MasterTableView CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="Descrip"
      InsertItemPageIndexAction="ShowItemOnCurrentPage" ShowHeader="false">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="PushButton" UniqueName="Edit">
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="Descrip" UniqueName="Descrip">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Scrolling UseStaticHeaders="true" AllowScroll="true" />
    </ClientSettings>
</telerik:RadGrid>
 
<telerik:RadInputManager runat="server" ID="RadInputManager1" Enabled="true">
    <telerik:TextBoxSetting BehaviorID="TextBoxSetting1">
    </telerik:TextBoxSetting>
</telerik:RadInputManager>


Visual Basic code:
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    ...
    Dim ctxSql As LINQtoSQLDataContext = New LINQtoSQLDataContext()
 
    If chkDesc.Checked = True Then
        grdDesc.Visible = True
        Dim descrips = From c In ctxSql.COMBOBOXes Where c.fieldname = "DESCRIP" Select New With {c.descrip}
 
        grdDesc.DataSource = descrips
        grdDesc.DataBind()
    Else
        grdDesc.Visible = False
    End If
    ...
End Sub
 
 
Protected Sub grdDesc_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles grdDesc.ItemCreated
    If TypeOf e.Item Is GridEditableItem AndAlso (e.Item.IsInEditMode) Then
        Dim editableItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
 
        Dim textBox = (DirectCast(editableItem.EditManager.GetColumnEditor("Descrip"), GridTextBoxColumnEditor)).TextBoxControl
 
        textBox.ID = "TextBox1"
        Dim inputSetting As InputSetting = RadInputManager1.GetSettingByBehaviorID("TextBoxSetting1")
        inputSetting.TargetControls.Add(New TargetInput(textBox.UniqueID, True))
        inputSetting.InitializeOnClient = True
        inputSetting.Validation.IsRequired = True
    End If
End Sub
 
Protected Sub grdDesc_InsertCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles grdDesc.InsertCommand
    Dim ctxSql As LINQtoSQLDataContext = New LINQtoSQLDataContext()
 
    Dim custFileID = ctxSql.CUSTFILEs.Where(Function(c) c.CUSTNO = cboCustNew.SelectedValue).Single.CUSTFILE
 
    Dim newComboBox As COMBOBOX = New COMBOBOX()
    newComboBox.custfile = custFileID
    newComboBox.department = -1
    newComboBox.fieldname = "DESCRIP"
    newComboBox.descrip = ""
 
    ctxSql.COMBOBOXes.InsertOnSubmit(newComboBox)
End Sub

I can tell you the ItemCreated event DOES fire and runs successfully.  I just don't understand why the InsertCommand event doesn't fire.  If anybody can tell me what I'm missing, it would be appreciated.

Thanks,
Patrick
Jayesh Goyani
Top achievements
Rank 2
 answered on 03 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?