Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
118 views
Hi,
How can I localize rad Editor dialog windows (Hyper-link Manager and Find & Replace)?
I want to change labels (Target, Text, URL, Find, Next ...) to Persian.
Rumen
Telerik team
 answered on 25 Apr 2011
17 answers
600 views
Hi,

i read about the new AccessibilityMode and wonder if there is a possibility to always render a RadComboBox as a standard Dropdown, even if there is javascript enabled on browser.. Can this be done now or is in planning for future releases?

Thanks
Achim
Orin Book
Top achievements
Rank 1
 answered on 25 Apr 2011
2 answers
87 views
I have an XmlHttpPanel that is within an AjaxPanel.  The problem I'm having is the first time there is a postback, it does a full page refresh instead of a partial page refresh; it's as if the AjaxPanel isn't having an effect.  But on subsequent postbacks it does the partial page refresh the way I want it to.

Here's a more detailed description:

I have a user control, named RecordSelect.ascx, that contains an XmlHttpPanel.  It calls a web service that returns HTML.  It calls __doPostBack to post back to the web server.  Here is the markup of my user control:
 
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RecordSelect.ascx.cs" Inherits="RecordSelect" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
  
<script type="text/javascript">
    var call = 0;
    function SetValue<%=XmlHttpPanel1.ClientID %>(count) {
        var panel = $find("<%=XmlHttpPanel1.ClientID %>");
        //you can pass any kind of object to the GetHTML method
        //right now we will pass an array
        var array = [];
        if (document.getElementById('<%=txtSearchString.ClientID %>').value.length > 1 && count == call) {
            array[0] = document.getElementById('<%=txtSearchString.ClientID %>').value;
            array[1] = "<%=XmlHttpPanel1.ClientID %>";
            array[2] = document.getElementById('<%= hidANE.ClientID %>').value;
            call = 0;
            //you can pass any kind of object to the GetHTML method
            //right now we will pass an array
            panel.set_value(array);
        }
    }
  
    function GetData<%=XmlHttpPanel1.ClientID %>() {
        call++;
        setTimeout('SetValue<%=XmlHttpPanel1.ClientID %>(' + call + ')', 200);
    }
  
    function RecordClicked<%=XmlHttpPanel1.ClientID %>(Name, ID) {
        document.getElementById('<%= hidId.ClientID %>').value = ID;
        document.getElementById('<%= txtSearchString.ClientID %>').value = Name;
        var panel = $find("<%=XmlHttpPanel1.ClientID %>");
  
        // this will clear the xmlhttp panel.
        //document.getElementById('divTypeAheadOptions').parentNode.innerHTML = '';
        $find('<%= txtSearchString.ClientID %>').updateDisplayValue();
        __doPostBack('<%= cmdHid.ClientID %>','');
    }
  
    function AddNewClicked<%=XmlHttpPanel1.ClientID %>() {
        document.getElementById('<%= hidId.ClientID %>').value = -1;
        __doPostBack('<%= cmdHid.ClientID %>','');
    }
  
</script>    
  
<telerik:RadTextBox 
    ID="txtSearchString" 
    runat="server" 
    EmptyMessage="" 
    Width="300px" >
</telerik:RadTextBox>
<telerik:RadXmlHttpPanel runat="server" ID="XmlHttpPanel1" 
        WebMethodPath="~/services/TypeAhead.asmx"
        WebMethodName=""
        RenderMode="Block"
        EnableClientScriptEvaluation="true">
</telerik:RadXmlHttpPanel>
<asp:HiddenField runat="server" ID="hidId"/>
<asp:HiddenField runat="server" ID="hidANE" />
<asp:Button runat="server" ID="cmdHid" CausesValidation="false" style="display: none;"/>

And here's the parent, where the RecordSelect.ascx control is declared inside a RadAjaxPanel

<telerik:RadAjaxPanel ID="radAjaxPanel1" runat="server">
          <uc1:RecordSelect runat="server" ID="selCompany" Type="Companies" EnabledAddNew="True" />
           ...

