Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
117 views
Hi,
I'm using RadCombobox Ajax control ,I have 2 combo box the second one fills programmatically on OnClientDropDownOpening event according to the first combo's selected item ,
It works properly but sometimes The  2nd combo dropdownlist become very small and scroll ,Here is my code :
Markup:
<telerik:RadComboBox ID="cmbDescription"  Filter="StartsWith" AllowCustomText="true" 
                                             MaxLength="256" Style="margin-right: 1px"
                                            runat="server" OnClientSelectedIndexChanged="cmbDescription_onClinetSelectedIndexChanged" OnClientDropDownOpening="cmbDescription_OnClientDropDownOpening"  >
                                       
javascript:
function cmbDescription_OnClientDropDownOpening(sender, args) {
    var tempSLRef = grdVoucherItems.get_tempEntity().SLRef;
    if (currentSLRef !== tempSLRef) {
      
            currentSLRef = tempSLRef;
            PageMethods.FetchAllSLStandardDescBySLID(currentSLRef, AjaxFetchAllSLStandardDescSucceeded, OnPageMethodFailed, null);
      
    }
}
function AjaxFetchAllSLStandardDescSucceeded(result, context) {
    lstSlStandardDescs = result;
    cmbDescription.get_items().clear();
    for (var i = 0; i < lstSlStandardDescs.length; i++) {
        var comboItem = new Telerik.Web.UI.RadComboBoxItem();
        comboItem.set_text(lstSlStandardDescs[i].Item1);
        comboItem.set_value(lstSlStandardDescs[i].Item3);
        cmbDescription.trackChanges();
        cmbDescription.get_items().add(comboItem);
        cmbDescription.commitChanges();
        
    }



Hamid
Top achievements
Rank 1
 answered on 03 May 2011
0 answers
29 views
DISREGARD...I found out I am supposed to use the SkinManagerControl and not the Form Decorator.  My bad.
mark baer
Top achievements
Rank 1
 asked on 02 May 2011
13 answers
1.3K+ views
Hi

I would like to set focus to the first row in the radgrid when the page loads so that users can use arrow keys to move up and down as soon as the radgrid loads. I tried the code below on ClientEvent OnGridCreated="setFirstRowActive"

 

 

function

 

setFirstRowActive() {

 

 

var grid = $find("<%= grdCodeLists.ClientID %>");

 

 

var masterTable = grid.get_masterTableView();

 

 

var row;

 

 

 

 

//set first row as active

 

 

 

grid.set_activeRow(masterTable.get_dataItems()[0].get_element());

 

}

 

This only highlights the row but doesn't activiate it i.e. can't use up/down arrow to go up/down the rows. Instead of set_activeRow() i tried using SelectItem as well as set_selected properties but they produce the same results
How can this be achieved from both client and server side

Bill Swartz
Top achievements
Rank 1
 answered on 02 May 2011
2 answers
347 views
Hi all

first of all thanks for reading this thread
I have a small problem when trying to open a RadWindow by clicking on a radmenu, I have this code

 

<script type="text/javascript">
  
  
function MenuOpenWindow(sender, eventArgs)
  
  
//If you open the window by javascript, you will need to
  
  
//cancel the postback event and to execute the javascript:
  
  
  
//Checks which item is clicked
  
  
if (eventArgs.Item.Text == "Change Password")
  
{
  
//open a pre-defined window from the RadWindowManager's
  
  
//Windows collection
  
  
radopen(null,"Window1");
  
//Cancel the postback
  
  
return false;
  
}
  
  
</script>
<telerik:RadMenu ID="RadMenu1" runat="server" style="left: 1px; top: -1px" Width="100%" OnClientItemClicked="MenuOpenWindow">
  
<Items>
  
<telerik:RadMenuItem runat="server" ImageUrl="~/img/home.png" Text="Profile" Value="Profile">
  
</telerik:RadMenuItem>
  
<telerik:RadMenuItem runat="server" Text="Groups" ImageUrl="~/img/edit_group.png" Value="Groups">
  
<Items>
  
<telerik:RadMenuItem runat="server" Text="Create Group" ImageUrl="~/img/add_group.png" Value="Create Group">
  
</telerik:RadMenuItem>
  
<telerik:RadMenuItem runat="server" Text="View Group" ImageUrl="~/img/search_group.png" Value="View Group">
  
</telerik:RadMenuItem>
  
</Items>
  
</telerik:RadMenuItem>
  
<telerik:RadMenuItem runat="server" Text="E Lerning" ImageUrl="~/img/Tips.png" Value="E Lerning">
  
<Items>
  
<telerik:RadMenuItem runat="server" Text="Create Tip" ImageUrl="~/img/Create_Tip.png" Value="Create Tip">
  
</telerik:RadMenuItem>
  
<telerik:RadMenuItem runat="server" Text="View Tips" ImageUrl="~/img/Search_Tip.png" Value="View Tips">
  
</telerik:RadMenuItem>
  
</Items>
  
</telerik:RadMenuItem>
  
<telerik:RadMenuItem runat="server" Text="Account" ImageUrl="~/img/Account.png" Value="Account">
  
<Items>
  
<telerik:RadMenuItem runat="server" Text="Change Password" ImageUrl="~/img/key.png" Value="Change Password">
  
</telerik:RadMenuItem>
  
<telerik:RadMenuItem runat="server" ImageUrl="~/img/exit.png" Text="Log Out" Value="Log Out">
  
</telerik:RadMenuItem>
  
</Items>
  
</telerik:RadMenuItem>
  
</Items>
  
</telerik:RadMenu>
when clicking an item of radmenu gives me the error: Message: 'Item.Text' is null or not an object
Line: 16
Char: 15
Code: 0
URI: http://localhost:4853/DensoNetWork/Main.aspx

I think I'm doing something wrong
thanks and regards

excuse me if my English is a little bad

arturo
Top achievements
Rank 1
 answered on 02 May 2011
2 answers
78 views
I have a grid that contains a column containing a checkbox.  Clicking the checkbox does an autopostback (the checked rows are saved in an array in the session so that the user's selections are preserved across multiple pages of the grid).  This works fine, but was orginally very slow to refresh in the browser (it wasn't really usable).  To speed it up I added entries to the RadAjaxManagerProxy to enable Partial Page Refreshes when the checkboxes are clicked.  This made the user experience much better; users can now quickly check the boxes in the grid without waiting.

But another feature of this page is that users can click anywhere in a grid row to postback to the server - then the grid is hidden and the detail fields of the record are displayed.  The problem I'm having is that the ajax settings are messing up the row click feature.  Users now have to click the row twice.  (The first click does postback to the server, but the client is doing a partial page refresh which leaves the grid still visible.  The second row click refreshes the whole page, which is the desired result.)

In summary, I want a checkbox in a grid that does an autopostback and a partial page refresh (only the grid should refresh).  Clicking anywhere else in the grid should do a postback and a full page refresh.

Would appreciate suggestions on resolving this. 

Here are the ajax settings:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>             
            <telerik:AjaxSetting AjaxControlID="chkSelected">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdOrders" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

And here's the grid:

<oscarcontrols:OscarGrid runat="server" ID="grdOrders" AutoGenerateColumns="false"
    Visible="true" PageSize="10" AllowPaging="true" ShowHeader="true" Width="100%"
    AllowSorting="true" EnableEmbeddedSkins="true" DataKeyNames="OrdID" OnPageIndexChanged="grdOrders_PageIndexChanged"
    OnPageSizeChanged="grdOrders_PageSizeChanged" OnItemCommand="grdOrders_ItemCommand"
    OnSelectedIndexChanged="grdOrders_SelectedIndexChanged" OnItemDataBound="grdOrders_ItemDataBound"
    Skin="Outlook" OnSortCommand="grdOrders_SortCommand"
    OnPreRender="grdOrders_PreRender">
    <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="false" EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <PagerStyle Position="TopAndBottom" Mode="NextPrevAndNumeric" Width="100%" AlwaysVisible="false" />
    <MasterTableView OnPreRender="grdOrders_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>
        <Columns>
            <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                <HeaderTemplate>
                    <oscarcontrols:OscarGridCheckBox TargetGrid="grdOrders" IsHeader="true" ID="chkSelectAll"
                        AutoPostBack="true" runat="server"></oscarcontrols:OscarGridCheckBox>
                </HeaderTemplate>
                <ItemTemplate>
                    <oscarcontrols:OscarGridCheckBox TargetGrid="grdOrders" IsItem="true" ID="chkSelected"
                        AutoPostBack="true" runat="server"></oscarcontrols:OscarGridCheckBox>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <%--  _columnOrdID --%>
            <telerik:GridTemplateColumn UniqueName="Order #" HeaderText="Order #" SortExpression="OrdID"
                HeaderStyle-VerticalAlign="Top" ItemStyle-VerticalAlign="Top">
                <ItemTemplate>
                    <oscarcontrols:OscarLabel ID="lblOrdID" runat="server" Text='<%# Bind("OrdID") %>' />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <%-- _columnOrderStatus --%>
            <telerik:GridTemplateColumn UniqueName="Order Status" HeaderText="Order Status" SortExpression="OrdStatusName"
                HeaderStyle-VerticalAlign="Top" ItemStyle-VerticalAlign="Top">
                <ItemTemplate>
                    <oscarcontrols:OscarLabel ID="lblOrderStatus" runat="server" Text='<%# Bind("OrdStatusName") %>' />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</oscarcontrols:OscarGrid>

Mike
Top achievements
Rank 1
 answered on 02 May 2011
4 answers
194 views
Hi,

I have a radwindow which contains lots of nice functionality, but I need it to be openable by two different OpenerElementIDs.  I'd rather avoid having to duplicate the window just to acheive this.

How can I wire up two OpenerElementIDs to the same RadWindow?
Also...
Once that is done, how can I tell which opener was used to open that instance of the window?

Thanks,

Craig
Emanuele
Top achievements
Rank 2
 answered on 02 May 2011
2 answers
63 views
I have this code to allow users to enter dates into a RadDateInput using the formats mdyy or mddyy, reformatting them as mm/dd/yyyy.  It works great for Firefox and IE8, but it does not work for IE7.  I walked through the code, and set_newValue is in fact fired, but it does not change the date, and it handles those formats as invalid.

I also tried hacking it by setting the textbox and hidden fields directly, but that failed in pretty short order.

Has anyone implemented set_newValue in IE7?

<script type="text/javascript">
    function PreParseDate(sender, eventArgs)
    {
        var reSpace = /\s*/g;
        var reMdyy = /^\d{4}$/;
        var reMddyy = /^\d{5}$/;
        var val = eventArgs.get_newValue().replace(reSpace, '');
        
        if (reMdyy.test(val))
        {           
            eventArgs.set_newValue('0' + val[0] +
      '/0' + val[1] +
      '/' + (val[2] > 1 ? '19' : '20') + val[2] + val[3]);
        }
        else if (reMddyy.test(val))
        {
            eventArgs.set_newValue('0' + val[0] +
      '/' + val[1] + val[2] +
      '/' + (val[3] > 1 ? '19' : '20') + val[3] + val[4]);
        }
    }
</script>
<telerik:RadDateInput ID="rdiDOB" runat="server">
    <ClientEvents OnValueChanging="PreParseDate" />
</telerik:RadDateInput>

Thank you,

Eric
Eric
Top achievements
Rank 1
 answered on 02 May 2011
5 answers
378 views
Hi, I have RadDecorator on my page but I want to exclude only couple of TextBoxes and couple of Labels where I want to apply my own CSS.

 

<telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"

 

 

Skin="WebBlue"></telerik:RadFormDecorator>

 


Now, I already applied CSSClass to my textbox but its not applying as I have formDecorator on my page as above.
So How do I exclude specific controls from FormDecorator to apply my own CSS?

Thanks in advance

Emanuele
Top achievements
Rank 2
 answered on 02 May 2011
1 answer
78 views
Hi,
I have a combobox that shows data in columns which are template column with Link buttons. It also has a linkbutton in header.
Linkbutton in header needs to be made visible when the user types in some text.
The combobox shows "Recently viewed records" and when the user types in some text i rebind the combobox with a master data
which is a different collection from the recently viewed items so i clear out the prevoius items and bind matching records from the
typed text from the master recordset.
Each of my record has a menu that has dynamic data as per the record based on a relationship.
When i rebind the data when user types a text i get an error saying "Script control &#39;menuClients&#39; is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().Parameter name: scriptControl"
also am not able to make the linkbutton in header visible when user types the radcombo textbox.
One of the fixes I found was to make “RegisterWithScriptManager = ‘false’” but then the menu’s clientside events are lost (as in it doesn’t show the menu item list on hover).
Would really appreciate a response.

Thanks,
Sudhir.
Kalina
Telerik team
 answered on 02 May 2011
2 answers
49 views
Hi,
i have a code in page_load like that

Dim scriptstring As String = "radalert('test', 300, 125, 'header test');"
RadAjaxPanel1.ResponseScripts.Add(scriptstring)



it works with IE8 and IE7, but not work with IE9. How can i fix this.

Thanks


Mehmet Tirgil
Top achievements
Rank 1
 answered on 02 May 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?