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

I have a user control with an AjaxManagerProxy on it, a RadComboBox, a button, and a RadWindow. Users click the button to open the RadWindow to add an item to the RadComboBox. After they click save, the record is inserted into the database, the window is closed and a javascript method is executed to "rebind" the combobox. Unfortunately the combobox items are not updated, however, if I click the button to add another item and just close the window the list is updated. If I click the button and add another button, the item I previously added appears in the list but not the current one.

Here is some code from the user control.

    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnNewDepartment">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdoDepartment" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
          
<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server">
    <Windows>
        <telerik:RadWindow ID="NewDepartmentDialog" runat="server" Width="500px" Left="150px" Height="425px" Behaviors="Close" Title="New Department Details" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" OnClientClose="OnDepartmentWindowClose" />
    </Windows>
</telerik:RadWindowManager>
      
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="20">
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" />
    </telerik:RadAjaxLoadingPanel>

<telerik:RadComboBox ID="rdoDepartment" runat="server" width="300px" DataTextField="DepartmentName" DataValueField="DepartmentCode" MarkFirstMatch="true" /><asp:TextBox ID="txtEmployeeDepartmentRegularlyWorked" runat="server" MaxLength="50" Width="150px" />

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript" language="javascript">
        function ShowInsertForm() {
            window.radopen("Window.aspx", "NewDepartmentDialog");
            return false;
        }
        function OnDepartmentWindowClose(sender, args) {
            $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("rebindDepartment");
        }
    </script>
</telerik:RadCodeBlock>

Protected Sub manager_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)
    Select Case e.Argument
        Case "rebindDepartment"
            Me.rdoDepartment.Items.Clear()
            Me.rdoDepartment.DataSource = db.SPs.CompanyDepartmentListSelect(Utility.GetCompanyKey).GetDataSet
            Me.rdoDepartment.DataBind()
            Me.rdoDepartment.Items.Insert(0, New RadComboBoxItem("", ""))
    End Select
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
    AddHandler manager.AjaxRequest, AddressOf manager_AjaxRequest
End Sub

Please advise.
Maria Ilieva
Telerik team
 answered on 10 Aug 2010
1 answer
119 views
Hello,

I'm having a wierd display error where certain calendar events are visually cut off (see screen shot).  I've investigated and found no difference in the data between ones that work and ones that done.  

I'm adding items to the calendar in C# using objects that inherit from IAppointmentData (see below).  

Has someone seen this before?  Thanks.

Steven

//map to appointment objects
foreach (DataRow row in events.Tables[0].Rows)
{
    DateTime startDate = (DateTime)row["Event_StartDate"];
    DateTime endDate = (DateTime)row["Event_EndDate"];
 
    if (startDate <= endDate)
    {
        AppointmentData apt = new AppointmentData();
        apt.Start = startDate;
        apt.End = endDate;
        //apt.Attributes.Add("ProgramName", row["ProgramName"].ToString());
        apt.Description = row["ProgramName"].ToString();
        apt.Subject = "<b>" + row["Event_Title"].ToString() + "</b><br><i>" + row["ProgramName"].ToString() + "</i>";
 
        //apt.Description = row["Event_Description"].ToString();
        apt.ID = row["EventId"].ToString();
 
        if (!addedAppts.Contains(apt.ID.ToString()))
        {
            appts.Add(apt);
            addedAppts.Add(apt.ID.ToString());
        }
    }
}

Veronica
Telerik team
 answered on 10 Aug 2010
4 answers
201 views
I have a radGrid in a user control that I am basically using as a way for the user to select a list of companies and cost centers for which they want combined into a report.  I am using the "Grid / Client-side Row Selection" grid 2 as an example.

The purpose of my user control is to return a string containing an XML representation of the selected items.  The first column in my grid is a GridClientSelectColumn.  If I click on the checkbox in the header, it selects all items, but if I uncheck one of the items, it does not uncheck the checkbox in the headers.  This works in the sample mentioned above.

My user control looks like:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="gridEntitiesAndCCs.ascx.vb" Inherits="gridEntitiesAndCCs" %>
<link href="CTM.css" rel="stylesheet" type="text/css" />
<telerik:RadGrid ID="gridEntitiesAndCCs" runat="server" AllowSorting="True" AllowMultiRowSelection="true" 
  AutoGenerateColumns="False" GridLines="None">
  <MasterTableView DataKeyNames="EntityID,CostCtr" AllowMultiColumnSorting="true">
    <Columns>
      <telerik:GridClientSelectColumn UniqueName="clientSelect" >
        <ItemStyle Width="25" />
      </telerik:GridClientSelectColumn>
      <telerik:GridBoundColumn DataField="ShortName" HeaderText="Entity" 
        SortExpression="ShortName" UniqueName="ShortName">
      </telerik:GridBoundColumn>
      <telerik:GridBoundColumn DataField="CostCtr" HeaderText="Cost Center" 
        SortExpression="CostCtr" UniqueName="CostCtr">
      </telerik:GridBoundColumn>
      <telerik:GridBoundColumn DataField="DeptName" HeaderText="Dept Name" 
        SortExpression="DeptName" UniqueName="DeptName">
      </telerik:GridBoundColumn>
    </Columns>
  </MasterTableView>
  <ClientSettings>
    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    <Selecting AllowRowSelect="true" />
  </ClientSettings>
