Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
83 views


On page load i bind data to the combobox control but if the user selects the ShowMoreResults arrow
 down button 
to load more items(even though i display all items) it appends the same amount of items
 to the box without clearing the original binded items. even though when the rcboSearch_ItemsRequested is launched it is set to clear the combobox and
indeed stepping through the code it says it has the output on screen is that
the page load data is mixed with the new data.


note if the user starts to type into the combobox the results get cleared.
the problem is only when i append data on page load and select ShowMoreResults
arrow which seems to be present even though 
there shouldnt be any more results to load,
 this triggers 
rcboSearch_ItemsRequested and adds the same amount of data
 as page load to the data already there







<telerik:RadComboBox runat="server" ID="ComboAllContacts"  Width="300"
                ShowMoreResultsBox="true" MaxLength="250" EnableVirtualScrolling="true" EnableLoadOnDemand="true"
                EmptyMessage="Select Area" MarkFirstMatch="false" AllowCustomText="false" HighlightTemplatedItems="false"
                EnableItemCaching="false" MinFilterLength="1" CssClass="fx-areaselector"  OnItemsRequested="rcboSearch_ItemsRequested"
                skin="Fluent" EnableEmbeddedSkins="false" DataValueField="CRMAreaID" ClientIDMode="Static" >
 
     <ItemTemplate>
           <div class="searchResult">
           <div class="profilePicContainer">
          <a  title="View <%# DataBinder.Eval(Container, "Attributes['Name']")%>"><%# DataBinder.Eval(Container,        "Attributes['Name']")%></a>  
         </div>
         </div>
           <div class="separatorTemplate" style="display: none;">
            <h2><%#DataBinder.Eval(Container, "Attributes['Name']")%></h2>
           </div>
       </ItemTemplate>
</telerik:RadComboBox>



<<< Page Load >>>

If Not IsPostBack Then
            Dim currentRowType = String.Empty
 
            Dim ds As DataSet = AreaHelper.GetMyAreas()
            Dim dt As DataTable = ds.Tables(0)
 
 
            ComboAllContacts.DataValueField = "CRMAreaID"
 
            For Each row As DataRow In dt.Rows
 
                Dim item As New RadComboBoxItem
                Dim CRMAreaID As String = row("CRMAreaID").ToString()
                Dim Name As String = row("Name").ToString()
                Dim Region As String = row("Region").ToString()
 
                If currentRowType <> Region Then
                    ' Add separator Row
                    ComboAllContacts.Items.Add(CreateSeparatorItem(Region))
                    currentRowType = Region
                End If
 
 
                item.Value = CRMAreaID.ToString()
                item.Text = Name
 
                item.Attributes.Add("CRMAreaID", CRMAreaID)
                item.Attributes.Add("Region", Region)
                item.Attributes.Add("Name", Name)
                item.Attributes.Add("IsSeparator", False)
                item.Attributes.Add("onclick", "NavigateAreaSelection(" + CRMAreaID + ")")
 
                If Not String.IsNullOrWhiteSpace(item.Text) Then
                    ComboAllContacts.Items.Add(item)
                End If
            Next row
 
 
            ComboAllContacts.DataBind()
 
        End If



<<<ItemsRequested>>>

