Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
338 views
I have a pageview in multipage. In pageview RadComboBox is defined and button is defined.
Combobox asllows custom text and selectedindexchanged event is impelemtned on server.
button click event is implemented on server.

when text changed in combobox and button clicked, only selectedindexchanged is fired, button click event is not fired.

I wonder how can I get both events fired.

I have a small project included:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="testproj._Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadMultiPage1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">  
            <telerik:RadPageView ID="RadPageView1" runat="server">  
                <telerik:RadComboBox ID="RadComboBox1" Runat="server" AllowCustomText="True"   
                    AutoPostBack="True" ChangeTextOnKeyBoardNavigation="False"   
                    onselectedindexchanged="RadComboBox1_SelectedIndexChanged"   
                    ShowDropDownOnTextboxClick="False">  
                    <Items> 
                        <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1"   
                            Value="RadComboBoxItem1" /> 
                        <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2"   
                            Value="RadComboBoxItem2" /> 
                    </Items> 
                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                </telerik:RadComboBox><br /> 
                <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> 
                <br /> 
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 
                <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> 
            </telerik:RadPageView> 
            <telerik:RadPageView ID="RadPageView2" runat="server">  
                pageview2  
            </telerik:RadPageView> 
            <telerik:RadPageView ID="RadPageView3" runat="server">  
                pageview3  
            </telerik:RadPageView> 
        </telerik:RadMultiPage> 
    </div> 
    </form> 
</body> 
</html> 
 
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
 
namespace testproj  
{  
    public partial class _Default : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
 
        }  
 
        protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
        {  
            Label1.Text = "selected index changed";  
        }  
 
        protected void Button1_Click(object sender, EventArgs e)  
        {  
            Label2.Text = "button clicked";  
        }  
    }  
}  
 
Kevin Babcock
Top achievements
Rank 1
 answered on 08 Nov 2008
2 answers
129 views
I am using the RadGrid and the RadAjaxManager to Ajaxify my Grid.  I have paging enabled and when I click from Page 1 to Page 2, the loading panel appears properly.  However the problem comes when I click back to Page 1 or forward to Page 3 etc.  The LoadingPanel no longer appears....

any thought?
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" UpdatePanelsRenderMode="Inline" DefaultLoadingPanelID="RadAjaxLoadingPanel1">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="20" BackColor="White">  
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0px; position:relative; top:50%;" /> 
</telerik:RadAjaxLoadingPanel> 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Telerik" /> 
Chase Florell
Top achievements
Rank 1
 answered on 08 Nov 2008
1 answer
132 views
I have a FormTemplate where the user enters a non-bound text message.  In the UpdateCommand code-behind, I want to capture the new message (txtBody) and combine it with the text of a GridBoundColumn value (body) from the owning grid.  In the UpdateCommand code-behind I cannot seem to access either value.  Can you point me in the right direction?  Thanks.

My aspx:

