Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
242 views

I am facing an annoying issue regarding the default behavior of RadListBox. If you have a list displayed that is long enough to show the scroll bars, scroll down a bit so the top selection is partially hidden by the top of the list box. When you click on the top selection, the list gets reorganized so that the selected item is now at the bottom of the list.

To see what I'm talking about, you can use the demo: https://demos.telerik.com/aspnet-ajax/listbox/examples/overview/defaultcs.aspx

Scroll down on the left list so that the top of France is cut off, so the top bar of the F is hidden but the lower case letters are all intact. Now select France. You see that the list is repositioned so that France is now at the bottom.

Where this is an issue is when you associate double-click selection to the list. What happens is that on the first click the list gets reorganized, and the second click now selects the new element under the cursor. So using the above example, you double-click France but Brazil gets selected instead.

Is there a way to disable the list reorganization and to retain the scroll position?

 

 

Gilbert
Top achievements
Rank 1
 answered on 13 Apr 2018
0 answers
186 views

Hi;

I'm trying your component. I had added an autocompletebox to a page and created itemtemplate as described in demo. But only client template is working and i can't add attributes to client template. For that reason i need to use serverside template. When i use DropDownItemTemplate , i'm not getting any error but it's showing DataTextField, not template... Here is my code for webservice and aspx;

ClientSide Event for webservice filter

  function requestingIdNr(sender, eventArgs) {
        var context = eventArgs.get_context();
        //Data passed to the service.
        context["ogrnr"] = "det_info";
    }

              <telerik:RadAutoCompleteBox ID="txtNr" runat="server" Width="300px" AllowCustomEntry="true"
                    Filter="StartsWith" DropDownWidth="300px" DropDownHeight="250px" DataTextField="idnr"
                    InputType="Token" MaxResultCount="10" MinFilterLength="3" TextSettings-SelectionMode="Single"
                    AutoPostBack="true" OnClientRequesting="requestingIdNr" OnEntryAdded="txtNr_EntryAdded" OnEntryRemoved="txtNr_EntryRemoved">
                    <WebServiceSettings Method="fillActBoxTC" Path="AutoCompletes.asmx" />
                    <DropDownItemTemplate>
                        <table >
                            <tr>
                                <td style="width: 25%"><%# DataBinder.Eval(Container.DataItem, "idnr")%>
                                </td>
                                <td style="width: 50%">
                                    
                                </td>
                            </tr>
                            <tr>
                                <td>Name:
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "name")%>
                                </td>
                            </tr>
                            <tr>
                                <td>Class:
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "classcode")%>
                                </td>
                            </tr>
                            <tr>
                                <td>Nr:
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "nr")%>
                                </td>
                            </tr>
                        </table>
                    </DropDownItemTemplate>
                </telerik:RadAutoCompleteBox>

And WebService Side :

        [WebMethod(EnableSession = true)]
        public AutoCompleteBoxData fillActBoxTC(RadAutoCompleteContext context)
        {
            string searchString = context.Text;
            idsBE.idsDataTable data = bll.getidsbyNr(((compBE.usrRow)Session["actUser"]).compid, searchString);
            List<AutoCompleteBoxItemData> result = new List<AutoCompleteBoxItemData>();

            foreach (idsBE.idsRow row in data)
            {
                AutoCompleteBoxItemData childNode = new AutoCompleteBoxItemData();
                childNode.Text = row["idnr"].ToString();
                childNode.Value = row["idnr"].ToString();
                childNode.Attributes.Add("idnr", row["idnr"].ToString());
                childNode.Attributes.Add("name", row["name"].ToString());
                childNode.Attributes.Add("classcode", row["classcode"].ToString());
                childNode.Attributes.Add("nr", row["nr"].ToString());
                result.Add(childNode);
            }

            AutoCompleteBoxData res = new AutoCompleteBoxData();
            res.Items = result.ToArray();

            return res;
        }

Alper
Top achievements
Rank 1
 asked on 13 Apr 2018
1 answer
90 views

Hi,

    My tab strip has ContentUrl page, which has charts.

    In some situations these charts becoming invisible and require redraw.

    How can i redraw them from "parent", considering charts being in content page?

Thank you

David

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 13 Apr 2018
1 answer
149 views

Hi,

On an iPhone we cannot scroll down/up by swiping on the main image.