Protected Sub Protected Sub rcboSearch_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
 
        '' RadComboBox combo = this.FindControl("combo") as RadComboBox;
        ComboAllContacts.ClearSelection()
        ComboAllContacts.Items.Clear()
        ComboAllContacts.Dispose()
        ComboAllContacts.Text = ""
 
 
 
 
        Dim data As DataTable = GetData(e.Text)
 
        Dim itemOffset As Integer = e.NumberOfItems
        Dim endOffset As Integer = data.Rows.Count ''Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count)
        e.EndOfItems = endOffset = data.Rows.Count
 
        'If data.Rows.Count > 0 Then
 
        'End If
 
        Dim currentRowType = String.Empty
 
 
        ''For i As Integer = itemOffset To endOffset - 1
        For Each row As DataRow In data.Rows
 
            Dim item As New RadComboBoxItem
            'Dim CRMAreaID As String = data.Rows(i)("RowID").ToString()
            'Dim rowName As String = data.Rows(i)("Name").ToString()
            'Dim Region As String = data.Rows(i)("Region").ToString()
 
            Dim CRMAreaID As String = row("RowID").ToString()
            Dim rowName As String = row("Name").ToString()
            Dim Region As String = row("Region").ToString()
 
            If currentRowType <> Region Then
                ' Add separator Row
                ComboAllContacts.Items.Add(CreateSeparatorItem(Region))
                currentRowType = Region
            End If
 
 
            item.Value = CRMAreaID
            item.Text = rowName
 
            item.Attributes.Add("CRMAreaID", CRMAreaID)
            item.Attributes.Add("Region", Region)
            item.Attributes.Add("Name", rowName)
            item.Attributes.Add("IsSeparator", False)
            item.Attributes.Add("onclick", "NavigateAreaSelection(" + CRMAreaID + ")")
 
            If Not String.IsNullOrWhiteSpace(item.Text) Then
                ComboAllContacts.Items.Add(item)
            End If
            ''Next row
        Next
 
 
 
        If ComboAllContacts.Items.Count > 0 Then
            ComboAllContacts.DataBind()
        Else
 
        End If
        e.Message = GetStatusMessage(endOffset, ComboAllContacts.Items.Count)(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
 
        '' RadComboBox combo = this.FindControl("combo") as RadComboBox;
        ComboAllContacts.ClearSelection()
        ComboAllContacts.Items.Clear()
        ComboAllContacts.Dispose()
        ComboAllContacts.Text = ""
 
 
 
 
        Dim data As DataTable = GetData(e.Text)
 
        Dim itemOffset As Integer = e.NumberOfItems
        Dim endOffset As Integer = data.Rows.Count ''Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count)
        e.EndOfItems = endOffset = data.Rows.Count
 
        'If data.Rows.Count > 0 Then
 
        'End If
 
        Dim currentRowType = String.Empty
 
 
        ''For i As Integer = itemOffset To endOffset - 1
        For Each row As DataRow In data.Rows
 
            Dim item As New RadComboBoxItem
            'Dim CRMAreaID As String = data.Rows(i)("RowID").ToString()
            'Dim rowName As String = data.Rows(i)("Name").ToString()
            'Dim Region As String = data.Rows(i)("Region").ToString()
 
            Dim CRMAreaID As String = row("RowID").ToString()
            Dim rowName As String = row("Name").ToString()
            Dim Region As String = row("Region").ToString()
 
            If currentRowType <> Region Then
                ' Add separator Row
                ComboAllContacts.Items.Add(CreateSeparatorItem(Region))
                currentRowType = Region
            End If
 
 
            item.Value = CRMAreaID
            item.Text = rowName
 
            item.Attributes.Add("CRMAreaID", CRMAreaID)
            item.Attributes.Add("Region", Region)
            item.Attributes.Add("Name", rowName)
            item.Attributes.Add("IsSeparator", False)
            item.Attributes.Add("onclick", "NavigateAreaSelection(" + CRMAreaID + ")")
 
            If Not String.IsNullOrWhiteSpace(item.Text) Then
                ComboAllContacts.Items.Add(item)
            End If
            ''Next row
        Next
 
 
 
        If ComboAllContacts.Items.Count > 0 Then
            ComboAllContacts.DataBind()
        Else
        End If
        e.Message = GetStatusMessage(endOffset, ComboAllContacts.Items.Count)



Nencho
Telerik team
 answered on 08 Jan 2013
2 answers
258 views
hi, is there a way to simulate a treenode click event from the client side (from javascript)?

e.g. I can do the following in the javascript on the client side:

var treeView = $find("<%=RadTreeView1.ClientID%>");

var selectedNode = treeView.get_selectedNode();

alert(selectedNode.get_text());

selectedNode.expand();


Is there a way to fire a node click event from the javascript?

Thanks,
dbi
Sawyer
Top achievements
Rank 1
 answered on 08 Jan 2013
2 answers
117 views
I've done this in a desktop project, but I can't for the life of me figure out how to do this in webforms?
I have data unioned together so it can be displayed in a pivot grid

Date     | Property | Value

