Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
189 views
Hello,
I have two list boxes (radFullList and radList) which are linked together for AllowTransfer. Not that it matters but the first listbox is a list of employee names, the value is their employee number. The second listbox is for holding the employee's supervisors so when you move an items from radFullList to radList it maintains the same format, employee name and employee number in the value.

EmployeeEditView.ascx
<telerik:RadListBox ID="radFullList" runat="server" AllowTransfer="True"  
    AllowTransferOnDoubleClick="true" EnableDragAndDrop="true" TransferToID="radList"  
    DataKeyField="GUID" DataSortField="EmployeeName" DataSourceID="LinqDS4"  
    DataTextField="EmployeeName" DataValueField="EmployeeNumber" Height="200px"  
    Width="200px"
    <ButtonSettings ReorderButtons="Common"></ButtonSettings> 
</telerik:RadListBox> 
<telerik:radlistbox ID="radList" runat="server" Height="200px" Width="200px"  
    AllowReorder="true" AllowDelete="true" /> 
<asp:LinqDataSource ID="LinqDS4" runat="server"  
    ContextTypeName="Modules.EmployeeManagement.EmployeeManagementDataContext"  
    TableName="tblEmployees" OrderBy="EmployeeName" > 
</asp:LinqDataSource> 

I have this wired up to a Save button in my Sitefinity Module. 

EmployeeEditView.ascx.vb
Dim sb As New StringBuilder() 
Dim db = New Modules.EmployeeManagement.EmployeeManagementDataContext 
Dim employee = (From t In db.tblEmployees Where t.GUID = Me.DataItemId Select t).Single 
employee.EmployeeNametxtName.Text 
... 
employee.UserGroup = radUserGroup.SelectedValue 
For Each item As RadListBoxItem In radList.Items 
    sb.Append(item.Value.ToString & "|") 
Next 
employee.SupervisorNumber = Left(sb.ToString, 59) 
db.SubmitChanges() 
Response.Redirect(CreateHostViewCommand("EmployeeEditView", DataItemId.ToString, Nothing)) 

So as you can see all I am doing is a simple write from the form.

Scenario: This code works perfectly if the second listbox (radList) is empty. You add 1 or 2 employees to the second list box, hit save and the results written to the database are accurate.

If you go back in to this employee's account, you will see everything is correct. Instead of exiting, if you simply hit Save again all the entries in the second listbox, radList, are duplicated. Both times the same code is used since I am "Updating" the employee both times.

As a test to get screens for this post I edited an employee who has no supervisors. Which you can see in screenshot "001.png". Screenshot "002.png" is after adding two accounts as supervisors. The screenshot is taken after Save is clicked which means not only did it save to the database correctly, but it was loaded into the listbox correctly as well. Now in screenshot "003.png" is after clicking the Save button once more without performing any work with the listboxes. As you can see the two entries are repeated.

As far as I can tell from looking up documentation associated with RadListBox I am using the correct code to cycle through items. "For Each item As RadListBoxItem In radList.Items" Any help you can offer would be greatly appreciated.
Genady Sergeev
Telerik team
 answered on 25 May 2010
7 answers
336 views
I have two tables. Disciplines and DisciplineReveiwers

I assign users (reviewers) to a discipline. The source listbox lists the disciplines and the destination listbox lists the DisciplineReviewers. Populating the boxes and transferring items works well. THe problem is that it does not update the database when doing so. Can some one take a look and tell me what I'm doing wrong? I don't want to update the Disciplines table, just the DisciplinesReviwer table.

 <ul class="listbox-list"
                    <li class="listbox-item"
                         <telerik:RadListBox ID="radListDisciplines" runat="server" AllowTransfer="True" 
                            AutoPostBackOnDelete="True" AutoPostBackOnTransfer="True" DataSourceID="sqlListDisciplines" 
                            TransferToID="radListAssigned" DataTextField="DisciplineName" DataValueField="DisciplineId" Width="300px" DataKeyField="DisciplineId"
                         </telerik:RadListBox> 
                    </li> 
                    <li class="listbox-item"
                        <telerik:RadListBox ID="radListAssigned" runat="server"  
                            DataSourceID="sqlReviewersDisciplines" 
                             DataTextField="DisciplineName" DataValueField="DisciplineId" AllowDelete="True"  
                             AutoPostBack="True" AutoPostBackOnDelete="True" AutoPostBackOnTransfer="True"  
                             DataKeyField="DisciplineReviewerId" TransferToID="radListDisciplines" Width="300px"
                        </telerik:RadListBox> 
                    </li> 
                 </ul> 