<radg:radgrid Skin="Monochrome" ID="rgData" runat="server"
            AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" BorderStyle="None" EnableAJAX="True" EnableAJAXLoadingTemplate="True"
            GridLines="None" Width="99%" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="False" OnUpdateCommand="GridUpdateCommand" OnItemCommand="rgData_ItemCommand">
            <MasterTableView CommandItemDisplay="Bottom" PageSize="10">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <EditFormSettings EditFormType="Template">
                    <FormStyle CssClass="radEnabledCss_WebBlue" />
                    <FormTemplate>
                        <table style="width: 80%" align="center">
                            <tr>
                                <td style="width: 15%">Category:</td>
                                <td style="width: 85%">
                                    <div class='field'>
                                        <radC:RadComboBox ID="cmbCategory" runat="server" Skin="WebBlue" Width="180px"
                                         DataTextField="poptext" DataValueField="MSG_CATEGORY" SelectedValue='<%# Bind("MSG_CATEGORY") %>'>
                                         <Items>
                                                <radC:RadComboBoxItem Text="Select" Value="" />
                                                <radC:RadComboBoxItem Text="Question" Value="Question" />
                                                <radC:RadComboBoxItem Text="Request" Value="Request" />
                                                <radC:RadComboBoxItem Text="Comment" Value="Comment" />
                                                <radC:RadComboBoxItem Text="Other" Value="Other" />
                                            </Items>
                                        </radC:RadComboBox>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>Subject:</td>
                                <td>
                                    <asp:TextBox ID="txtSubject" runat="server" Width="375" Text='<%# Bind("SUBJECT") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Label ID="lblMessage" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Message:" : "Reply:" %>' />
                                </td>
                            </tr>
                            <tr>
                            <td colspan="2">
                                <radI:RadTextBox ID="txtBody" runat="server"  TextMode="MultiLine" Width="500" Height="100" />
                            </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <asp:Button ID="btnInsert" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" />
                                </td>
                            </tr>
                        </table>
                    </FormTemplate>
                </EditFormSettings>
                <ExpandCollapseColumn Visible="False" Resizable="False">
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <RowIndicatorColumn Visible="False">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <Columns>
                    <radG:GridBoundColumn HeaderText="ID" UniqueName="pk" DataField="CPK_WEB_MESSAGES"
                        Display="False" ReadOnly="True" />
                    <radG:GridBoundColumn UniqueName="subject" DataField="subject" Visible="False" ReadOnly="False" />
                    <radG:GridBoundColumn UniqueName="body" DataField="body" Visible="False" ReadOnly="False" />
                    <radG:GridBoundColumn HeaderText="Message Source" UniqueName="SOURCE" DataField="web_message_source" HeaderButtonType="TextButton" />
                    <radG:GridBoundColumn HeaderText="Category" UniqueName="msg_category" DataField="MSG_CATEGORY" HeaderButtonType="TextButton" />
                    <radG:GridBoundColumn HeaderText="Date Sent" UniqueName="RECEIVED" DataField="received" HeaderButtonType="TextButton" />
                    <radG:GridBoundColumn HeaderText="Subject / Message" UniqueName="subjectbody" DataField="subjectbody" HeaderButtonType="TextButton" />
                    <radG:GridBoundColumn HeaderText="Status" UniqueName="msg_status" DataField="msg_status" HeaderButtonType="TextButton" />
                    <radG:GridButtonColumn ButtonType="PushButton" Text="Reply" CommandName="Edit" UniqueName="edit">
                    </radG:GridButtonColumn>
                    <radG:GridButtonColumn ButtonType="PushButton" Text="Delete" CommandName="Delete" UniqueName="delete">
                    </radG:GridButtonColumn>
                </Columns>
                <CommandItemTemplate>
                    <asp:Button ID="btnInsert" CommandName="InitInsert" ImageUrl="~/Images/add_small_off.png"
                        runat="server" Text="Add Message" />
                    <asp:Button ID="btnRefresh" CommandName="RebindGrid" ImageUrl="~/Images/refresh_list_off.png"
                        runat="server" Text="Refresh List" />
                </CommandItemTemplate>
            </MasterTableView>
            <HeaderStyle Font-Bold="True" Font-Size="14px" Font-Underline="False" HorizontalAlign="Left" />
            <ItemStyle Font-Size="12px" />
            <AlternatingItemStyle Font-Size="12px" />
        </radg:radgrid>

My code-behind:

protected void rgData_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)                   <---This does not work
        {
            TextBox txtBox = e.Item.FindControl("txtBody") as TextBox;
            Session["savedOldBody"] = txtBox.Text;
        }
    }

    protected void GridUpdateCommand(object source, Telerik.WebControls.GridCommandEventArgs e)
    {
        GridEditableItem editedItem = (GridEditableItem)e.Item;
        int iPKey = (int)editedItem.GetDataKeyValue("CPK_WEB_MESSAGES");

        Hashtable newValues = new Hashtable();
        e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
        string subject = newValues["SUBJECT"].ToString().Trim();
        string body = newValues["txtBody"].ToString().Trim();                          <---This does not work
        string category = newValues["MSG_CATEGORY"].ToString().Trim();
        string orig_body = Session["savedOldBody"].ToString().Trim();            <---This does not work

        string strSqlCmd = "exec dbo.wa_Update_Web_Messages " + iPKey.ToString().Trim() + "," + category + ",'" + subject.Replace("'", "''") + "','" + body.Replace("'", "''") + "','Sent'";
        DataAccess sda = new DataAccess();
        sda.RunSqlCmd(strSqlCmd);
    }

Dan
Top achievements
Rank 2
 answered on 07 Nov 2008
5 answers
177 views
Hi,

Is there a way to make two or more checkboxes act like radio buttons. The beauty of checkboxes is that you can check and uncheck them, but not with radio buttons.

Thanks! Also, I am creating a survey website with all sorts of controls in it (checkboxes, radiobuttons, textboxes...),  can anyone suggest any radcontrols that should be an underlying container for these controls.

Have a great day!
Shaun Peet
Top achievements
Rank 2
 answered on 07 Nov 2008
7 answers
935 views
Hello,

I have a particular scenario where I need to retrieve the ComboBox Value through a Request.Form method.

For a standard ASP.NET dropdownlist control, the following code returns the selected item value:

Request.Form("DropDownID")

However, with the comboBox, I cannot get the value.  Upon finding the control Key, i see that there are two options:

"ComboBoxID_Input", which returns the Text Value and
"CombboBoxID_ClientState", which returns something like this:

"{"logEntries":[],"value":"1461","text":"5 Business Days","enabled":true}"