1/1/13   | AAA        | 74
1/1/13   | BBB       | 62
2/1/13   | AAA        | 42
2/1/13   | BBB       | 12
2/1/13   | CCC       | 14
3/1/13   | AAA       | 16
x            | series    | y
Which works fine, I was hoping to display this in the chart, so that we can allow users to alter the graph live based on the pivot grid.

I tried HighCharts but I'd have to run multiple queries to try and separate out x-axis and then the series,
RadCharts is the only way I've been able to display the data in a chart thus far, but the amount of data means that the chart is so small its pointless.

Forgive the obfuscation, you can't tell much from the graph anyway but has to be done!


Gareth
Top achievements
Rank 1
 answered on 08 Jan 2013
2 answers
64 views
How can I keep the date header in TimelineView fixed?  i.e. so that it doesn't scroll vertically with the content.

When there are many rows, you scroll down and the header disappears so then you can't see the dates for each column.
Marbry
Top achievements
Rank 1
 answered on 08 Jan 2013
1 answer
36 views
how can i filter a radgrid using a radcombobox?
Shinu
Top achievements
Rank 2
 answered on 08 Jan 2013
1 answer
98 views
How to persist the checkbox the radgrid after postback? 
Princy
Top achievements
Rank 2
 answered on 08 Jan 2013
1 answer
153 views
Santhosh 
Hi,

I Am using RadAsyncUpload , when i first time open the page and upload at that time it will hung and it will not upload.If i refresh the page and upload then it will upload Properly.Another issue is i am using inside RadWindow RadAsyncUpload,but when i scroll down radwindow, RadAsyncUpload control is also moving with that.please please help,its Very very urgent.

Here is My Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Testupload.aspx.cs" Inherits="Testupload"
    MaintainScrollPositionOnPostback="true" %>

<!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>AFE Addattachment</title>
    <%--<style type="text/css">
        .ruUploadProgress, li .ruCancel, li .ruRemove
        {
            visibility:visible;
        }
        li.ruUploading
        {
            height:1px;
        }
    </style>--%>
</head>
<body>
    <form id="form1" runat="server">
    <%--<asp:ScriptManager ID="ScriptManager1"  runat="server">
    </asp:ScriptManager>--%>
    <telerik:RadScriptManager ID="RadScriptManager2" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Outlook" />
    <%--<telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All"
        EnableRoundedCorners="false" />--%>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
        function ClientFileSelected(source, eventargs) {
            var button = $find("<%= SubmitButton.ClientID %>");
            var button1= $find("<%= ExitButton.ClientID %>");
             button.set_enabled(true)
             button1.set_enabled(true)
             //$telerik.$(args.get_row()).addClass("ruUploading");
             }
             
//             var xPos, yPos;
//      var prm = Sys.WebForms.PageRequestManager.getInstance();

//      function BeginRequestHandler(sender, args) {
//        if ($get('<%=RadUpload1.ClientID%>') != null) {
//          // Get X and Y positions of scrollbar before the partial postback
//          xPos = $get('<%=RadUpload1.ClientID%>').scrollLeft;
//          yPos = $get('<%=RadUpload1.ClientID%>').scrollTop;
//        }
//     }

//     function EndRequestHandler(sender, args) {
//         if ($get('<%=RadUpload1.ClientID%>') != null) {
//           // Set X and Y positions back to the scrollbar
//           // after partial postback
//           $get('<%=RadUpload1.ClientID%>').scrollLeft = xPos;
//           $get('<%=RadUpload1.ClientID%>').scrollTop = yPos;
//         }
//     }

//     prm.add_beginRequest(BeginRequestHandler);
//     prm.add_endRequest(EndRequestHandler);


