Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
201 views
I have a radcombobox with EnableAutomaticLoadOnDemand="true", when I select the combobox, all the data loads and I am able to select an item.  If I then click the same combobox, the value of the previous selection is present, therefore it will not load in any of the data untill i delete the text in the combobox.  Is there away around this?  I would like to the text to be cleared out so everytime a user clicks on the box it will load all the values in?

I have set up the radcombobox in the folloaing way
<telerik:RadComboBox ID="rcb_1" AllowCustomText="true" runat="server" EmptyMessage="Please select a value..." 
DataTextField="description" DataValueField="ID" CssClass="radComboBox" AutoPostBack="true" MaxHeight="200px" width="170px"
EnableAutomaticLoadOnDemand="true" Filter="Contains" ></telerik:RadComboBox>
I bind the data in the following way,
rcb_1.DataSource = Class.getData()
rcb_1.DataBind()
Any help would be much appreciated
Yana
Telerik team
 answered on 28 Oct 2010
2 answers
68 views
Hi,

I have been using Telerik Grid, on demand load data and i have implemented custom paging to my grid.
I have used VirtualItem count property to display max reocrds avilable with given query and default it will display 10 records perpage.
ex:-   24 items in 3 pages like this format i am displaying record count.(page size is 10)
24items i am getting using virtual item count.
But my problem is when when virtrual item count is greater than the pagesize, then the grid pagination bar(page index bar) is coming.
but when the virtualitem count is lessthan the pagesize(for example:- 3 recrods retruned from db,but page size is10) then pagination bar is disappearing.
so please provide me the better solution to resolve this issue.

Thanks in advance.
Pardha Saradhi
Top achievements
Rank 1
 answered on 28 Oct 2010
1 answer
68 views
HI
Im using Radgrid that connects to  a Sql server 2000 table. I have automatic updates/deletes enabled.. My problem is that I am able to delete the rows through the radgrid, I am not able to update them...


Here's the Code
       
    <telerik:RadGrid ID="RGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SQLDS"
        GridLines="None" DataMember="DefaultView" AutoGenerateDeleteColumn="True"
        AutoGenerateEditColumn="True" AllowAutomaticDeletes="True"
        AllowAutomaticUpdates="True">
        <MasterTableView DataSourceID="SQLDS" DataKeyNames="ID">
            <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
            <Columns>
                <telerik:GridBoundColumn DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID"
                    Visible="false" AllowFiltering="False" AllowSorting="False" Display="False" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="NAME" HeaderText="NAME" SortExpression="NAME"
                    UniqueName="NAME">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ADDRESS" HeaderText="ADDRESS" SortExpression="ADDRESS"
                    UniqueName="ADDRESS">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
 
<br />
<br />
<asp:SqlDataSource ID="SQLDS" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringSQL %>"
    ProviderName="<%$ ConnectionStrings:ConnectionStringSQL.ProviderName %>" SelectCommand="SELECT [ID], [NAME], [ADDRESS] FROM [Info]"
    UpdateCommand="UPDATE [Info] set [NAME]=?,[ADDRESS]=? where [ID]=?"
    DeleteCommand="delete from Info where [ID]=?">
    <DeleteParameters>
        <asp:Parameter Name="ID" Type="String" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="NAME" Type="String" />
        <asp:Parameter Name="ADDRESS" Type="String" />
        <asp:Parameter Name="ID" Type="String" />
    </UpdateParameters>
</asp:SqlDataSource>


I'm not sure what the issue is since I'm able to delete rows...

Any help is appreciated..


Thanks,


 
Maria Ilieva
Telerik team
 answered on 28 Oct 2010
1 answer
163 views

I have RadComboBox on my page for multiple item selection.
its working fine.
but when i go to page 1st time..it will open tht radcombobox automatically.
After cliking on another button also it automatically open.
i want to supress tht on clik on any other control , it should open when user click on that RadComboBox

can any onw help??

my code is as followes


<

 

 

telerik:RadComboBox ID="rdCombIssueTypeID" runat="server" HighlightTemplatedItems="True" AllowCustomText="True" Width="190px" TabIndex="0" OpenDropDownOnLoad="true" OnClientSelectedIndexChanging="OnClientSelectedIndexChanging"

 

 

 

 

CloseDropDownOnBlur="true"

 

 

 

OnClientDropDownOpening="OnClientDropDownOpening"

 

 

 

 

OnClientDropDownClosing="OnClientDropDownClosing"

 

 

 