FYI -

This control is a typeahead/autocomplete type search.

The <%=XmlHttpPanel1.ClientID %> string is appended to the javascript function names so the user control can be declared multiple times on one page.  (I'm not sure if that's the proper way to do that...but it's working.)

The purpose of the cmdHid button is to prevent the __doPostBack commands from causing client-side validation, and also to associate the postbacks with the surrounding AjaxPanel, which is working for the 2nd, 3rd, 4th, etc. postbacks.  Just not the first postback.

Any help would be much appreciated.



Mike
Top achievements
Rank 1
 answered on 25 Apr 2011
2 answers
182 views
I'm getting this error: DataSourceCount is not ready at this moment
when my RadGrid initially has more than the PageSize number of records.  My PageSize="20" so I get that runtime error if the initial databind is with more than 20 rows.

Here is the declaration of the grid:

<oscarcontrols:OscarGrid runat="server" ID="grdProcessOrders" AutoGenerateColumns="false"
                            Visible="true" PageSize="20" AllowPaging="true" ShowHeader="true" Width="100%"
                            AllowSorting="true" EnableEmbeddedSkins="false" DataKeyNames="OrdID" OnPageIndexChanged="grdProcessOrders_PageIndexChanged"
                            OnPageSizeChanged="grdProcessOrders_PageSizeChanged" OnItemCommand="grdProcessOrders_ItemCommand"
                            OnSelectedIndexChanged="grdProcessOrders_SelectedIndexChanged" OnItemDataBound="grdProcessOrders_ItemDataBound"
                            OnDataBound="grdProcessOrders_DataBound" Skin="OSCARGridStyle1" OnSortCommand="grdProcessOrders_SortCommand"
                            OnItemCreated="grdProcessOrders_ItemCreated">
                            <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="false" EnablePostBackOnRowClick="true">
                                <%--<ClientEvents OnGridCreated="ProcOrdGridCreate" /> --%>
                                <Selecting AllowRowSelect="True" />
                                <%-- <ClientEvents OnRowContextMenu="RowContextMenu" /> --%>
                            </ClientSettings>
                            <PagerStyle Position="TopAndBottom" Mode="NumericPages" Width="100%" AlwaysVisible="false" />
                            <MasterTableView OnPreRender="grdProcessOrders_PreRender" DataKeyNames="OrdID">
                                <NoRecordsTemplate>
                                    <oscarcontrols:OscarPanel runat="server" ID="pnlNoRecords" Width="100%" CssClass="procOrdersNoRecordsFound">
                                        <h2>
                                            <oscarcontrols:OscarLabel runat="server" ID="lblSorry" Text="Sorry. Try Again." /></h2>
                                        <oscarcontrols:OscarLabel runat="server" ID="lblNoRecords" Text="There were no records found that matched your search criteria." /><br />
                                        <br />
                                    </oscarcontrols:OscarPanel>
                                </NoRecordsTemplate>
                                <PagerTemplate>
                                    <table width="100%">
                                        <tr>
                                              
                                            <td style="padding-left: 5px">
                                            <oscarcontrols:OscarLabel runat="server" ID="lblResultsFoundValue" Text='<%# DataBinder.Eval(Container, "Paging.DataSourceCount")%>'
                                                    Font-Bold="true" /> 
                                                <b>
                                                    <oscarcontrols:OscarLabel runat="server" ID="lblResultsFound" Text="Results Found."
                                                        Font-Bold="true" /></b>
                                            </td>
                                            <td align="right" style="padding-right: 5px">
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <oscarcontrols:OscarLabel runat="server" ID="lblResultPerPage" Text="Results per Page:" />
                                                            <oscarcontrols:OscarComboBox ID="ProcOrdRadComboBox1" DataSource="<%# new object[]{10, 20, 30, 40, 50} %>"
                                                                SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>' Style="margin-right: 20px;"
                                                                Width="40px" runat="server" OnClientSelectedIndexChanged="ProcOrdRadComboBox1_SelectedIndexChanged">
                                                            </oscarcontrols:OscarComboBox>
                                                        </td>
                                                        <td>
                                                            <oscarcontrols:OscarImageButton ID="Button1" runat="server" ImageUrl="~/Images/PagingFirst.gif"
                                                                OnClientClick="ProcOrdchangePage('first'); return false;" CommandName="Page"
                                                                CommandArgument="First" />
                                                            <oscarcontrols:OscarImageButton ID="Button2" runat="server" ImageUrl="~/Images/PagingPrev.gif"
                                                                OnClientClick="ProcOrdchangePage('prev'); return false;" CommandName="Page" CommandArgument="Prev" />
                                                        </td>
                                                        <td>
                                                            <oscarcontrols:OscarPanel runat="server" ID="NumericPagerPlaceHolder" />
                                                        </td>
                                                        <td>
                                                            <oscarcontrols:OscarImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/PagingNext.gif"
                                                                OnClientClick="ProcOrdchangePage('next'); return false;" CommandName="Page" CommandArgument="Next" />
                                                            <oscarcontrols:OscarImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/PagingLast.gif"
                                                                OnClientClick="ProcOrdchangePage('last'); return false;" CommandName="Page" CommandArgument="Last" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </PagerTemplate>

And here's the code that does the binding:
 

 

grdProcessOrders.DataSource = GetSortedOrders(false); 
grdProcessOrders.DataBind(); 

 

 

 


This code is called within the Page_Load event of my aspx page.


Mike
Top achievements
Rank 1
 answered on 25 Apr 2011
1 answer
80 views
How would I make Editor,- Hyperlink Manager that makes Links opening in a RadWindow. And what is link manager search pane or media pane. Could you add a pane called search or media as a target. Tried custom target of openRadWin or different variations.

Rumen
Telerik team
 answered on 25 Apr 2011
2 answers
107 views
In the following code, grdInProcesDetails is a child grid of  "grdInProces" parent grid, After doing the pagination of "grdInProces" grid,
in grdInProcesDetails_ItemCreated - parentItem.ChildItem is getting null, by which i am unable to find the childItem controls to add some attributes .... How do i find the child item controls  here in this case.
  protected void grdInProcesDetails_ItemCreated(object sender, GridItemEventArgs e)
        {
             if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                GridDataItem parentItem = ((sender as RadGrid).NamingContainer as GridNestedViewItem).ParentItem as GridDataItem;
                  if (parentItem != null && parentItem.ChildItem !=null)
                {
                    string _employeeId = parentItem.GetDataKeyValue("Employee").ToString();
                    Label lblIPName = parentItem.FindControl("lblIPName") as Label;
                    Label lblReview = parentItem.ChildItem.FindControl("lblReview") as Label;
                    CheckBox chkIPReviewed = parentItem.ChildItem.FindControl("chkInProcessReviewed") as CheckBox;
               }
          }
     }
