Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
169 views
I'm adding items to a RadComboBox server-side like so:

            foreach (ValueMapping mapping in ValueMappings) 
            { 
                RadComboBoxItem comboItem = new RadComboBoxItem(mapping.DisplayValue, mapping.DataValue); 
                this.Items.Add(comboItem); 
            } 

Then later I'm selecting the item I want to be initially selected in the combobox on the server-side too:

                RadComboBoxItem item = 
                    this.FindItemByValue(value); 
 
                if (item != null
                { 
                    item.Selected = true
                } 

I have registered a client-side event listener to the "OnClientSelectedIndexChanged" event. However, this event seems to be firing as soon as the page loads as if the user has selected a value using the combobox. Is this expected behaviour, something broken or me doing something wrong? I only want to be notified when the value has been changed by the user from the value selected server-side - how would I achieve this?

I am using version 2008.3.1314.20

Thanks,
James

Addendum: I've just realised that the client event only seems to be fired once when the page loads and never again. That is, the event is not being fired when the user selects a new item. Help!




Yana
Telerik team
 answered on 18 Feb 2010
1 answer
87 views
Hi,

I have a MasterPage where I have declared a RadAjaxManager

Into other pages I am using the RadAjaxManagerProxy .
In a form I have RadAjaxManagerProxy which update an <asp:Panel> which contains a FromView which contains a RadEditor.
After a "postback" the RadEditor loose its behavior.

I have search on you forrum, I have read your documentation but it doesn't work.

Best regards.
Pavel
Telerik team
 answered on 18 Feb 2010
3 answers
151 views
If you create an imagemap area in IE, it is transparent. If you do it in Safari, Firefox or Chrome it is not. Can you please fix this in the next version? Is it possible for me to fix this with a custom javascript?

Testet on demo http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx with Firefox 3.6



Rumen
Telerik team
 answered on 18 Feb 2010
1 answer
167 views
I updated to the latest version of RadControls for ASP.NET AJAX (2008.2 1001 - Oct 1, 2008) and now the header (HeaderTemplate) row will no longer show for all my RadComboBox controls when I do some type of data binding in the HeaderTemplate. If there is no data binding it works. Something broke in this last version and the basic "<%" usage is no longer supported.
 
Not working HeaderTemplate:
                            <HeaderTemplate> 
                                <table cellpadding="0" cellspacing="0" border="0">  
                                    <tr> 
                                        <td style="width:90px; vertical-align:top; text-align:left;"><%= ((SessionState.Language == Natr.Classes.Language.Spanish) ? "No. de Stock" : "Stock Number")%></td>  
                                        <td style="width:320px; vertical-align:top; text-align:left;"><%= ((SessionState.Language == Natr.Classes.Language.Spanish) ? "Descripción" : "Product Name")%></td>  
                                        <td style="width:50px; vertical-align:top; text-align:left;"><%= ((SessionState.Language == Natr.Classes.Language.Spanish) ? "Costo" : "Price")%></td>  
                                    </tr> 
                                </table> 
                            </HeaderTemplate>

 

 

 

 

Working HeaderTemplate:
                            <HeaderTemplate>    
                                <table cellpadding="0" cellspacing="0" border="0">     
                                    <tr>    
                                        <td style="width:90px; vertical-align:top; text-align:left;">Stock Number</td>     
                                        <td style="width:320px; vertical-align:top; text-align:left;">Product Name</td>     
                                        <td style="width:50px; vertical-align:top; text-align:left;">Price</td>     
                                    </tr>    
                                </table>    
                            </HeaderTemplate>    
 

 

Kalina
Telerik team
 answered on 18 Feb 2010
2 answers
88 views
I'm working with Telerik v. 2009.2.701.35

I have some buttons on a form rendering inside a table.  If I create them as <input type="button> they do not decorate at all.  If I change it to a <button> tag, it seems to pick up the css from the skin's style sheet and apply the correct background, but the right side border is missing.  This right side border is supposed to be the background of the <a> tag, based on what I've seen in the demo.

I tried using javascript to style the form in real time, and it works, but again it skips the buttons.  It styles the other form elements just fine. The example I followed to do this is here: http://www.telerik.com/support/kb/aspnet-ajax/formdecorator/decorate-dynamically-added-controls-by-using-radformdecorator.aspx

Here is an example of the HTML on my page in which buttons are not being decorated.
<table class="string-group-list"><tbody id="TestGroupedInputTable"><tr> 
            <th>One Header</th> 
            <th>Two Header</th> 
            <th>Three Header</th> 
            <td><button class="sgl-button" onclick="sglAddNew('TestGroupedInput', 3);" name="TestGroupedInputAddNew" type="button" id="TestGroupedInputAddNew">Add New</button></td
        </tr> 
        <tr id="TestGroupedInputRow0"
            <td><input type="text" class="sgl-input rfdDecorated" value="a" id="TestGroupedInputInput0_0" name="TestGroupedInputInput0_0"></td> 
            <td><input type="text" class="sgl-input rfdDecorated" value="s" id="TestGroupedInputInput0_1" name="TestGroupedInputInput0_1"></td> 
            <td><input type="text" class="sgl-input rfdDecorated" value="2" id="TestGroupedInputInput0_2" name="TestGroupedInputInput0_2"></td> 
            <td><button class="sgl-button" onclick="sglDelRow('TestGroupedInput','TestGroupedInputRow0');" name="TestGroupedInputDelete0" type="button" id="TestGroupedInputDelete0">Delete</button></td
        </tr> 
        </tbody></table

I don't think my CSS is causing this issue because like I said, the <a> tag wrappers are not being created at all.

Thanks for looking,
-Chris
Georgi Tunev
Telerik team
 answered on 18 Feb 2010
2 answers
150 views
Hi,
I need to set the DataNavigateUrlFormatString of the GridHyperLinkColumn to some thing like this.
http://xyz.com?id=rownumber.

Here rownumber is the number of the row in which the linkbutton will be there.

Eg: for a linkbutton in the third row,

the url should be like http://xyz.com?id=3.

How can this be achieved in the ascx file?( or even via code?)
vishesh kumar
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
99 views
Hi!

Ive made some js functions that resizes the editor when the browser window is resized.

Everything works great until theres a postback. After the postback setSize throws an exception all the time.

The line casuing the exception is. (located in a scriptresource)
ln:5694  c.style.height="";  (c is null)


My code:
var bw_currenteditor;
//function to set editor variable called from editor.OnClientLoad
function contentTemplateEditorInit(editor) {
bw_currenteditor = editor;
}

//function to resize which is called from body.onresize
function ResizeTemplateEditor(editor) {

if (!editor || typeof editor.setSize != "function")
        return;
//Get new editor width and height
var h = Math.abs(BWgetContentControlPreviewWindowHeight() - 160);
var w = Math.abs(BWgetContentControlPreviewWindowWidth() - 40);
editor.setSize(w, h);
}

Dobromir
Telerik team
 answered on 18 Feb 2010
1 answer
128 views
I have a very simple project, a radcalendar which calls javascript code when a date clicked (the code only displays some info on a label).
the code works fine but when I open radwindow  from a button and close it, the calendar stops responding....

the window I open is declared and showed like this:

Dim newWindow As New Telerik.Web.UI.RadWindow()             
newWindow.ID = "RadWindow1"
newWindow.NavigateUrl = "users/askQuestion.aspx"
newWindow.Width = 800
newWindow.Height = 500              
newWindow.VisibleOnPageLoad = True          
form1.Controls.Add(newWindow)

everything in my simple project goes fine untill I open (RadWinow1), after closing it, my calendar dies.
any solution????????????
Georgi Tunev
Telerik team
 answered on 18 Feb 2010
2 answers
329 views
Hi all,

I'm trying to solve this problem where un-checking all child nodes should un-check the parent node using JavaScript.

My tree view is populated through Linq data source, with CheckBoxes property set to true. If any of the child nodes is checked, the parent node will be checked too, however, I can't solve the problem where un-checking all child nodes lead to un-checking the parent node.

I tried several solutions, yet, the best I got was un-checking any of the checked child nodes will un-check the parent node.

Appreciate your help and assistant.

Regards,
loai taha
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
230 views
I have a RadComboBox in a RadSlidingPane and a RadGrid in RadPane.  The RadGrid has a javascript method bound to the OnRowSelected ClientEvent and the AllowRowSelect Selecting setting is set to true.  By clicking on a row in the Grid then I open a rad window.  That part is not important, but I just wanted to point it out.  What is happening is when the RadSlidingPane is slid open "Expanded" over the RadGrid and I click on the RadComboBox somewhere between the text in the ComboBox and the drop down arrow it causes the OnRowSelected event of the grid to fire, thus opening my RadWindow.  I am trying to figure out how to either make the area between the text and the drop down arrow of the RadComboBox not "transparent" through to the grid, or disable the AllowRowSelect of the grid while the RadSlidingPane is open.  I have already tried to set a flag indicating that the SlidingPane is expanded and when the OnRowSelected method is called just not execute the code.  However, the ComboBox does not drop down.

<script language="javascript">  
 
            var timerSettingUser = true;  
 
            function GetTimer()  
            {  
                return $find('<%= tmrQueueList.ClientID %>');  
            }  
 
            function StartTimer()  
            {  
                if (timerSettingUser)  
                {  
                    var timer = GetTimer();  
                    timer.set_enabled(true);  
                    timer._startTimer();  
 
                    var btn = $get('<%= lbtnSetAutoRefresh.ClientID %>');  
                    btn.innerText = "Off";  
                }  
            }  
 
            function StopTimer()  
            {  
                var timer = GetTimer();  
                timerSettingUser = timer.get_enabled();  
 
                if (timerSettingUser)  
                {  
                    timer.set_enabled(false);  
                    timer._stopTimer();  
 
                    var btn = $get('<%= lbtnSetAutoRefresh.ClientID %>');  
                    btn.innerText = "On";  
                }  
            }  
 
            function DeselectAllRows()  
            {  
                var grid = $find("<%= rgQueueList.ClientID %>");  
                var masterTable = grid.get_masterTableView();  
                masterTable.deleteSelectedItems();  
            }  
 
            function QueueRowSelected(sender, args)  
            {  
                StopTimer();  
                var pkQueue = args.getDataKeyValue("pkQueue");  
                var title = args.getDataKeyValue("JobScheduleDescription");  
                var win = radopen("view_jobqueue.aspx?pkqueue=" + pkQueue, "rwViewQueueItem");  
                if (title != null)  
                    win.set_title(title);  
                win.setSize(700, 600);  
                win.center();  
            }  
 
            function WindowClosed(sender, args)  
            {  
                StartTimer();  
                DeselectAllRows();  
            }  
 
            function QueueItemCheckChanged(cb)  
            {  
                for (var i = 0; i < QueueItemCBIDs.length; i++)  
                {  
                    document.getElementById(QueueItemCBIDs[i]).checked = cb.checked;  
                }  
            }  
 
            function SplitterLoaded(splitter, arg)  
            {  
                var pane = splitter.getPaneById('<%= rpContent.ClientID %>');  
                var height = pane.getContentElement().scrollHeight;  
                splitter.set_height(height);  
                pane.set_height(height);  
            }  
 
        </script> 
<h1> 
        Queue Manager</h1> 
    <rad:RadSplitter ID="rsQueueManager" runat="server" Width="100%" OnClientLoaded="SplitterLoaded">  
        <rad:RadPane ID="rpSidebar" runat="server" Scrolling="None" Width="22px">  
            <rad:RadSlidingZone ID="rszSidebar" runat="server" Width="22px">  
                <rad:RadSlidingPane ID="rspSidebar" Title="Settings" runat="server" Width="300px">  
                    <rad:RadAjaxLoadingPanel ID="ralpSearchSettings" runat="server">  
                    </rad:RadAjaxLoadingPanel> 
                    <rad:RadAjaxPanel ID="rapSearchSettings" runat="server" LoadingPanelID="ralpSearchSettings">  
                        <asp:Panel ID="pnlSearchSettings" runat="server" DefaultButton="btnSearch">  
                            <h2> 
                                Search Settings:</h2> 
                            <table class="PropertyTable">  
                                <tr> 
                                    <td>Search For:</td> 
                                    <td> 
                                        <asp:TextBox ID="txtSearchFor" runat="server"></asp:TextBox></td>  
                                </tr> 
                                <tr> 
                                    <td>Search By:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbSearchBy" runat="server" Width="120px">  
                                            <Items> 
                                                <rad:RadComboBoxItem Text="Queue ID" Value="QueueID" Selected="true" /> 
                                                <rad:RadComboBoxItem Text="Job Name" Value="JobName" /> 
                                                <rad:RadComboBoxItem Text="Job Type" Value="JobType" /> 
                                                <rad:RadComboBoxItem Text="Schedule" Value="Schedule" /> 
                                                <rad:RadComboBoxItem Text="Worker" Value="Worker" /> 
                                                <rad:RadComboBoxItem Text="Result" Value="Result" /> 
                                            </Items> 
                                        </rad:RadComboBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Start Date:</td> 
                                    <td> 
                                        <rad:RadDateTimePicker ID="rdtpStartDate" runat="server" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>End Date:</td> 
                                    <td> 
                                        <rad:RadDateTimePicker ID="rdtpEndDate" runat="server" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Status:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbStatus" runat="server" Width="100px">  
                                            <Items> 
                                                <rad:RadComboBoxItem Text="All" Value="0" /> 
                                                <rad:RadComboBoxItem Text="Scheduled" Value="1" /> 
                                                <rad:RadComboBoxItem Text="Processing" Value="2" /> 
                                                <rad:RadComboBoxItem Text="Success" Value="3" /> 
                                                <rad:RadComboBoxItem Text="Failed" Value="4" /> 
                                                <rad:RadComboBoxItem Text="Rescheduled" Value="5" /> 
                                                <rad:RadComboBoxItem Text="Hold" Value="6" /> 
                                            </Items> 
                                        </rad:RadComboBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Processed By:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbProcessedBy" runat="server" Width="100px" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Job:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbJob" runat="server" AutoPostBack="true" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td>Schedule:</td> 
                                    <td> 
                                        <rad:RadComboBox ID="rcbJobSchedule" runat="server" AutoPostBack="true" /> 
                                    </td> 
                                </tr> 
                            </table> 
                            <asp:Button ID="btnSearch" runat="server" Text="Search" onclick="btnSearch_Click" /> 
                        </asp:Panel> 
                    </rad:RadAjaxPanel> 
                    <h2> 
                        Configure Jobs</h2> 
                    Change Status:  
                    <rad:RadComboBox ID="rcbUpdateStatus" runat="server" MarkFirstMatch="False" AllowCustomText="False" Width="110" Height="130" AutoPostBack="False" EnableLoadOnDemand="False" HighlightTemplatedItems="True">  
                        <Items> 
                            <rad:RadComboBoxItem Text="Hold" Value="6" /> 
                            <rad:RadComboBoxItem Text="Resume" Value="7" /> 
                            <rad:RadComboBoxItem Text="Delete" Value="8" /> 
                            <rad:RadComboBoxItem Text="Failed" Value="4" /> 
                            <rad:RadComboBoxItem Text="Rescheduled" Value="5" /> 
                            <rad:RadComboBoxItem Text="Run Now" Value="10" /> 
                        </Items> 
                    </rad:RadComboBox> 
                    <asp:Button ID="btnUpdateStatus" runat="server" Text="Update Status" onclick="btnUpdateStatus_Click" /> 
                </rad:RadSlidingPane> 
            </rad:RadSlidingZone> 
        </rad:RadPane> 
        <rad:RadPane ID="rpContent" runat="server">  
            <div style="padding: 5px">  
                <asp:Panel ID="pnlQueueManager" runat="server">  
                    <div style="background-color: #F4F4F4; border-top: solid 1px #E5E5E5; border-bottom: solid 1px #BBBBBB; border-right: solid 1px #BBBBBB; border-left: solid 1px #E5E5E5">  
                        <table cellpadding="0" cellspacing="0" width="100%">  
                            <tr> 
                                <td width="220">Change Status: </td> 
                                <td width="230">  
                                    <rad:RadToolBar ID="rtbQueueManager" runat="server" AutoPostBack="true" ImagesDir="~/Resources/Images">  
                                        <Items> 
                                            <rad:RadToolBarButton ID="rtbbUpdateStatus" CommandName="UpdateStatus" Text="Apply" ImageUrl="~/Resources/Images/apply.png" /> 
                                            <rad:RadToolBarButton ID="rtbbSearch" CommandName="Search" Text="Search / Refresh" ImageUrl="~/Resources/Images/search.png" /> 
                                        </Items> 
                                    </rad:RadToolBar> 
                                </td> 
                                <td align="right" style="padding-right: 5px" nowrap>Turn Auto Refresh:  
                                    <asp:LinkButton ID="lbtnSetAutoRefresh" runat="server">Off</asp:LinkButton></td>  
                            </tr> 
                        </table> 
                    </div> 
                </asp:Panel> 
                <br /> 
                <rad:RadAjaxLoadingPanel ID="ralpQueueList" runat="server" /> 
                <rad:RadAjaxPanel ID="rapQueueList" runat="server" LoadingPanelID="ralpQueueList">  
                    <asp:Timer ID="tmrQueueList" runat="server" Interval="60000" /> 
                    <rad:RadGrid ID="rgQueueList" runat="server" AutoGenerateColumns="False" AllowPaging="true" AllowSorting="true" OnItemDataBound="rgQueueList_ItemDataBound" OnNeedDataSource="rgQueueList_NeedDataSource" ShowGroupPanel="true">  
                        <MasterTableView DataKeyNames="pkQueue" ClientDataKeyNames="pkQueue, JobScheduleDescription" GroupLoadMode="Client">  
                            <Columns> 
                                <rad:GridTemplateColumn> 
                                    <ItemTemplate> 
                                        <asp:CheckBox ID="cbSelectQueueItem" runat="server" /> 
                                    </ItemTemplate> 
                                    <HeaderTemplate> 
                                        <asp:CheckBox ID="cbSelectQueueItem" runat="server" /> 
                                    </HeaderTemplate> 
                                </rad:GridTemplateColumn> 
                                <rad:GridBoundColumn DataField="pkQueue" HeaderText="ID" UniqueName="pkQueue" /> 
                                <rad:GridBoundColumn DataField="RunOn" HeaderText="Run On" UniqueName="RunOn" /> 
                                <rad:GridBoundColumn DataField="RunTime" HeaderText="Run Time" UniqueName="RunTime" /> 
                                <rad:GridBoundColumn DataField="JobName" HeaderText="Job" UniqueName="JobName" /> 
                                <rad:GridBoundColumn DataField="JobScheduleDescription" HeaderText="Schedule" UniqueName="JobScheduleDescription" /> 
                                <rad:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status" /> 
                                <rad:GridBoundColumn DataField="NumberOfRetries" HeaderText="Retries" UniqueName="NumberOfRetries" /> 
                                <rad:GridBoundColumn DataField="ProcessedBy" HeaderText="Processed By" UniqueName="ProcessedBy" /> 
                                <rad:GridBoundColumn DataField="IsActive" HeaderText="Active" UniqueName="IsActive" /> 
                                <rad:GridTemplateColumn HeaderText="Dependent">  
                                    <ItemTemplate> 
                                        <%# ((int)Eval("fkParent") == 0) ? "No" : String.Format("On {0}", Eval("fkParent")) %> 
                                    </ItemTemplate> 
                                </rad:GridTemplateColumn> 
                            </Columns> 
                            <ItemStyle CssClass="ClickableRow GridRow_Default" /> 
                            <AlternatingItemStyle CssClass="ClickableRow GridRow_Default" /> 
                            <PagerStyle Mode="Slider" /> 
                        </MasterTableView> 
                        <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">  
                            <ClientEvents OnRowSelected="QueueRowSelected" /> 
                            <Selecting AllowRowSelect="true" /> 
                        </ClientSettings> 
                        <GroupingSettings ShowUnGroupButton="true" /> 
                    </rad:RadGrid> 
                    <div class="HorizontalButtonList">  
                        Errors per page:  
                        <rad:RadComboBox ID="rcbPageSize" runat="server" MarkFirstMatch="True" AllowCustomText="False" Width="60" Height="140" AutoPostBack="True" EnableLoadOnDemand="False" HighlightTemplatedItems="True" OnSelectedIndexChanged="rcbPageSize_SelectedIndexChanged">  
                            <Items> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem1" Text="10" Value="10" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem2" Text="15" Value="15" Selected="True" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem3" Text="20" Value="20" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem4" Text="25" Value="25" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem5" Text="30" Value="30" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem6" Text="50" Value="50" runat="server" /> 
                                <rad:RadComboBoxItem ID="RadComboBoxItem7" Text="100" Value="100" runat="server" /> 
                            </Items> 
                        </rad:RadComboBox> 
                    </div> 
                </rad:RadAjaxPanel> 
            </div> 
        </rad:RadPane> 
    </rad:RadSplitter> 
    <rad:RadWindowManager ID="rwmQueueManager" runat="server" DestroyOnClose="true" Modal="true" Style="z-index: 7001" OnClientClose="WindowClosed" /> 
    <rad:RadAjaxManager ID="ramMain" runat="server">  
    </rad:RadAjaxManager> 
T. Tsonev
Telerik team
 answered on 18 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?