OnClientBlur="OnClientBlur">

 

 

 

<HeaderTemplate>

 

 

 

<table cellspacing="0" cellpadding="0" border="0">

 

 

 

<tr>

 

 

 

<td>

 

 

 

<asp:CheckBox runat="server" ID="chkAll" Enabled="true" onclick="onchkStatusAllClick(this)" />

 

 

 

</td>

 

 

 

<td style="width: 100px;"> All</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</HeaderTemplate>

 

 

 

<ItemTemplate>

 

 

 

<div onclick="StopPropagation(event)">

 

 

 

<asp:CheckBox runat="server" ID="chk1" onclick="onCheckBoxClickRadCboCourseStatus(this)" />

 

 

 

<asp:Label runat="server" ID="Label1" AssociatedControlID="chk1">

 

 

<%

 

# Eval("IssueType")%>

 

 

 

 

</asp:Label>

 

 

 

</div>

 

 

 

</ItemTemplate>

 

 

</telerik:RadComboBox>

 <script type="text/javascript" language="javascript">

        function onchkStatusAllClick(parentChk) {
            var combo =  $find("<%= rdCombIssueTypeID.ClientID %>");;
            var items = combo.get_items();
            var text = "";
            var values = "";

            //enumerate all items
            for (var i = 0; i < items.get_count(); i++) {
                var item = items.getItem(i);
                //get the checkbox element of the current item
                var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

                if (parentChk.checked) {
                    chk1.checked = true;
                    text += item.get_text() + ",";
                    values += item.get_value() + ",";
                }
                else {
                    chk1.checked = false;
                }

            }

            text = removeLastComma(text);
            values = removeLastComma(values);

            if (parentChk.checked) {
                combo.set_text("All Selected");

            }
            else {
                combo.set_text("");
            }

        }

        function onCheckBoxClickRadCboCourseStatus(chk) {

            var combo = $find("<%= rdCombIssueTypeID.ClientID %>");
            //holds the text of all checked items
            var text = "";
            //holds the values of all checked items
            var values = "";
            //get the collection of all items
            var items = combo.get_items();
            //enumerate all items
            var count = 0;
            for (var i = 0; i < items.get_count(); i++) {
                var item = items.getItem(i);
                //get the checkbox element of the current item
                var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");
                if (chk1.checked) {
                    text += item.get_text() + ",";
                    values += item.get_value() + ",";
                    count += 1;
                }
            }
            if (count == 1) {
                text = removeLastComma(text);
                values = removeLastComma(values);
            }
            if (count == items.get_count())
            {
                text = "All Status";
                //chkAll
                var chkHeader = $get(combo.get_id() + "_Header" + "_chkAll");
                chkHeader.checked = true;
            }
            if (count > 1 && count != items.get_count()) {
                var chkHeader = $get(combo.get_id() + "_Header" + "_chkAll");
                chkHeader.checked = false;
            }
            if (count == 0) {
                text = "No selection";
            }
            if (text.length > 0) {
                combo.set_text(text);
            }
            else {

                combo.set_text("");

            }
        }

        var supressDropDownClosing = false;

        function StopPropagation(e) {
            //cancel bubbling
            e.cancelBubble = true;
            if (e.stopPropagation) {
                e.stopPropagation();
            }
        }
        function removeLastComma(str) {
            return str.replace(/,$/, "");
        }

        function OnClientDropDownClosing(sender, eventArgs) {
            eventArgs.set_cancel(supressDropDownClosing);
        }

        function OnClientSelectedIndexChanging(sender, eventArgs) {
            eventArgs.set_cancel(supressDropDownClosing);
        }

        function OnClientDropDownOpening(sender, eventArgs) {
            supressDropDownClosing = true;
        }

        function OnClientBlur(sender) {
            supressDropDownClosing = false;

            sender.toggleDropDown();
        }
 

    </script>

Cori
Top achievements
Rank 2
 answered on 28 Oct 2010
1 answer
46 views
Hi all...

The problem is exactly that, when I filter the grid with the filters commands, how do I maintain those filters with EnableSEOPaging="true"?

When I use the pager, the filter is lost.

I'm using Telerik Q2 2008, although I don't think it makes any difference at all...

Thanks and best regards,
Sérgio Diniz
Tsvetina
Telerik team
 answered on 28 Oct 2010