//var xPos, yPos;
//    var prm = Sys.WebForms.PageRequestManager.getInstance();
//    prm.add_beginRequest(BeginRequestHandler);
//    prm.add_endRequest(EndRequestHandler);
//    function BeginRequestHandler(sender, args) {
//        xPos = $get('RadUpload1').scrollLeft;
//        yPos = $get('RadUpload1').scrollTop;
//    }
//    function EndRequestHandler(sender, args) {
//        $get('RadUpload1').scrollLeft = xPos;
//        $get('RadUpload1').scrollTop = yPos;
//    }
        </script>

    </telerik:RadCodeBlock>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server" Height="300">
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
                    <Windows>
                        <telerik:RadWindow ID="RadWindow1" runat="server" Width="750" Height="300" RestrictionZoneID="RestrictionZoneID"
                            Behaviors="None" VisibleOnPageLoad="true" EnableShadow="true" Title="AFE AddAttachment">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td style="width: 60%" align="left">
                                            <asp:Label ID="AfeNum" runat="server" Text="AFENumber:"></asp:Label>
                                            <asp:TextBox ID="AFENUMBER" runat="server" Enabled="false" OnTextChanged="TextBox1_TextChanged"
                                                Font-Bold="true"></asp:TextBox>
                                        </td>
                                        <td align="right">
                                            <asp:Label ID="Label2" runat="server" Text="WellName:"></asp:Label>
                                            <asp:TextBox ID="WName" runat="server" Width="150px" Enabled="false" OnTextChanged="TextBox2_TextChanged"
                                                Font-Bold="true"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                                <table>
                                    <tr>
                                        <td style="width: 60%" align="left">
                                            Source File To Upload:
                                        </td>
                                        <td align="right" style="width: 19.5%">
                                            Document Type:
                                        </td>
                                    </tr>
                                </table>
                                <table>
                                    <tr>
                                        <td align="left">
                                            <div>
                                                <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
                                                <telerik:RadAsyncUpload runat="server" ID="RadUpload1" MultipleFileSelection="Automatic"
                                                    Localization-Select="Choose File" InputSize="55" OnClientFileSelected="ClientFileSelected" />
                                                <telerik:RadProgressArea runat="server" ID="RadProgressArea1" />
                                            </div>
                                        </td>
                                        <td align="char" style="width: 73%">
                                            <asp:DropDownList ID="DropDownList1" runat="server" Width="130px">
                                                <asp:ListItem>AFE</asp:ListItem>
                                                <asp:ListItem>Completion</asp:ListItem>
                                                <asp:ListItem>Drilling</asp:ListItem>
                                                <asp:ListItem Selected="True">General</asp:ListItem>
                                                <asp:ListItem>Geology</asp:ListItem>
                                                <asp:ListItem>Land</asp:ListItem>
                                                <asp:ListItem>Logs</asp:ListItem>
                                                <asp:ListItem>Marketing</asp:ListItem>
                                                <asp:ListItem>Permits</asp:ListItem>
                                                <asp:ListItem>Pipeline</asp:ListItem>
                                                <asp:ListItem>Regulatory</asp:ListItem>
                                                <asp:ListItem>Reserves</asp:ListItem>
                                                <asp:ListItem>Reservoir</asp:ListItem>
                                                <asp:ListItem>WellReports</asp:ListItem>
                                                <asp:ListItem>WBS</asp:ListItem>
                                                <asp:ListItem>Survey</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td align="right">
                                            <telerik:RadButton runat="server" ID="SubmitButton" Text="Upload files" Enabled="false"
                                                OnClick="SubmitButton_Click" />
                                            <telerik:RadButton runat="server" ID="ExitButton" Text="Exit" Enabled="true" OnClick="ExitButton_Click"
                                                Width="80" />
                                        </td>
                                    </tr>
                                </table>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label4" runat="server" Text="Upload Comments:"></asp:Label>
                                        </td>
                                        <td align="right">
                                        </td>
                                </table>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="TextBox4" runat="server" Height="35px" Width="580px" OnTextChanged="TextBox4_TextChanged"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </telerik:RadWindow>
                    </Windows>
                </telerik:RadWindowManager>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>



Thank You
Santhosh
Plamen
Telerik team
 answered on 08 Jan 2013
4 answers
101 views
I would like to buy a Telerik version that support orgchart and other controls which version I can get please ?
Passant
Top achievements
Rank 1
 answered on 08 Jan 2013
1 answer
37 views
hello sir
I Have A 200000 record in datatable.the datatable initalize the radgrid and page size is 100.then 100 record display then click on page number then the browser display message " Not Found WebPage.".
please solve this Problem
thenku
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Jan 2013
4 answers
112 views
HI,
I have a rad grid. I would like to do the following validations.
1) When the user changes the dropdown value, i want to clear the other row items.
2) when the user does not input any data in the textbox (txtTestId)and tries to insert/edit, i want to provide validation.