<div style="clear:both;"></div>                   
                 
                <asp:SqlDataSource ID="sqlListDisciplines" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>" 
                    SelectCommand="Dej_DisciplineList" SelectCommandType="StoredProcedure"
                    <SelectParameters> 
                        <asp:ControlParameter ControlID="hidOrgId" Name="OrgId" PropertyName="Value" Type="Int32" /> 
                    </SelectParameters> 
                </asp:SqlDataSource> 
                 
                <asp:SqlDataSource ID="sqlReviewersDisciplines" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>" 
                    SelectCommand="Dej_ListDisciplineReviewerByReviewer"  
                    SelectCommandType="StoredProcedure"  
                    DeleteCommand="Dej_DisciplineReviewerDelete"  
                    DeleteCommandType="StoredProcedure"  
                    InsertCommand="Dej_DisciplineReviewerAdd"  
                    InsertCommandType="StoredProcedure"
                    <SelectParameters> 
                        <asp:ControlParameter ControlID="hidReviewerId" Name="UserId" PropertyName="Value" 
                            Type="Int32" /> 
                    </SelectParameters> 
                    <DeleteParameters> 
                        <asp:Parameter Name="DisciplineReviewerId" Type="Int32" /> 
                    </DeleteParameters> 
                    <InsertParameters> 
                        <asp:Parameter Name="DisciplineId" Type="Int32" /> 
                        <asp:Parameter Name="ReviewerId" Type="Int32" /> 
                    </InsertParameters> 
                </asp:SqlDataSource> 

Genady Sergeev
Telerik team
 answered on 25 May 2010
1 answer
41 views
Hi,
I have few issues listed below:-

1) I am trying to Group the Columns which i have made it as ItemTemplates.
In this Case i am not able to Group the Columns accordingly. Please help in this case.

2) FileUpload in RADAjaxmanager -  I am trying to use a Fileupload in RADAjax manager - But i am not able to use the same.

3) I am trying to Change the Colour and Hitting Enter to Filter the RADGrid Columns but i am not able to do this.

Main Conditions is I am Dynamically Generating the Columns from the Source.

Please help me in this Regards.

Thanks and Regards,
Sarvesh Jain.
Yavor
Telerik team
 answered on 25 May 2010
1 answer
81 views
I posted a question before and got great help
http://www.telerik.com/community/forums/aspnet-ajax/window/how-to-get-the-current-position-of-radwindow.aspx


the method in telerik's static client library works very well
var bounds = $telerik.getBounds(oWnd.get_popupElement());

There is the way how I use this method as following.

In main page which contains the radwindowmanager, I added an radwindow "A" under the radwindowmanager. After I opened the radwindow "A", I tried to open another radwindow "B" from radwindow "A" by using the code below.

function ShowWindow() {

               var found = false;

               var allWindows = GetWindowManager().get_windows
               for (var i = 0; i < allWindows.length; i++) {

                   var oWnd = allWindows[i];

                   var bounds = $telerik.getBounds(oWnd.get_popupElement());
           
        if (oWnd._title == "B" ) {

                        found = true;

                       break;

                   }

               }

......
}

in web.config.

<location path="Telerik.Web.UI.WebResource.axd">

    <system.web>

      <authorization>

        <allow users="*" />

      </authorization>

    </system.web>

  </location>


However, recently I always got the error message as below

Message: 'window' is null or not an object

Line: 124

Char: 54

Code: 0

URI: http://srfwpc12.????.com/????/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a8f393b2b-3315-402f-b504-cd6d2db001f6%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-US%3a1c53f111-a7b9-466f-ae26-3bd14c91dc5a%3a16e4e7cd%3af7645509%3a22a6274a%3a24ee1bba%3a1e771326%3a2bef5fcc


I was wondering whether the new probelm is related with some IIS setting or other permission issue? I

Thanks a lot.

 
yao wang
Top achievements
Rank 1
 answered on 25 May 2010
4 answers
151 views
The EmptyMessage shows up fine on initial page load.  I'm setting AllowCustomText="True" and Filter="Contains".  I can select a value and submit it.  But on page postback the selected item shows up in the combobox instead of the EmptyMessage text.

Help!  Thanks.

Here's a link to the example: RadComboBox bug



Matt
Top achievements
Rank 1
 answered on 24 May 2010
2 answers
183 views
For the FileExplorer control, is it possible to hid the Overwrite Files checkbox in the upload window?
Bob van der Zinch
Top achievements
Rank 2
 answered on 24 May 2010
6 answers
139 views
I'm using querry optimization to return data for a particular date range on the schedule.  When I click on the left or right arrow the page is not rebiding the data.  I have to click to go button to get the scheduler to rebind.  Below is the code I'm using.  From all of the examples I've seen this should be working properly but it's not.