Is this preventable with setting PreventDefaultGestures?

If Yes, how can I set that from codebehind?

 

BR, Marc

Fit2Page
Top achievements
Rank 3
Bronze
Bronze
Iron
 answered on 12 Apr 2018
2 answers
95 views

Hi,

  I would like to display "thinking" icon during the load of my tab strip pages.

  Any recommendation?

Here is simplified version of my code.

      <telerik:RadTabStrip runat="server" ID="rts" MultiPageID="rmp" >
                            <Tabs>
                                <telerik:RadTab Text="Tab1" />
                                <telerik:RadTab Text="Tab2" />                   
                            </Tabs>
                        </telerik:RadTabStrip>
             

                      <telerik:RadMultiPage runat="server" ID="rmp">
                         <telerik:RadPageView ContentUrl="Tab1.aspx"/>
                         <telerik:RadPageView ContentUrl="Tab2.aspx"/>
                      </telerik:RadMultiPage>                         
           

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 11 Apr 2018
0 answers
148 views

Hello.  I've placed a RadAsyncUpload control in a user control and loaded that user control multiple times on a parent user control.  I have javascript which forces the page to do a partial postback OnClientFileUploaded.  The code is firing the wrong "FileUpload" javascript function because it's on the page multiple times and not differentiated.

How can I update how the javascript is handled so that it knows which FileUploaded function to fire?  Thank you!

<asp:UpdatePanel runat="server" ChildrenAsTriggers="true">
    <ContentTemplate>
                  <telerik:RadAsyncUpload ID="RadUpload" runat="server" AllowedFileExtensions=".gif,.jpeg,.jpg,.png"  RenderMode="Lightweight" HideFileInput="true"  OnClientFileUploaded="fileUploaded" OnClientValidationFailed="validationFailed" Localization-Select="Upload Image" Skin="Bootstrap"  />
        
        <asp:Button ID="btnTrigger" runat="server" CausesValidation="false" OnClick="btnUpload_Click" style="display:none"  />
</ContentTemplate>
</asp:UpdatePanel>

 

<script type="text/javascript">
 
       function validationFailed(sender,args)
       {
           $('#<%=lbError.ClientID%>').text("Invalid File Type");
           $('#ImageErrorModal').modal('show');
       }
 
       function fileUploaded(sender, args) {
           
           document.getElementById("<%= btnTrigger.ClientID %>").click();
       }
 
       var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
       pageRequestManager.add_endRequest(EndRequestHandler);
       function EndRequestHandler() {
           if ($('#<%=lbError.ClientID%>').text() != "")
               $('#ImageErrorModal').modal('show');
       }
   </script>

 

Angie
Top achievements
Rank 1
 asked on 11 Apr 2018
3 answers
330 views
Hi!

I am building a custom list on the fly where I build a Hashtable (it could also be a dictionary if needed... it does not matter to me). Then, I insert the hashtables in a list and want to bind the list in a RadGrid.  The problem is that every field of each row is blank (empty). The row count is good which means to me that something is kinda happening but I'm not doing everything correctly!

I've seen another example on the forum where a user was doing a similar thing through a webservice but even when downloading the code, I could not make it work. So here is what I'm doing :

My ASPX :
<telerik:RadGrid ID="gridList" AutoGenerateColumns="False" runat="server">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn
                 HeaderText="Ticker" DataField="SecurityTicker" >
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

My code behind :
Private Sub gridList_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gridList.NeedDataSource
 
    Dim myList As New List(Of Hashtable)
 
    Dim h1 As New Hashtable
    h1.Add("SecurityTicker", "MAX")
    h1.Add("SecPrice", 99)
 
    Dim h2 As New Hashtable
    h2.Add("SecurityTicker", "ZZZ")
    h2.Add("SecPrice", 100)
 
    myList.Add(h1)
    myList.Add(h2)
 
    gridList.DataSource = myList
 
End Sub

What is missing to make that work ?

Thank you!
Matt
Top achievements
Rank 1
 answered on 11 Apr 2018
2 answers
209 views

Good afternoon,

I am trying to use PageLayout on a modal window to show advanced search options, but when I place a radistBox (or normal asp:listbox for that matter) inside the scroll bar in the list box appears but does not work by clicking and dragging - you can scroll the list by clicking inside and using the arrow keys. Trying to click in the scroll bar in fact selects other text in the form. Placing the list box code at the top of the page (out of the Layoutrow) works correctly.