Below is the UI of the radgrid:
<telerik:RadGrid ID="radgrid1" runat="server" OnDeleteCommand="radgrid1_DeleteCommand"
                                    OnInsertCommand="radgrid1_InsertCommand" OnUpdateCommand="radgrid1_UpdateCommand"
                                    OnNeedDataSource="radgrid1_NeedDataSource" OnPreRender="radgrid1_PreRender"
                                    CellSpacing="0" GridLines="None" ShowStatusBar="True" 
                                    onitemdatabound="radgrid1_ItemDataBound" 
                                    onitemcommand="radgrid1_ItemCommand">
                                      
<MasterTableView DataKeyNames="TestId" AutoGenerateColumns="false" EditMode="InPlace"
                                        CommandItemSettings-ShowRefreshButton="false" CommandItemDisplay="TopAndBottom"
                                        CommandItemSettings-AddNewRecordText="Add New">
                                        <Columns>
                                            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                            </telerik:GridEditCommandColumn>
                                            <telerik:GridButtonColumn ConfirmText="Delete?" ConfirmDialogType="RadWindow"
                                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="100px"
                                                ConfirmDialogWidth="220px">
                                            </telerik:GridButtonColumn>
  
                                            <telerik:GridTemplateColumn HeaderText="Enter Id" DataField="TestName"
                                                UniqueName="TestName" Visible="true">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtTestName" runat="server" ReadOnly="true" Text='<%# Eval("TestName") %>' />
                                                    <asp:TextBox ID="txtTestId" ReadOnly="true" runat="server" Text='<%# Eval("TestId") %>'
                                                        Width="100px" />
                                                </ItemTemplate>
  
                                                <InsertItemTemplate>
                                                    <asp:DropDownList ID="ddlTestApp" runat="server">
                                                        <asp:ListItem Text="Java" Value="Java"></asp:ListItem>
                                                        <asp:ListItem Text="UIDesign" Value="UIDesign"></asp:ListItem>
                                                    </asp:DropDownList>
                                                    <asp:TextBox ID="txtTestId" runat="server" Width="100px"></asp:TextBox>
                                                    <asp:Button ID="btnInsertFetchData" runat="server" Text="Fetch Details" OnClick="btnInsertFetchData_Click" />
                                                </InsertItemTemplate>
  
                                                <EditItemTemplate>
                                                    <asp:DropDownList ID="ddlTestApp" runat="server" >
                                                       <asp:ListItem Text="Java" Value="Java"></asp:ListItem>
                                                        <asp:ListItem Text="UIDesign" Value="UIDesign"></asp:ListItem>
                                                    </asp:DropDownList>
  
                                                    <asp:TextBox ID="txtNetworkId" runat="server" Text='<%# Eval("TestId") %>'
                                                        Width="100px"></asp:TextBox>
                                                    <asp:Button ID="btnUpdateFetchData" runat="server" Text="Fetch Details" OnClick="btnUpdateFetchData_Click" />
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
  
                                            <telerik:GridTemplateColumn DataField="FirstName" UniqueName="FirstName"
                                                Visible="true" HeaderText="First Name">
                                                <InsertItemTemplate>
                                                    <telerik:RadTextBox ID="RadtxtFirstName" runat="server" Text="" Width="100px">
                                                    </telerik:RadTextBox>
                                                </InsertItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadTextBox ID="RadtxtFirstName" runat="server" Text='<%# Eval("FirstName") %>'
                                                        Width="100px">
                                                    </telerik:RadTextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <telerik:RadTextBox ID="RadtxtFirstName" ReadOnly="true" runat="server" Text='<%# Eval("FirstName") %>'
                                                        Width="100px" />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
    </Columns>
                                    </MasterTableView>
                                    <ClientSettings EnableRowHoverStyle="true">
                                    </ClientSettings>
                                </telerik:RadGrid>

How to achieve this?
Thanks
Shinu
Top achievements
Rank 2
 answered on 08 Jan 2013
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
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
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?