4 answers
85 views
I have a page with a usercontrol. The usercontrol contains a RadPanelBar, and within this I have a ItemTemplate with a RadTreeView. I need  to do DragAndDrop a HTML element on my page. I put the user control within a radAjaxPanel to ajaxify, but it's do always full postback when using DragAndDrop.
This is the code.

<radA:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="100%" Skin="WebBlue">
        <CollapseAnimation Duration="100" Type="None" />
        <Items>
            <telerik:RadPanelItem Expanded="True" Text="Templates List">
                <Items>
                    <telerik:RadPanelItem >
                        <ItemTemplate>
                             
                             
                                <div class="ff" style="padding: 2px 2px 2px 2px">
                                    Show templates below:</div>
                                <div class="ff" style="padding: 2px 2px 2px 2px">
                                    <asp:DropDownList ID="ddlType" runat="server" class="ff" Width="98%" AutoPostBack="true"
                                        OnSelectedIndexChanged="ddlType_SelectedIndexChanged">
                                        <asp:ListItem Value="0">Product</asp:ListItem>
                                        <asp:ListItem Selected="True" Value="1">Structural</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div id="divProductsToShow" runat="server" class="ff">
                                    <span>
                                        <asp:LinkButton ID="lnkShowRelated" runat="server" Enabled="true" OnClick="lnkShowRelated_Click">Show related</asp:LinkButton>
                                        /
                                        <asp:LinkButton ID="lnkShowAll" runat="server" Enabled="false" Font-Bold="true" OnClick="lnkShowAll_Click">Show all</asp:LinkButton>
                                    </span>
                                </div>
                                <div class="ff" style="padding: 2px 2px 2px 2px">
                                     <radA:RadAjaxPanel ID="RadAjaxPanel8" runat="server">
                                    <telerik:RadTreeView ID="RadTreeView1" runat="server"  EnableDragAndDrop="true" OnNodeDrop="RadTreeView1_NodeDrop" >
                                    </telerik:RadTreeView>
                                    </radA:RadAjaxPanel>
                                </div>
                                <div class="ff" style="padding: 2px 2px 2px 2px">
                                    <a href="mgrCommunicationTemplates3.aspx" class="TableLink">Add Other</a>
                                </div>
                        
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem Expanded="True" Width="100%" Text="Most Used Templates">
                <Items>
                    <telerik:RadPanelItem>
                        <ItemTemplate>
                            <div class="ff" style="padding: 2px 2px 2px 2px">
                                <telerik:RadTreeView ID="RadTreeView2" runat="server" EnableDragAndDrop="true" OnNodeDrop="RadTreeView2_NodeDrop" OnClientNodeDropping="ClientNodeDropping" >
                                </telerik:RadTreeView>
                            </div>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
        <ExpandAnimation Duration="100" Type="None" />
    </telerik:RadPanelBar>
    </radA:RadAjaxPanel>
Maria Ilieva
Telerik team
 answered on 28 Oct 2010
1 answer
156 views
Hi,

Im just testing rad combobox. I need a behaviour like this: http://localhost:59468/radcontrols_aspnetajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx

This is, a dropdownlist with autocomplete. I tried to isolate the example in a test APP, and the combobox is rendered, and partially works. Partially because the autocomplete behaviour does not work!

I did those steps:
- Added telerik dll to a test web project in the bin folder
- Referenced this dll
- Created the controls toolbox referencing this dll
- "drag and drop" the combobox, and setting those properties:

 

 

<telerik:RadComboBox DataSourceID="dsTestData" DataTextField="Name" ID="radCentral" runat="server"

 

 

 

AllowCustomText="true" ExpandAnimation-Type="None" CollapseAnimation-Type="None">

Any idea why the autocomplete does not work?

Thanks

 

Shinu
Top achievements
Rank 2
 answered on 28 Oct 2010
1 answer
48 views
Hi,

Our application Structure is mentioned below:
1) Master Page  header part contains the Rad Menu. On Menu Click Navigates to the respective content page.
2) All our content pages contains the RadGrid
3) We are using WebUserControl for the RadGrid EditForm.
Ref : http://test.aptisys.com/UOMSetup.aspx