<telerik:RadScheduler ID="RadScheduler1" runat="server" Width="900px" TimelineView-NumberOfSlots="5" 
            Skin="Default" EnableEmbeddedSkins="true" EnableEmbeddedBaseStylesheet="false" 
            GroupingDirection="Vertical" OnAppointmentDelete="RadScheduler1_AppointmentDelete" 
            OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" 
            OnFormCreating="RadScheduler1_FormCreating" OnDataBound="RadScheduler1_OnDataBound" 
            OnNavigationComplete="RadScheduler1_NavigationComplete" StartInsertingInAdvancedForm="True" 
            AdvancedForm-ZIndex="2000" AdvancedForm-Modal="True">  
            <MonthView VisibleAppointmentsPerDay="20" AdaptiveRowHeight="true" /> 
            <TimelineView SlotDuration="12:00:00" NumberOfSlots="10" TimeLabelSpan="2" /> 
            <ResourceTypes> 
                <telerik:ResourceType DataSourceID="edsUsers" ForeignKeyField="UserID" KeyField="UserID" 
                    Name="User Name" TextField="UserName" /> 
            </ResourceTypes> 
            <ResourceTypes> 
                <telerik:ResourceType DataSourceID="edsClients" ForeignKeyField="ClientID" KeyField="ClientID" 
                    Name="Client Name" TextField="ClientName" /> 
            </ResourceTypes> 
            <ResourceTypes> 
                <telerik:ResourceType DataSourceID="edsCategories" ForeignKeyField="CategoryID" KeyField="CategoryID" 
                    Name="Category" TextField="Category" /> 
            </ResourceTypes> 
            <ResourceStyles> 
                <telerik:ResourceStyleMapping Type="Category" Text="Out of Office" ApplyCssClass="rsCategoryViolet" /> 
                <telerik:ResourceStyleMapping Type="Category" Text="After Hours" ApplyCssClass="rsCategoryRed" /> 
                <telerik:ResourceStyleMapping Type="Category" Text="Projects" ApplyCssClass="rsCategoryDarkGreen" /> 
                <telerik:ResourceStyleMapping Type="Category" Text="MACs" ApplyCssClass="rsCategoryGreen" /> 
                <telerik:ResourceStyleMapping Type="Category" Text="VNMS" ApplyCssClass="rsCategoryDarkBlue" /> 
                <telerik:ResourceStyleMapping Type="Category" Text="IPT/Engineering" ApplyCssClass="rsCategoryDarkRed" /> 
                <telerik:ResourceStyleMapping Type="Category" Text="Other" ApplyCssClass="rsCategoryOrange" /> 
            </ResourceStyles> 
            <TimeSlotContextMenuSettings EnableDefault="true" /> 
            <AppointmentContextMenuSettings EnableDefault="true" /> 
        </telerik:RadScheduler> 
    </telerik:RadAjaxPanel> 

protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack)  
        {  
            ddlView.SelectedIndex = 1;  
            RadScheduler1.SelectedView = SchedulerViewType.TimelineView;  
            RadScheduler1.SelectedDate = DateUtilities.GetStartOfCurrentWeekMonday();  
            BindSchedule();  
        }  
 
        RadScheduler1.GroupBy = RadComboBox1.SelectedValue;  
    }  
 
 private void BindSchedule()  
    {  
        RadScheduler1.DataSource = TED.BLL.Appointment.Appointments(SafeValue.SafeInt(ddlView.SelectedValue),SafeValue.SafeInt(ddlCategory.SelectedValue),SafeValue.SafeInt(ddlClientName.SelectedValue),Users,RadScheduler1.VisibleRangeStart, RadScheduler1.VisibleRangeEnd);  
        RadScheduler1.DataKeyField = "ID";  
        RadScheduler1.DataStartField = "Start";  
        RadScheduler1.DataEndField = "End";  
        RadScheduler1.DataSubjectField = "Subject";  
        RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID";  
        RadScheduler1.DataRecurrenceField = "RecurrenceRule";  
 
        RadScheduler1.DataBind();  
    }  
 
protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)  
    {  
        RadScheduler scheduler1 = (RadScheduler)sender;  
        if (e.Command == SchedulerNavigationCommand.SwitchToMonthView)  
        {  
            scheduler1.OverflowBehavior = OverflowBehavior.Expand;  
        }  
        else  
        {  
            scheduler1.OverflowBehavior = OverflowBehavior.Scroll;  
        }  
        BindSchedule();  
    } 


Timothy Kruszewski
Top achievements
Rank 1
 answered on 24 May 2010
1 answer
206 views
I've been trying to solve this problem for about 12 hours now...

I have a panelbar with multiple sections. On Page Load (or when the user switches to a different panel section) I want to populate that section textboxs with the appropriate information from the SQL query in Code Behind (or anywhere else that will work in each section).