Is there a way to extract the value easily, without having to dissect the "clientState" string?

Thank you.
Jay
Top achievements
Rank 1
 answered on 07 Nov 2008
3 answers
143 views

localHost working fine but production server error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 1:  <%@ Master Language="VB" CodeFile="MainPage.master.vb" Inherits="MainPage" %>
Line 2: <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>Line 3:  <%@ Register Assembly="FlashControl" Namespace="Bewise.Web.UI.WebControls" TagPrefix="Bewise" %>
Line 4:  

Source File: /desarrollo/br/mgrp/es/MainPage.master    Line: 2

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Telerik.Web.UI' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
Serrin
Top achievements
Rank 1
 answered on 07 Nov 2008
5 answers
425 views
My Group Headers look like this:

adType: Web Banner

adType: Van

adType: Map

adType: Graphic Design

adType: Experience Guide

adType: Community Profile

 I would like to remove the "adType:" (fieldname) and leave the rest of the text.

Also, how do I enable expand on click for these header rows?

Brett
Levi
Top achievements
Rank 1
 answered on 07 Nov 2008
4 answers
193 views
Hi

I have two situations with treeview:

1) I have a textbox where I enter an ID to search in a treeview. Sometimes, the textbox loses focus and I cannot insert nothing any more. The textbox is in the same window with treeview.

2) I have a searching operation using server code to  find and select the node I'm looking for. After that, server code calls a Javascript function to load detailed information in another window. This is working ok, however, I need to guarantee that selected node is visible and not outside of my window. It seems that "scrollIntoView" is the solution to this.
I try to add this code:

  var tree = $find("<%= RadTreeView1.ClientID %>");
  if (tree.get_selectedNode() != null)
  {
       tree.get_selectedNode().scrollIntoView();
   }

but I got an error: 'null' is null or not an object.
I'm calling my javascript function using scriptmanager.RegisterClientScriptBlock

Regards

Quim
Top achievements
Rank 1
 answered on 07 Nov 2008
1 answer
148 views
Hello,

I am using a RadCombobox in a Grid to store linkbuttons for command like edit, delete, reset password, etc...

I set the default text to "Select an Action..".  Some of the linkbuttons have confirm prompts that if the user selects 'cancel' the page does not postback.  However, when this happens, the text displayed changes from "Select an action...." to a string somewhat like "editresetpassworddelete".  These are the text of my link buttons.  How can I prevent this text from changing?

Thanks.

Jon
 <telerik:RadComboBox ID="RadComboBox_Commands" MarkFirstMatch="false" runat="server" OnClientSelectedIndexChanging="HandleIndexChanging" OnClientDropDownClosed="HandleClose" 
                                Width="210px" HighlightTemplatedItems="false"   
                                ShowToggleImage="True" Skin="Default" 
                                DropDownWidth="210px" AllowCustomText="false" EnableLoadOnDemand="false">  
                                
                                <ItemTemplate> 
                                   <div style="padding-bottom:5px;"><dadds:LinkButton ID="btnShowEdit" CommandName="ShowEdit" runat="server" Text="edit" Roles="Administrator, Manager" /></div>  
                                   <div style="padding-bottom:5px;"><dadds:LinkButton ID="btnResetPassword" CommandName="ResetPassword" runat="server" Text="reset password" Roles="Administrator, Manager, Operator" /></div>  
                                   <div style="padding-bottom:5px;"><dadds:LinkButton ID="btnDelete" CommandName="Delete" runat="server" Text="delete" Roles="Administrator, Manager" /></div>  
                                   <div style="padding-bottom:5px;"><dadds:LinkButton ID="btnExpirePassword" CommandName="ExpirePassword" runat="server" Text="expire password" Roles="Administrator" /></div>  
                                   <div style="padding-bottom:5px;"><dadds:LinkButton ID="btnClearPasswordHistory" CommandName="ClearPasswordHistory" runat="server" Text="clear password history" Roles="Administrator" /></div>     
                                </ItemTemplate> 
                                <Items> 
                                     <telerik:RadComboBoxItem Selected="True"></telerik:RadComboBoxItem>                                            
                                </Items> 
                            </telerik:RadComboBox> 

Jon (I.T. Agility Inc.)
Top achievements
Rank 1
 answered on 07 Nov 2008
1 answer
87 views
HI,

In the RADGrid we are using pagin option with mode as

NextPrevNumericAndAdvanced



Our customers actually want to have all records displayed in one page as one option.so we set the Page size to total number of records so that alll products display on a single page..

But still on the left side the it shows the Chane Pgae option with left and right arrows which are actually meaningless in this situation as there are no pages to move left or right..
is there a way we can remove the arrows in this case

Thanks
Bala
Daniel
Telerik team
 answered on 07 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?