Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
206 views
I've built an .ascx control that contains a pair of RadListBoxes.  One represents the list of possible items, and the other represents the list of selected items.  Both RadListBoxes are assigned a tabIndex in the codebehind so that they are tab selectable.
        <telerik:RadListBox ID="UnSelectedItems" runat="server" Width="210px" Height="90px" 
            SelectionMode="Multiple" 
            OnKeyDown="UnSelectedItems_OnKeyDown(this, event)" 
            ondblclick="PerformTransfer(this)" TransferToID="SelectedItems" 
            EnableDragAndDrop="true"   CausesValidation="false" OnClick="GainFocus(this)" 
            AllowTransfer="true"
            <ButtonSettings ShowTransferAll="false" Position="Right" /> 
        </telerik:RadListBox> 
     
         
        <telerik:RadListBox ID="SelectedItems" runat="server" Width="210px" Height="90px"  
            OnKeyDown="SelectedItems_OnKeyDown(this, event)"  
            ondblclick="PerformTransfer(this)"  
            SelectionMode="Multiple" EnableDragAndDrop="true" OnClick="GainFocus(this)" 
            CausesValidation="false" AllowTransfer="true" TransferToID="UnSelectedItems"
            <ButtonSettings ShowTransfer="false" ShowTransferAll="false" Position="Right" /> 
        </telerik:RadListBox>    