</telerik:RadGrid>

and my code-behind looks like:
Partial Class gridEntitiesAndCCs
  Inherits System.Web.UI.UserControl
  
  Public ReadOnly Property selectedValues() As String
    Get
      Return Me.getCheckedRowDetails()
    End Get
  End Property
  
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
  End Sub
  
  Protected Sub gridEntitiesAndCCs_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gridEntitiesAndCCs.NeedDataSource
    Dim ds As DataSet = MM.getUserEntitiesAndCostCenters()
    gridEntitiesAndCCs.DataSource = ds
  End Sub
  
  Private Function getCheckedRowDetails() As String
    Dim row As GridItem
    Dim entityID As String
    Dim costCtr As String
  
    Dim dstCCs As New DataSet
    Dim dtblCCs As DataTable = New DataTable("EntsCCs")
    dstCCs.Tables.Add(dtblCCs)
    dtblCCs.Columns.Add(New DataColumn("entityID", GetType(String)))
    dtblCCs.Columns.Add(New DataColumn("costCtr", GetType(String)))
    Dim drowItem As DataRow
  
    For Each row In gridEntitiesAndCCs.SelectedItems
      entityID = row.OwnerTableView.DataKeyValues(row.ItemIndex)("EntityID")
      costCtr = row.OwnerTableView.DataKeyValues(row.ItemIndex)("CostCtr")
      drowItem = dtblCCs.NewRow()
      drowItem("entityID") = entityID
      drowItem("costCtr") = costCtr
      dtblCCs.Rows.Add(drowItem)
    Next
  
    Return dstCCs.GetXml()
  End Function
End Class

I don't see anything different in the example that would cause the checkbox in the header to be not cleared when I uncheck a row.  Any ideas?

Also, is it possible to check to see what the status of the checkbox in the header is?  If I knew that the checkbox in the header was checked - and the above problem is resolved ;^) - then I would not need to process each record.  I could simply return a different value to indicate that all rows are selected.

Thanks!


Tsvetoslav
Telerik team
 answered on 10 Aug 2010
1 answer
42 views
I have a client that is unable to see the Image Manager, Hyperlink Manager, or other related pop-up dialogs, instead the dialog opens to a blank window.  This only seems to happen in their IE 8 but it happens on multiple computers.  When I open it in IE 8 it works fine for me and when they use Firefox it opens just fine.  Is there any known security setting or other setting in IE 8 that may cause this issue?
Rumen
Telerik team
 answered on 10 Aug 2010
2 answers
68 views
Hi there,

Inheriting RadAsyncUpload seems to break it. To reproduce it - create a class that inherits RadAsyncUpload with absolutely no code in it and try using it (in the same project). The upload control is shown but click does nothing.

Best regards,
V.
Valery
Top achievements
Rank 2
 answered on 10 Aug 2010
0 answers
88 views
I need to control the tree view horizontal scroll so that I can view the child node completely.
I mean when I set some child node selected in javascript or c# it gets selected but the horzontal scroll is alligned to the left so I can not view the node. I want to move it to the right.
Dheeraj Khajuria
Top achievements
Rank 1
 asked on 10 Aug 2010
4 answers
109 views
I am using RadRotator to display photos on a home page.  The site is slow to load and I think every image in the xml file feeding the rotator is loading rather than just the initial photo.  I don't want every photo in the list to have to load before the visitor sees the page.  I didn't see any reference to controlling the loading of images in the documentation. Any ideas on how to fix this?

Thanks
Svetlina Anati
Telerik team
 answered on 10 Aug 2010
1 answer
90 views
The grid I have has a number of columns in it.  However, they should all fit into my screen without any necessary scrolling.  Sometimes it seems that it just gives "too much width" to each column when it doesn't need to.

Is there a way to have the grid columns minimize the widths so as to avoid any sort of horizontal scrolling when there doesn't need to be any?
Pavlina
Telerik team
 answered on 10 Aug 2010
3 answers
141 views
HEllo,

In my application i have created a context menu for scheduler with the option "SHOW" , "ORDER" , "COPY" and PASTE" , when i run the application ON IE7 / IE 8, and open the scheduler and do the right click , i can view all above options, and its functioning..

But when my this application on Fire fox browser , and open the scheduler and do the right click , displayed default Firefox option...

How can i view my custom context menu for Firefox???

Regards
Samir
Ingo Buck
Top achievements
Rank 1
 answered on 10 Aug 2010
1 answer
121 views
I have a column with dynamic values that I am setting at run time in the Item_DataBound event like so:

Private Sub rgDefects_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgDefects.ItemDataBound
    'don't process anything other than data rows
    If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then
        With DirectCast(e.Item, Telerik.Web.UI.GridDataItem)
            'set the UOM_Text based upon the UM based upon the UM
            .Item("UM").Text = Measure.DisplayUoM(UnitType.Linear, UserAccount.UnitSystemPreference)
        End With
    End If
End Sub

But when I edit the row, the column just displays as System.Data.DataRowView (because technically the bound column isn't bound, just change the cell contents at ItemBound).  What is the corresponding event or method I should use to control this when the row is in editmode?

Princy
Top achievements
Rank 2
 answered on 10 Aug 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?