<telerik:LayoutRow RowType="Generic" CssClass="content">

        <Rows>
            <telerik:LayoutRow RowType="Container" WrapperHtmlTag="Div">
                <Columns>
                    <telerik:LayoutColumn Span="3"  >
                    <h3>Select horse(s)</h3>
                    </telerik:LayoutColumn>    
                    <telerik:LayoutColumn Span="3" >
                    <h3>Select horses(s)</h3>
                    <telerik:RadListBox ID="RadListBox1" runat="server" 
                DataTextField="HorseName" DropDownAutoWidth="Enabled" DataValueField="HorseKey"  Width="250"  CheckBoxes="True" Height="200" SelectionMode="Multiple" ShowCheckAll="True" />
                    </telerik:LayoutColumn>   

 

Thanks in advance, Mary

Attila Antal
Telerik team
 answered on 11 Apr 2018
1 answer
171 views

My scenario is I have an order detail and when purchasing I need to keep every good's expiration and lot number.

 

My screen:

--------------------

top: text area

user enter material number, expiration and lot number  and click add button

--------------------

middle: Grid

master grid -- order detail include material number(key), material name, order quantity.

    detail gird -- expiration, lot number, quantity

 

My problem is how do I find the row that the master grid key and material number that I key in matched? And how do I insert the data into the detail grid instead of manual operation such as select row, expand, and click add button?

Eyup
Telerik team
 answered on 11 Apr 2018
1 answer
247 views

I have a situation where i have a listview with a itemtemplate, the template contains a set of radiobuttons and a combobox. Based on the checked value of the radiobutton i need to set the datasource on the combobox but not sure how to accomplish this in the best manner.

My listview,

<telerik:RadListView runat="server" ID="lvTimers" OnNeedDataSource="lvTimers_NeedDataSource">
                                <ItemTemplate>
                                    <div class="timer col-xs-12" data-timerid="">
                                        <div class="row">
                                            <div class="col-xs-3 col-md-2 col-lg-2 center-xs">
                                                <span class="hours">1</span>:
                                                <span class="minutes">21</span>:
                                                <span class="seconds">31</span><br />
                                                <asp:ImageButton runat="server" ID="btnStart" Visible='<%# Eval("StartTime") == null   %>' ImageUrl="~/images/web/icons/play.png" CommandArgument='<%# Eval("TimerId") %>' />
                                                <asp:ImageButton runat="server" ID="btnPause" Visible='<%# Eval("StartTime") != null   %>' ImageUrl="~/images/web/icons/pause.png" CommandArgument='<%# Eval("TimerId") %>' />
                                            </div>
                                            <div class="col-xs-8 col-md-9 col-lg-9">
                                                <asp:RadioButtonList runat="server" ID="rbType" RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="1" Text="FrÃ¥nvaro"></asp:ListItem>
                                                    <asp:ListItem Value="2" Text="Intern"></asp:ListItem>
                                                    <asp:ListItem Value="3" Text="Extern"></asp:ListItem>
                                                    <asp:ListItem Value="4" Text="Övrigt"></asp:ListItem>
                                                </asp:RadioButtonList>
                                                <telerik:RadComboBox runat="server" ID="cmbCustomers"></telerik:RadComboBox>
                                                <telerik:RadComboBox runat="server" ID="cmbProjects"></telerik:RadComboBox>
                                                <%# Eval("TimerId") %>
                                            </div>
                                            <div class="col-xs-1">
                                                <asp:ImageButton runat="server" ID="btnDelete" ImageUrl="~/images/web/icons/delete.png" CommandArgument='<%# Eval("TimerId") %>' />
                                                <asp:ImageButton runat="server" ID="btnUpdate" ImageUrl="~/images/web/icons/update.png" CommandArgument='<%# Eval("TimerId") %>' />
                                                <asp:ImageButton runat="server" ID="btnSave" ImageUrl="~/images/web/icons/save.png" CommandArgument='<%# Eval("TimerId") %>' />
                                            </div>
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </telerik:RadListView>

 

Any helpful soul with any idea how to go about this?

Eyup
Telerik team
 answered on 11 Apr 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?