All of the built in transfers between them using the mouse to click on the arrow buttons works great.  For added usability, I'm binding OnKeyDown functions and OnDblClick functions.  The OnKeyDown functions just checks what key was pressed, and if it was the appropriate key it passes the "sender" parameter to PerformTransfer.  Here is PerformTransfer:
function PerformTransfer(sender) { 
    var senderBox = $find(sender.id); 
 
    if (sender.id.indexOf("UnSelectedItems") > -1) { 
        var recieveBox = $find(sender.id.replace("UnSelectedItems""SelectedItems")); 
    } else if (sender.id.indexOf("SelectedItems") > -1) { 
        var recieveBox = $find(sender.id.replace("SelectedItems""UnSelectedItems")); 
    }
 
    var itemArr = senderBox.get_selectedItems(); 
 
    if (itemArr.length == 0) { return; } 
 
    for (var i = 0; i < itemArr.length; i++) { 
        senderBox.transferToDestination(itemArr[i]); 
    } 
 
    itemArr[itemArr.length - 1].ensureVisible(); 
    recieveBox.clearSelection(); 
    senderBox._getGroupElement().focus(); 

This too works nearly perfectly.  But after I have performed a transfer from SelectedItems to UnSelectedItems using PerformTransfer, the SelectedItems listbox is not functionally focused.  I cannot use the up and down arrow keys to navigate or select items in this box.  I can tab forward to the next element, or backwards to the "UnSelectedItems" box (which still works fine).  Tabbing back and forth shows that "SelectedItems" is being focused, but not in such a way that I can used the keyboard to navigate it.  In order to make it navigable by keyboard again I must click on it (and then only after writing an onclick GainFocus function).

Oddly enough this problem only happens in the "SelectedItems" to "UnSelectedItems" direction.  It works fine in the other direction.

Thanks
--Felix
Genady Sergeev
Telerik team
 answered on 30 Jun 2010
1 answer
96 views
Hi ! I am using RadDock and User control Edit form but when i click edit button inside grid control it does not shows the edit form and the filter of grid also does not work inside RadGrid.. but grid works proper outside RadDock control.

can anyone help me out

Kind Regards
Ali, Murtaza Tahir
Pero
Telerik team
 answered on 30 Jun 2010
3 answers
116 views
Hello,

I created a page called Filter.aspx. This page is called from another page using the following code:

<script type="text/javascript">  
    //<![CDATA[
    function openRadWin()
    {
        window.radopen("Filter.aspx", "aDialog");
    } 
   //]]> 
</script> 
 
 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    <Windows> 
        <telerik:RadWindow ID="aDialog" runat="server" Title="Select" Height="300px" 
              Width="800px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" Behaviors="Close" /> 
    </Windows> 
</telerik:RadWindowManager> 
 
 
<asp:Button ID="btn_CreateFilter" runat="server" Width="80px" Text="Create Filter" onClientclick="openRadWin(); return false;"  /> 

The page Filter.aspx is

    <form id="form_Filter" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        <Scripts> 
            <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2009.3.1314.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Name="Telerik.Web.UI.Common.Core.js" /> 
            <asp:ScriptReference Assembly="Telerik.Web.UI, Version=2009.3.1314.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Name="Telerik.Web.UI.Common.jQuery.js" /> 
        </Scripts> 
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
    </telerik:RadAjaxManager> 
 
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Windows7"></telerik:RadSkinManager> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" skin="Windows7" DecoratedControls="All"/>  
 
 
    <asp:ObjectDataSource ID="ODS_ListUser" runat="server"   
            EnableCaching="True" SelectMethod="GetData" TypeName="SiFiDa.DS_SiFiDaTableAdapters.TA_ListUser" CacheDuration="33">  
    </asp:ObjectDataSource> 
 
    <asp:ObjectDataSource ID="ODS_ListPEFDivision" runat="server"   
            EnableCaching="True" SelectMethod="GetData" TypeName="SiFiDa.DS_SiFiDaTableAdapters.TA_ListPEFDivision" CacheDuration="33">  
    </asp:ObjectDataSource> 
 
    <asp:ObjectDataSource ID="ODS_ListDivision" runat="server"   
            EnableCaching="True" SelectMethod="GetData" TypeName="SiFiDa.DS_SiFiDaTableAdapters.TA_ListDivision" CacheDuration="33">  
        </asp:ObjectDataSource> 
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" > 
      
    <div style="position:absolute;">  
            <label id="lbl_User:" class="DataLabel" style="position: absolute; width: 120px; left: 10px; top: 10px; ">User:</label> 
            <telerik:RadComboBox ID="rcb_User" runat="server"   
                DataSourceID="ODS_ListUser"   
                style="position: absolute; left: 120px; top: 6px;" DataValueField="OID" DataTextField="LastName" 
                EmptyMessage="Select one or more User" HighlightTemplatedItems="true"   
                AllowCustomText="true" Width="590px"   
                Height="300px" MarkFirstMatch="true" > 
                    <ItemTemplate> 
                        <div> 
                            <asp:CheckBox runat="server" ID="cb" Checked="false" /> 
                            <asp:Label runat="server" ID="Label1" AssociatedControlID="cb"><%#Eval("LastName") & " " & Eval("FirstName") %></asp:Label> 
                        </div> 
                    </ItemTemplate> 
            </telerik:RadComboBox> 
      
            <label id="lbl_PEFDivision" style="position: absolute; width: 120px; left: 10px; top: 55px; ">Division:</label> 
            <telerik:RadComboBox ID="rcb_ListDivision" runat="server"   
                DataSourceID="ODS_ListDivision"   
                style="position: absolute; left: 120px; top: 51px;"   
                DataValueField="Division" DataTextField="Division" 
                EmptyMessage="Select one or more Division" HighlightTemplatedItems="true"   
                AllowCustomText="true" Width="590px"                   
                Height="300px" MarkFirstMatch="true" > 
                    <ItemTemplate> 
                        <div> 
                            <asp:CheckBox runat="server" ID="cb" Checked="false" onclick="onCheckBoxClick(this, 'rcb_ListDivision')"/>  
                            <asp:Label runat="server" ID="Label3" AssociatedControlID="cb"><%#Eval("Division")%></asp:Label> 
                        </div> 
                    </ItemTemplate> 
            </telerik:RadComboBox>          
      
    </div> 
      
    </telerik:RadAjaxPanel> 
 
 
      
    </form> 
 

Initially everything is ok. But after about 2 seconds, the second combobox is displayed approx. 50px below the initial position. This occurs in IE8 only. In IE6 and firefox everythings works perfect. When calling the filter.aspx directly everything is perfect too.

I have attached 2 screenshots so you can see what I mean.

Any ideas ?

Thank you
Robert

Georgi Tunev
Telerik team
 answered on 30 Jun 2010
1 answer
61 views
Hello,

I need to edit grid data in code before the server does filtering on it when the filter button is pressed.  The reason I need to do this is because text in my table has a space after it (which means the EndsWith filter doesn't work).  Anyone know the server-side event handler I can use to remove the whitespace before filtering is done on the data?  Or is there some other way to do this?

Thanks,

Ryan
Tsvetoslav
Telerik team
 answered on 30 Jun 2010
1 answer
107 views

Hi,

I am using RadGrid of version "2009.2.701.35". I need have some 5 to 7 columns as invisible columns.  My template column goes like this:
<telerik:GridTemplateColumn HeaderText="" UniqueName="colAttributeId" DataField="AttributeId" ItemStyle-Width="0px" HeaderStyle-Width="0px">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate><asp:Label ID="lblAttributeId" runat="server" Text='<%# Bind("AttributeId") %>'></asp:Label></ItemTemplate>
</telerik:GridTemplateColumn>

 

But in the screen the borders are getting displayed (which we want to avoid). Please see the screenshot attached.

We want to access those data from clientside. If we made the column's visible property as 'False' means we couldnt access those data from clientside javascript code. So we specified the width as "0px".

I tried even setting the border's to 0px, it shows an empty space.
<HeaderStyle BorderStyle="None" BorderWidth="0px" />
<ItemStyle BorderStyle="None" BorderWidth="0px" />

If anyone know how to access the invisible column's data from client-side pls share with me.

Thanks in advance.

 

 

Shinu
Top achievements
Rank 2
 answered on 30 Jun 2010
1 answer
164 views
Hello ,

I have a list box which items are check boxes
I need to add a textbox that filters that list items by the check boxes content
Is there any telerik control that perform this function?

Thanks in advance
Sebastian
Telerik team
 answered on 30 Jun 2010
1 answer
123 views
Is there a parameter to specify WHERE to load the scripts in the resulting markup?

I'd like them to load at the bottom of the page if possible...
T. Tsonev
Telerik team
 answered on 30 Jun 2010
1 answer
152 views
Hello Guys,

I am using from the demos the code to validate a control within the grid and it works well.  I had to add a few additional lines to validate more than one control, and I wonder whether you would review it and tell me whether there is a better way to do it, or if this is optimum.

Thanks a lot, here is the code that works but may need improving.  You can see that I have taken the demo code and then added editor2, cell2, validator2 etc

            if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                GridEditableItem item = e.Item as GridEditableItem; 
                GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor("PersonId"); 
                TableCell cell = (TableCell)editor.TextBoxControl.Parent; 
 
                RequiredFieldValidator validator = new RequiredFieldValidator(); 
                editor.TextBoxControl.ID = "ID_for_validation"
                validator.ControlToValidate = editor.TextBoxControl.ID; 
                validator.ErrorMessage = "You must enter a PersonId"
                cell.Controls.Add(validator); 
 
                GridTextBoxColumnEditor editor2 = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor("ContactWhere"); 
                TableCell cell2 = (TableCell)editor2.TextBoxControl.Parent; 
 
                RequiredFieldValidator validator2 = new RequiredFieldValidator(); 
                editor2.TextBoxControl.ID = "ID_for_validation2"
                validator2.ControlToValidate = editor2.TextBoxControl.ID; 
                validator2.ErrorMessage = "You must enter a H, C or M"
                cell2.Controls.Add(validator2); 
 

Thanks in advance for any comments you wish to make,

Mark Breen
Ireland
1987 BMW R80 g/s

Tsvetoslav
Telerik team
 answered on 30 Jun 2010
4 answers
180 views
Hi,

I am a new user to the Telerik controls.
My requirements are to display, add, edit, activate and deactivate records from the Radgrid.

Now the above functionalities are required to be integrated using code behind, c# pages.
The stored procedures, middle layer c# classes have been written already.

I need to integrate the controls by creating objects of the classes and then bind the controls usign the methods in the classes.
I found the edit and add functionalities have been integrated using the ASPX codes, which is not my requirement.

Code examples would be of great help.

Thanks.

Regards,
Debashis
Debashis Pyne
Top achievements
Rank 1
 answered on 30 Jun 2010
1 answer
79 views
Team,

In my apllication I have RadComboBox for Template Selection.
RadUpload Control for selecting the Word Document .
There's a Button (called Merge) to merge the Word Docs with the Templates.
Problem is, if the merge happens successfully I need to show the Hyperlink otherwise not.
I'm handling this at the Radcombbox selectedindexchanged....but its not working...pls. advise.


thanks
Yana
Telerik team
 answered on 30 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?