Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
234 views
Is it possible to have the label ( "enter code here" )positioned above the text box?
Shinu
Top achievements
Rank 2
 answered on 17 Jul 2013
2 answers
231 views
I'm having a problem with RadGrid's page size dropdown being disabled after databinding. I'm using Telerik RadControls AJAX version 2013.1.514.45.

The scenario is as follows:-

The page contains :
1. RadAjaxManager and EnableAJAX=true
2. CustomValidator
3. RadWindow

So far, if I remove any one of the above, the problem disappears. In addition, if the RadGrid is bound when the page loads, the dropdown works too. But I'm binding it on button click (postback).

MasterPage:
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Main.master.vb" Inherits="RadGridProblem.Main" %>
 
<!DOCTYPE html>
<head runat="server">
    <title></title>
 
    <script src="Scripts/jquery-1.9.1.min.js"></script>
 
         
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" AsyncPostBackTimeout="1800" EnableEmbeddedjQuery="false">
        </telerik:RadScriptManager>
 
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </form>
</body>
</html>

The Test page:
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Main.Master"
    CodeBehind="Search3.aspx.vb" Inherits="RadGridProblem.GuestSearch3" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cmdSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlContent" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdKembali">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlContent" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgKonkordan">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgKonkordan" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <asp:Panel ID="pnlContent" runat="server">
 
        <asp:Panel ID="pnlForm" runat="server" DefaultButton="cmdSearch">
            <table class="Standard">
                <tr>
                    <td style="padding-top: 15px;">
                        Kata
                    </td>
                    <td>
                        <asp:TextBox ID="txtKata" runat="server" Width="200px" />
                        <asp:Button ID="cmdSearch" runat="server" Text="Cari" />
                        <asp:CustomValidator ID="cvSearchStr" runat="server" ControlToValidate="txtKata">
                        </asp:CustomValidator>
                    </td>
                </tr>
            </table>
            <hr />
        </asp:Panel>
 
        <asp:Panel ID="pnlResult" runat="server">
            <asp:Button ID="cmdKembali" runat="server" Text="Kembali" />
 
            <telerik:RadGrid ID="rgKonkordan" runat="server" AutoGenerateColumns="False" AllowPaging="True">
                <MasterTableView>
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="Kata">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:HyperLink ID="lnkKata" runat="server" ForeColor="RoyalBlue" NavigateUrl="#" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </asp:Panel>
 
    </asp:Panel>
 
    <telerik:RadWindow ID="rwAsyncProcessWindow" runat="server" ShowContentDuringLoad="false" Width="500px"
        Height="400px" Behaviors="None" Modal="true" VisibleStatusbar="false" VisibleTitlebar="false">
    </telerik:RadWindow>
 
    <script type="text/javascript">
        function validateSearchStr(source, args) {
            args.IsValid = true;
        }
 
    </script>
 
</asp:Content>

Test page code behind:
Imports Telerik.Web.UI
 
Partial Public Class GuestSearch3
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            pnlResult.Visible = False
        End If
    End Sub
 
    Private Sub cmdSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
 
        rgKonkordan.CurrentPageIndex = 0
        rgKonkordan.Rebind()
 
        pnlForm.Visible = False
        pnlResult.Visible = True
 
    End Sub
 
    Private Sub RadGrid1_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgKonkordan.NeedDataSource
        Dim d As New List(Of Integer)
 
        For i As Integer = 1 To 100
            d.Add(i)
        Next
 
        rgKonkordan.DataSource = d
    End Sub
 
    Private Sub rgKonkordan_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgKonkordan.ItemDataBound
        If TypeOf e.Item Is GridDataItem Then
            Dim itm As GridDataItem = CType(e.Item, GridDataItem)
 
            Dim lnkKata As HyperLink = CType(itm.FindControl("lnkKata"), HyperLink)
            lnkKata.Text = "kata"
            lnkKata.Attributes.Add("onclick", String.Concat("viewKata('", 1 & "', '" & 1000 & "'); return false;"))
 
        End If
    End Sub
 
    Private Sub cmdKembali_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdKembali.Click
        pnlForm.Visible = True
        pnlResult.Visible = False
    End Sub
 
End Class

Checking on the console, JS errors were thrown as shown in the attachment.

Please respond on how to solve this. Thanks.


Razak
Top achievements
Rank 2
 answered on 17 Jul 2013
3 answers
530 views
Hi there,

I met a problem when I'm using the RadGrid control.

I need select a text from a cell via mouse selection and copy it to clipboard via press ctl + c.  (A very common mouse selection)

However, after I clicked a cell, a entire row is selected, I am not able to select the text from the cell I clicked.
<ClientSettings AllowColumnsReorder="False" ReorderColumnsOnClient="False">
             <!-- Cell Text can be selected by mouse and copy to clipboard after I remove this row. -->
            <Selecting AllowRowSelect="True" CellSelectionMode="SingleCell" />
</ClientSettings>

I tried to remove AllowRowSelection = "True", the problem sloved. But I have to keep it.

Does anyone meet the same problem?

Thanks.

Jeremiah
Top achievements
Rank 1
 answered on 17 Jul 2013
0 answers
84 views
I'm using asp.net model binding and for the select method returning an IQueryable, when I sort a column and then change the grid's page, the content remains the same, How can I solve this problem?
David
Top achievements
Rank 1
 asked on 16 Jul 2013