For example:

Panel 1 - Login Information
---- Login:         asp textbox ID: txtLogin
---- Password:  asp textbox ID: txtPassword1
---- Confirm Password: asp textbox ID: txtPassword1
---- "Save Button"

When clicking the save button I want to save the section data back to the database and do a postback to the same section.

In code behind doing a simple query to member data base using Member_ID as filter.
For example: (sudo code)
Session("MemberID") = "760"
Select Member_ID, mem_login, mem_pass from Personal_Info Where Member_ID = Session("MemberID")

The query returns:
mem_login: jadam
mem_pass: xxxxx

Here's the code behind:

 Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
 
        'Get User login information from database  
          
        Dim ConnectionString As String = ConfigurationManager.ConnectionStrings("AcvpmDataCS").ConnectionString  
        Dim conn As New SqlConnection(ConnectionString)  
        Dim cmd As New SqlCommand("Select Member_ID, mem_login, mem_password FROM Personal_Info WHERE Member_ID = @member_id", conn)  
          
        Using conn  
            conn.Open()  
            cmd.Parameters.AddWithValue("@member_id", Session("MemberID"))  
 
            Dim Reader As SqlDataReader = cmd.ExecuteReader  
            While Reader.Read()  
                Dim txtLogin As TextBox = CType(RadPanelBar1.FindControl("txtLogin"), TextBox)  
                txtLogin.Text = Reader("mem_login").ToString  
 
            End While 
            conn.Close()  
        End Using  
 
    End Sub 


I've tested the query (used it in other places) and the query returns the proper information I just don't know how to map the panelbar items to the SQL Select results.

I want to have a "Save" button in each panel section since there is a lot of information on each user (over 360 fields) spread out through multiple sections of the PanelBar. 

Panel 2 - Home Address
Same setup as login with labels and textboxes of their address information

Panel 3 - Busines Address
etc.

Any suggestions?
Thanks,
Joe
Nikolay Tsenkov
Telerik team
 answered on 24 May 2010
20 answers
546 views
I am using Q3 2008 radmenu.

I tried the width=900 property and it does not change my menu width.

How do I get the menu width to extend across the width of my page?

---

Nevermind. This does work. I guess my page was cached.

It would be nice to be able to delete these if no one has answered yet. :)

priyanshu atreya
Top achievements
Rank 1
 answered on 24 May 2010
2 answers
429 views
Hello all,
I have been trying to figure this out and I can't seem to find any documentation on it, and any functions that might just do what I need to accomplish it client side.

scenario: I have a grid bound through  a web service, works great!
in my grid I have a GridTemplateColumn

                                <telerik:GridTemplateColumn HeaderText="Claiming" UniqueName="AmountToClaim"
                                        <ItemStyle CssClass="EclaimClaimAmount" /> 
                                        <HeaderStyle Width="75px" HorizontalAlign="center" /> 
                                        <ItemTemplate> 
                                            <asp:TextBox ID="Step3TitlesClaimAmountTextBox" EnableViewState="false" onKeyDown="return OnlyAllowNumbers(this);" 
                                                runat="Server" CssClass="standardTextBoxClaimedAmount" onfocus="CalculateTotals('standardTextBoxClaimedAmount', 'textBoxStandardClaimedFooter')" 
                                                onblur="CalculateTotals('standardTextBoxClaimedAmount', 'textBoxStandardClaimedFooter'); CheckBalance();"></asp:TextBox> 
                                        </ItemTemplate> 
                                        <FooterTemplate> 
                                            <span style="color: Yellow; font-weight: 600;">Total: </span> 
                                            <asp:TextBox ID="Step3TitlesClaimAmountFooterTextBox" EnableViewState="false" runat="server" 
                                                CssClass="textBoxStandardClaimedFooter" BorderStyle="none" BackColor="#0075BD" 
                                                ForeColor="white" Font-Bold="true"
                                            </asp:TextBox> 
                                        </FooterTemplate> 
                                    </telerik:GridTemplateColumn> 

this is the javascript function I've come up with so far
    function ValidateMoney() { 
        var grid = $find("<%=Step3TitlesRadGrid.ClientID%>"); 
        var tableView = grid.get_masterTableView(); 
        var items = tableView.get_dataItems(); 
        for(var i = 0; i<items.length; i++){ 
            var rowValues = items[i].get_dataItem(); 
            if(rowValues.ApprovedAmount < ??how to get the text vale?? ){ 
            } 
        } 
    } 

using javascript how would I loop through rows in this grid and get the value of each Step3TitlesClaimAmountTextBox

Any help or pointers would be greatly appreciated 

Thank you,
Josh
Josh
Top achievements
Rank 1
 answered on 24 May 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?