Parent grid is getting rebind as well as child grid also getting rebinding when done pagination but syill iam getting null value.

Please give a advise as soon as possible
MadhuSudhan
Top achievements
Rank 1
 answered on 25 Apr 2011
1 answer
93 views
your example code works fine in i.e but does not work in non i.e like Safari 5.0, Firefox

The probelm is in the following function,  document.getElementById(buttonID) not being supported by Safari or Firefox browser

because document.getElementById(buttonID) does not return object.

What would be the work around for it in Safari?

 

 

 

function

SpellCheckClosed(sender, args) {

 

if

(IsChecked) {

 

 

 

//trigger submit from the update/insert button in the grid

 

 

 

//the id of the update or insert button is extracted from a hidden field

 

  

 

 

var buttonID = document.getElementById('<%=HiddenField1.ClientID %>'

).value;

 

  

document.getElementById(buttonID).click();  /// not being supported by non i.e like Safari and firefox

 IsChecked = 

false ;

 

 

  

}

 

}

Thanks

 

 

Rumen
Telerik team
 answered on 25 Apr 2011
1 answer
92 views
Hi team,
My radgrid has its auto genereate column set to true. And I have a serial number column in it.
I want to hide filter for serial number column only and want rest of columns to retain filters. Please help in acheiving this features.
I am attaching gridview for your reference.
<telerik:RadGrid ID="gvPreview" AutoGenerateColumns="true" AllowPaging="True" PageSize="10"
                             runat="server" GridLines="vertical" Width="99%" AllowSorting="true" OnPreRender="gvPreview_PreRender"
                            Font-Bold="true" EnableViewState="true"
                             EnableTheming="false" Height="380px" AllowFilteringByColumn="true" OnPageIndexChanged="gvPreview_PageIndexChanged"
                             OnNeedDataSource="gvPreview_NeedDataSource" OnPageSizeChanged="gvPreview_PageSizeChanged">
                             <ExportSettings HideStructureColumns="true" IgnorePaging="true" OpenInNewWindow="true"
                                 ExportOnlyData="true">
                             </ExportSettings>
                             <GroupingSettings CaseSensitive="false" />
                           <ItemStyle CssClass="grid-content-Maintext" HorizontalAlign="Left" ForeColor="Black"
                     VerticalAlign="Middle" BackColor="#f4fdff"></ItemStyle>
                 <AlternatingItemStyle CssClass="grid-content-Alttext" HorizontalAlign="Left" ForeColor="Black"
                     VerticalAlign="Top" BackColor="White" />
                 <HeaderStyle CssClass="background_dbf7ff lineHeight_25px" Font-Bold="True"
                     HorizontalAlign="Left" Wrap="true" ForeColor="Black" VerticalAlign="Middle"
                     BackColor="#f4fdff"  Font-Names="Arial" Font-Size="11px" />
                 <PagerStyle CssClass="background_dbf7ff lineHeight_25px" />
                 <SelectedItemStyle CssClass="background_dbf7ff lineHeight_25px" />
                 <GroupHeaderItemStyle CssClass="background_dbf7ff lineHeight_25px" />
                 <ActiveItemStyle CssClass="background_dbf7ff lineHeight_25px" />
                 <CommandItemStyle CssClass="background_dbf7ff lineHeight_25px" />
                 <SortingSettings EnableSkinSortStyles="False" />
                 <FilterItemStyle BackColor="#DBF7FF"  BorderStyle="Solid" />
                 <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />  
 
 
 
                             <MasterTableView Width="100%" CommandItemDisplay="Top" CommandItemStyle-HorizontalAlign="Right">
                                 <PagerStyle Mode="NextPrevAndNumeric" />
                                 <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                                     ShowRefreshButton="false" />
                             </MasterTableView>
                             <ClientSettings AllowDragToGroup="true" AllowColumnsReorder="true" ReorderColumnsOnClient="true"
                                 ColumnsReorderMethod="Reorder">
                                  
                                 <Animation AllowColumnReorderAnimation="true" AllowColumnRevertAnimation="true" />
                                 <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
                                 </Scrolling>
                             </ClientSettings>
                             <PagerStyle AlwaysVisible="true"></PagerStyle>
                         </telerik:RadGrid>


Thanks,
Abhishek
Pavlina
Telerik team
 answered on 25 Apr 2011
1 answer
91 views
Using the tabstrip, I'm wondering whether clicking on a different tab can cause postback?

The datasource is our site map.

The reason is on one tab if the user has partially entered something we want to save this into session variable and load it on the new page.

Ideally clicking any tab would cause a postback, i would save their data, determine where they want to go, possibly do more validation and then redirect to the new tab/page.

thx
Cori
Top achievements
Rank 2
 answered on 25 Apr 2011
1 answer
104 views
I'm trying to generate images at run time and display them in the header row.  I'm trying to do this programatically in the code behind.  I can only seem to display text in the header row.  Both the number of rows and the number of columns are determined at run time. Is there a way I can insert binary image data directly into the header?
Vasil
Telerik team
 answered on 25 Apr 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
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
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?