1 answer
79 views
When I use the RadEditor's Image Dialog control to insert an image I can specify a size for the image to display which generates the following HTML:

<img src="picture.jpg" height="250" width="250" />


As with other editing tools, this can't resize the image itself and instead just tells the browser to restrict the size accordingly even though it downloads the whole image - this is expected and not an issue. The only thing I'm curious is if it's possible to somehow make the dialog return HTML for that image that looks like this:

<img src="picture.jpg?height=250&width=250" height="250" width="250" />


I can then put an HTTP Handler in the directory where images are served up that automatically resizes images on the fly to take the static file, read the query string's height/width values and send back an image in that size. 

Is something like this possible?
digitall
Top achievements
Rank 1
 answered on 16 Jul 2013
1 answer
106 views
Hello,

using RadToolBar that has RadToolBarButtons for Undo, delete, copy, and proint and if click a button, it shows popup confirm window with Ok and Cancel button in it. the popup radwindow display text correctly but buttons are not clickable at the first in Chrome Browse. Close the popup window and click the same then buttons, ok and cancel, become clickable and functioning. it is working correctly in IE and Firefox browses. Chrome version is Version 28.0.1500.72.

Thanks in advance

HelloWorld
Top achievements
Rank 1
 answered on 16 Jul 2013
11 answers
397 views
I am creating a grid dynamically and setting client events in code behind. If I freeze any columns the OnScroll client event does not fire for horizontal scroll. It continues to fire for vertical but not horizontal.  Is this a bug? As soon as I comment out line three the event fires.

currentGrid.ClientSettings.ClientEvents.OnScroll =

"Scroll";

 

currentGrid.ClientSettings.Scrolling.UseStaticHeaders =

 

true;

 

currentGrid.ClientSettings.Scrolling.FrozenColumnsCount = 2;

Thanks,
Sean

 

Rob
Top achievements
Rank 1
 answered on 16 Jul 2013
2 answers
78 views
Is there a good documentation explain how controls are nested and how to find/access the controls in code behind? I have controls within radgrid, mastertable, etc. burying or nested in so many layers that I don't know how to get a handle to the controls. When the controls are outside those layers, it is so easy to access them by Label1.Text without having to findcontrol().
Lisa
Top achievements
Rank 1
 answered on 16 Jul 2013
3 answers
187 views
I am trying to use the example that I saw on this forum to get value from a dropdown list as my additional field, however, I am not showing the drop down list.

Here is the modified javascript code:

function onClientFileUploaded(radAsyncUpload, args) {
     var row = args.get_row(),
          inputName = radAsyncUpload.getAdditionalFieldID("objName"),
          inputID = inputName,
          input = createSelect(inputID, inputName),
          label = createLabel(inputID),
          br = document.createElement( "br" );
  
     row.appendChild( br );
     row.appendChild( label );
     row.appendChild( input );
}
 
function createSelect(inputID, inputName)
{
    var input = "<select id='" + inputID + "' name='" + inputName + "'><option value='Volvo'>Volvo</option><option value='Ford'>Ford</option><option value='SAAB'>SAAB</option><option value='Toyota'>Toyota</option><option value='BMW'>BMW</option><option value='OTHERS'>OTHERS</option></select>";
    return input;
}
 
  
function createLabel(forArrt) {
     var label = document.createElement( "label" );
  
     label.setAttribute( "for", forArrt );
     label.innerHTML = "Select a value: ";
  
     return label;
}

Please tell me what I am doing wrong as I am not very good at javascript. Besides, how do I get the value into a variable so I can get this over to the database.

Any assistance will be appreciated.

Thank you guys.
Abdul
Top achievements
Rank 1
 answered on 16 Jul 2013
3 answers
827 views
Following is my grid which has autogenerated column to true. I have created two new columns Add Comments and Add Documents.

I want to capture onClick event for these two hyperlink. How can I do that ?

I have tried with <ItemTemplate> and <asp:Hyperlink> but in that case I am loosing all my auto generated column, Please help


'<telerik:RadGrid ID="gvInvoice" Width="98%" AllowPaging="true" AllowSorting="true" PageSize="100"
                                    runat="server" AutoGenerateColumns="true" CellSpacing="0" GridLines="None" Skin="Office2010Blue"
                                    OnPageIndexChanged="gvInvoice_PageIndexChanged"
                                    OnItemDataBound="gvInvoice_ItemDataBound"
                                    OnSortCommand="gvInvoice_SortCommand" 
                                    ShowFooter="True" Height="100%">
                                    <MasterTableView>
                                        <Columns>
                                          <telerik:GridHyperLinkColumn Text="Add Comments" UniqueName="Comments"  HeaderStyle-Width="120px" HeaderText="Comments" NavigateUrl="#"></telerik:GridHyperLinkColumn>
                                          <telerik:GridHyperLinkColumn Text="Add Documents" UniqueName="Documents" HeaderStyle-Width="120px" HeaderText="Document" NavigateUrl="#"></telerik:GridHyperLinkColumn>
                                        </Columns>
                                    </MasterTableView>
                                   
                                    <PagerStyle Mode="NextPrevAndNumeric" />
                                    <ClientSettings>
                                    <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" /></ClientSettings>
                                </telerik:RadGrid>'


Any suggestion ?
Andrey
Telerik team
 answered on 16 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?