I implemented the example with the Need data source, similar to the below mentioned telerik URL, (You can check our url  example in   http://test.aptisys.com/UOMSetup.aspx for reference).

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx

Pls reply back to the below Query and send us some example samples:

 In the RadGrid disabled the EnableViewState="false", when i tried to read the value from the webusercontrol edit form from the code behind content page, while implementing the InsertCommand to insert uom_code, uom_name and uom_desc values returns the empty string from the web user control.
1) How to insert the value using the InsertCommand when the viewstate is set to false?
2) What is the syntex to retrieve value from the webusercontrol edit form to assign to the respective table column in the insert command method?
3) What is the workaround to overcome this problem? 
4) Could you please send us some example how to implement the need data source  to insert, update and delete command when enable view state is set to false?
5) If i implement the heirarchy grid using the Need Data Source with Web User Control as edit form and set the Enable view state = false, does the second level of the heirarchy grid supports Grouping, Sorting, Filtering? Could you please send us some example for the scenario implemented using the need data source with Enable View State is set to false?

 protected void RadGUOM_InsertCommand(object source, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
        //Create new row in the DataSource
        DataRow newRow = this.UOMCode.NewRow();
        //Insert new values
        Hashtable newValues = new Hashtable();
        newValues["uom_code"] = (userControl.FindControl("txtUcode") as TextBox).Text; (*Returns empty string)
        newValues["uom_name"] = (userControl.FindControl("txtUName") as TextBox).Text;(*Returns empty string)
        newValues["uom_desc"] = (userControl.FindControl("txtUdesc") as TextBox).Text;(*Returns empty string)

        //make sure that unique primary key value is generated for the inserted row
     //   newValues["EmployeeID"] = (int)this.Employees.Rows[this.Employees.Rows.Count - 1]["EmployeeID"] + 1;
        try
        {
            foreach (DictionaryEntry entry in newValues)
            {
                newRow[(string)entry.Key] = entry.Value;
            }
            this.UOMCode.Rows.Add(newRow);
            this.UOMCode.AcceptChanges();

        }
        catch (Exception ex)
        {
            Label lblError = new Label();
            lblError.Text = "Unable to insert Employees. Reason: " + ex.Message;
            lblError.ForeColor = System.Drawing.Color.Red;
            RadGUOM.Controls.Add(lblError);

            e.Canceled = true;
        }
        //RadGUOM.DataSource = null;
        //RadGUOM.Rebind();

    }

Mira
Telerik team
 answered on 28 Oct 2010
2 answers
169 views
I'm trying to disallow the up and down arrow key press on the text area of the combo (to ensure users do not accidentally select a different item) and used the following example provided in:
http://www.telerik.com/help/aspnet-ajax/combo-prevent-typing-particular-characters.html.

i am using firebug to step through the problem, the event fires however, the keypress is not disallowed.
I reverted back to example and noticed the example does not work too.

Please advise or post a working example.

<script type="text/javascript">
 function pageLoad() {
        var combo = $find("<%= RadComboBox1.ClientID %>");
        var input = combo.get_inputDomElement();
        input.onkeydown = onKeyDownHandler;
    }

    function onKeyDownHandler(e) {
        if (!e)
            e = window.event;

        var code = e.keyCode;
        //do not allow any of these chars to be entered: !@#$%^&*()
        //if (e.shiftKey && code >= 48 && code  <= 57){
        if (code >= 39 && code <= 40) {
            e.returnValue = false;
            if (e.preventDefault) {
                e.preventDefault();
            }
        }
    }
</script>  

<telerik:RadComboBox runat="server" ID="RadComboBox1" Height="400px"
            Width="100%" AllowCustomText="True"
            ShowMoreResultsBox="True"
            EnableVirtualScrolling="True"
            EnableLoadOnDemand="True"
            HighlightTemplatedItems="true"
            EnableItemCaching ="true"
            onitemsrequested="RadComboBox1_ItemsRequested"  
            onclientselectedindexchanged= "AllowSelectionChanged"
            onclientselectedindexchanging = "AllowSelectionChange"
            OnClientItemsRequesting="OnClientItemsRequesting"
            OnClientTextChange = "ValidateChange" Font-Size="X-Small"
  ShowDropDownOnTextboxClick="False">







Roman
Top achievements
Rank 1
 answered on 28 Oct 2010
1 answer
64 views
Hi,
In my ListView control I have created a couple of buttons to edit/insert items. To go into edit mode or insert mode I have to click the button twice. The events are fired correctly however only with the second click resp the EditItemTemplate or the InsertItemTemplate is loaded.

What could be reason for this behavior?

Found a similar post: click control twice. This is similar to my issue. I do not use a datasource on the page however I set the datasource at page load.

Thanks,
Marc.
Maria Ilieva
Telerik team
 answered on 28 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?