Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
71 views

Daniel Luchin
Top achievements
Rank 1
 asked on 28 Jan 2010
4 answers
221 views
Hello,

I have a manual implementation using asp:ListBoxes and asp:Buttons.  It also adds/removes an asp:DropDownList when transferring back and forth from the 2 ListBoxes.

I'm converting it to use RadListBoxes and a RadComboBox.  Creating RadListBox1 and RadListBox2 and transferring between the 2 was simple enough.  Then I used the OnTransferring Event to invoke a method that will add and remove from RadComboBox1.  I have a couple of problems completing this:

- How do I get access in OnTransferring (or other event) to the button selected... To Right(>), To Left(<), All to Right(>>), or All to Left(<<) ?
- In what event, or how... can I invoke a "RemoveFromComboBox" method when selecting/moving back To Left, or All to Left ?

Here's my code:
<td><telerik:RadComboBox ID="RadComboBox1" runat="server" /></td>  
<td>  
   <telerik:RadListBox ID="RadListBox1" runat="server" Height="200px" Width="200px"   
      AllowTransfer="true" TransferToID="RadListBox2"    
      AutoPostBackOnTransfer="true"  
      SelectionMode="Multiple" EnableDragAndDrop="true"   
      OnTransferring="RadListBox1_Transferring" />  
</td>  
<td>  
   <telerik:RadListBox ID="RadListBox2" runat="server" Height="200px" Width="200px"   
      AutoPostBackOnTransfer="true"  
      SelectionMode="Multiple" EnableDragAndDrop="true" />  
</td> 

and code-behind:

protected void RadListBox1_Transferring(object sender, RadListBoxTransferringEventArgs e) 
{ 
   AddToDefaultComboBox(true); 
   RemoveFromDefaultComboBox(true);  // Needs to be in different event to return back to left. (maybe RadListBox2_Transferring).  But RadListBox2.AllowTransfer="false" ??? find solution. 
} 

// Adds item(s) to RadComboBox1 when transferring from RadListBox1 to RadListBox2
private void AddToDefaultComboBox(bool all) 
{ 
   foreach (RadListBoxItem li in RadListBox1.Items) 
   { 
      if ((li.Selected) || (all)) 
      { 
         RadComboBox1.Items.Add(new RadComboBoxItem(li.Text, li.Value)); 
      } 
   } 
}

// Removes item(s) to RadComboBox1 when transferring from RadListBox2 to RadListBox1
private void RemoveFromDefaultComboBox(bool all) 
{ 
   foreach (RadListBoxItem li in RadListBox2.Items) 
   { 
      if ((li.Selected) || (all)) 
      { 
         RadComboBox1.Items.Remove(RadComboBox1.Items.FindItemByValue(li.Value)); 
      } 
   } 
} 

I've tested these methods, and they do the job, but I need pass these 4 based on what's selected:
  1. AddToDefaultComboBox(false)             --> When selecting RadListBox1 item (to right >)
  2. AddToDefaultComboBox(true)              --> When selecting RadListBox1 items (all to right >>)
  3. RemoveFromDefaultComboBox(false) --> When selecting RadListBox2 item (< to left)
  4. RemoveFromDefaultComboBox(true)  -->  When selecting RadListBox2 items (<< all to left)

I hope this makes sense and thank you in advance for reviewing this and any assistance.
Ronnie


Cary
Top achievements
Rank 2
 answered on 28 Jan 2010
1 answer
101 views
Hello dear experts.

I trie  to export the value of the grid to excel. All columns except columns of numeric export correctly.
Does anyone know how to solve this problem?

Best regards
Krzysztof

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
            GridLines="None" AllowFilteringByColumn="True" AllowSorting="True" ShowGroupPanel="True" 
            ShowFooter="True">  
            <MasterTableView DataSourceID="SqlDataSource1">  
                <Columns> 
                    <telerik:GridBoundColumn DataField="nr_ewid" HeaderText="Nr ewid." AllowFiltering="true" 
                        UniqueName="nr_ewid">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="nr_dok" HeaderText="Nr fakt." AllowFiltering="true" 
                        UniqueName="nr_dok">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="nazwa" HeaderText="Wystawca" AllowFiltering="true" 
                        UniqueName="nazwa">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridDateTimeColumn DataField="data_wplyw" HeaderText="WpÅ‚yneÅ‚a" DataFormatString="{0: dd-MM-yyyy}" 
                        AllowFiltering="true" HeaderStyle-Width="90px" ItemStyle-Width="90px" UniqueName="data_wplyw">  
                    </telerik:GridDateTimeColumn> 
                    <telerik:GridDateTimeColumn DataField="data_wyst" HeaderText="Wystawiona" DataFormatString="{0: dd-MM-yyyy}" 
                        AllowFiltering="true" HeaderStyle-Width="90px" ItemStyle-Width="90px" UniqueName="data_wyst">  
                    </telerik:GridDateTimeColumn> 
                    <telerik:GridNumericColumn DataField="wartosc" HeaderText="Kwota brutto" Aggregate="Sum" 
                        AllowFiltering="true" UniqueName="wartosc" KeepNotRoundedValue="true">  
                    </telerik:GridNumericColumn> 
                    <telerik:GridNumericColumn DataField="wartosc_netto" HeaderText="Kwota netto" Aggregate="Sum" 
                        AllowFiltering="true" UniqueName="wartosc_netto" KeepNotRoundedValue="true">  
                    </telerik:GridNumericColumn> 
                    <telerik:GridBoundColumn DataField="w_obiegu" HeaderText="W obiegu" AllowFiltering="true" 
                        UniqueName="w_obiegu">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="do" HeaderText="Pracownik" AllowFiltering="true" 
                        UniqueName="pracownik">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="przetrzymuje" HeaderText="Przetrzymuje" AllowFiltering="true" 
                        UniqueName="przetrzymuje">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="status" HeaderText="Status" AllowFiltering="true" 
                        UniqueName="status">  
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">  
                <Selecting AllowRowSelect="True" /> 
                <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
            </ClientSettings> 
        </telerik:RadGrid> 

  Protected Sub cmb_excel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmb_excel.Click  
 
        RadGrid1.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML  
        RadGrid1.ExportSettings.ExportOnlyData = True 
        RadGrid1.MasterTableView.ExportToExcel()  
 
    End Sub 
Daniel
Telerik team
 answered on 28 Jan 2010
12 answers
179 views
Hi all,

It appears that I'm getting a clash between the Twitter Widget (which allows you to show your tweets directly on your website) and the Telerik RadMenu. The reason I reckon there's a clash is because I've tested a static page with the twitter code on it that fails when the same page has a RadMenu on it, but works when the RadMenu is completely removed.

Basically, I get a Javascript error saying "object doesn't support this property or method (user_timeline.json)".

Anyone have any suggestions?
msigman
Top achievements
Rank 2
 answered on 28 Jan 2010
1 answer
95 views
Hello,

I have a RadGrid with Paging enabled.  On this grid, I have a GridClientSelectColumn.  Currently, on Client Side, I am using Javascript to track which rows have been selected (so that if the user pages through the grid and returns to an earlier page, they will still see the checkboxes that they originally checked).

The issue that I am running into is, I need to also have a list of selected items for use on the server side.  However, I do not want to perform a post back on the radgrid each time a row is selected or unselected. 

Is there a way to do this without having to perform a post back, such as getting my object from javascript and throwing it into Server side somewhere? 

Thanks,
Dave
Tsvetoslav
Telerik team
 answered on 28 Jan 2010
5 answers
125 views
Can the approach shown in the "Scheduler / Using RadToolTip" demo example be used with a RadScheduler control that is getting it's data using a WebService?

I've tried setting up the following:

    <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional"> 
    <ContentTemplate> 
     
        <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="WeekView" SelectedDate="2009-02-02" 
            TimeZoneOffset="03:00:00"  
            StartEditingInAdvancedForm="false"  
            EnableCustomAttributeEditing="false"  
            OnClientAppointmentsPopulating="initRadScheduler" 
            OnClientAppointmentsPopulated="appointmentsLoaded"  
            OnClientAppointmentDataBound="appointmentDataBound"  
            OnClientAppointmentMoveEnd="appointmentMoveEnd"  
            OnClientAppointmentMoving="appointmentMoving"> 
            <WebServiceSettings Path="SchedulerWebService.asmx" ResourcePopulationMode="ServerSide" /> 
        </telerik:RadScheduler> 
         
        <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="320" Height="210" 
            Animation="None"  
            HideEvent="LeaveToolTip"  
            Text="Loading..."  
            RelativeTo="Element" 
            OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"  
            OnClientBeforeShow="clientBeforeShow"/>        
 
    </ContentTemplate> 
    </asp:UpdatePanel> 
 

But I never seem to get a call to RadToolTipManager1_AjaxUpdate.

Thanks,
Greg


Greg Mercer
Top achievements
Rank 1
 answered on 28 Jan 2010
4 answers
130 views
Hi, i have a radmenu inside a column in a radgrid, and everything was working fine, but when i upgraded to firefox 3, the radmenus start to display a problem, the option list of the menu doesn't appear hover the remaing columns and rows of the grid, as it used to.

Here is a sample code:

<rad:RadGrid ID="RadGrid1" SkinID="DetalheCandidato" runat="server" AutoGenerateColumns="false" AllowPaging="false" EnableAJAX="true" ShowHeader="true" EnableAJAXLoadingTemplate="true"AllowSorting="true" Skin="None" MasterTableView-ShowHeadersWhenNoRecords="false" LoadingTemplateTransparency="50" onitemcreated="rad_Candidatos_ItemCreated" onitemcommand="rad_Candidatos_ItemCommand" onselectedindexchanged="rad_Candidatos_SelectedIndexChanged" onsortcommand="rad_Candidatos_SortCommand">

<AJAXLoadingTemplate>
<asp:Image ID="imgLoa" runat="server" ImageUrl="~/BackOffice/Images/timer.gif" />
</AJAXLoadingTemplate>

<MasterTableView DataKeyNames="TbcaID,UsrGUI,TbcaGUI">

<Columns>

<rad:GridTemplateColumn HeaderText="opes" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" ItemStyle-Width="90px">

<ItemStyle HorizontalAlign="Center" />

<ItemTemplate>

<rad:RadMenu ID="RadMenuCmd" runat="server" Flow="Vertical" Skin="Default2006" SkinsPath="~/RadControls/Menu" EnableTheming="true">

<Items>
<rad:RadMenuItem Text="choices">

<Items>

<rad:RadMenuItem>

<ItemTemplate>

<asp:LinkButton ID="LNB_Select" runat="server" Text="Ver perfil" CommandName="Select"></asp:LinkButton>

<br />

<asp:LinkButton ID="LNK_ConsDocs" runat="server" CommandName="Navigate">Consultar Documentos</asp:LinkButton>

<br />

Pedir Anlise do Perfil Pessoal (APP)

<br />

<asp:LinkButton ID="LNB_PontCandidato" runat="server" CommandName="Edit">Pontuar Candidato</asp:LinkButton>

<br />

<asp:LinkButton ID="LNB_CatCandidato" runat="server" CommandName="Navigate">Categorizar Candidato</asp:LinkButton>

<br />

Copiar Candidato para Pasta

<br />

Inserir comentrio sobre Candidatura

<br />

<asp:LinkButton ID="LNB_SolCont" runat="server" CommandName="Navigate">Solicitar Contacto Candidato</asp:LinkButton>

<br />

<asp:LinkButton ID="LNB_InsCom" runat="server" CommandName="Navigate">Inserir comentrio sobre Candidato</asp:LinkButton>

<br />

<asp:LinkButton ID="LNB_SMSCand" runat="server" CommandName="Navigate">Enviar SMS Candidato</asp:LinkButton>

<br />

<asp:LinkButton ID="LNB_MsgCand" runat="server" CommandName="Navigate">Enviar Mensagem Candidato</asp:LinkButton>

<br />

<asp:LinkButton ID="LNB_OutrosProc" runat="server" CommandName="Navigate">Ver outros processos do Candidato</asp:LinkButton>

<br />

Procurar Candidato no Google

<br />

<asp:LinkButton ID="LNB_Entrevista" runat="server" CommandName="Navigate">Marcar Entrevista</asp:LinkButton>

<br />

<asp:LinkButton runat="server" EnableViewState="false" OnClientClick="return confirm('Tem a certeza que deseja apagar o registo?')" CommandName="Delete" Text="Apagar" ToolTip="Apagar" ID="btnDelete"/>

</ItemTemplate>

</rad:RadMenuItem>

</Items>

</rad:RadMenuItem>

</Items>

</rad:RadMenu>

</ItemTemplate>

</rad:GridTemplateColumn>

<rad:GridBoundColumn DataField="TbcaDataIn" HeaderText="Data" SortExpression="TbcaDataIn"

DataFormatString="{0:d}" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="63px" />

</Columns>

</MasterTableView>

</rad:RadGrid>

</Columns>

Thks.

obinna osuji
Top achievements
Rank 1
 answered on 28 Jan 2010
2 answers
177 views
Hi,

we've a grid with 3 levels. The second and third levels are set to edit mode in the prerender event of the grid.
The problem is, that it is possible to expand these levels. but collapsing doesn't work anymore?!

Here is the sample code:

protected void RadGridContractProducts_PreRender(object sender, EventArgs e) 
{ 
        for (int i = RadGridContractProducts.MasterTableView.GetItems(GridItemType.NestedView).Length - 1; i >= 0; i--) 
            { 
                for (int j = ((GridNestedViewItem)RadGridContractProducts.MasterTableView.GetItems(GridItemType.NestedView)[i]).NestedTableViews.Length - 1; j >= 0; j--) 
                { 
                    
                    SetItemsMode(((GridNestedViewItem)RadGridContractProducts.MasterTableView.GetItems(GridItemType.NestedView)[i]).NestedTableViews[j]); 
                } 
            } 
 
 
            RadGridContractProducts.Rebind(); 
        } 
 
private void SetItemsMode(GridTableView oGridTableView) 
        { 
            for (int i = oGridTableView.Items.Count-1; i >= 0; i--) 
            { 
                 
                oGridTableView.Items[i].Edit = true; 
 
            } 
 
            
            for ( int i = oGridTableView.GetItems(GridItemType.NestedView).Length -1; i >=0 ; i-- ) 
            { 
                for ( int j = ( ( GridNestedViewItem )oGridTableView.GetItems(GridItemType.NestedView)[i]).NestedTableViews.Length -1 ; j >=0; j--) 
                { 
                    SetItemsMode(((GridNestedViewItem)oGridTableView.GetItems(GridItemType.NestedView)[i]).NestedTableViews[j]); 
                } 
 
            } 
        } 

Could someone explain how to get this problem solved?

Thanks in advance

Stefan
Thuan
Top achievements
Rank 1
 answered on 28 Jan 2010
3 answers
297 views
Hi,

I am using RADScheduler, and I want to fix the height of the scheduler for MonthView. I want a fix Height, no matters how many appointments/contents (if there's no content to fill it) are.

Is it possible?

Thanks & Regards,
Peter
Telerik team
 answered on 28 Jan 2010
1 answer
145 views
Hello,

I am running VQ3 2009 with hotfixes.  I'm having trouble with databinding the scheduler. 

  1. I am binding the data in the server side code by querying my appointments table. 
  2. I traverse the datatable of appointments and build a generic list of <Appointment> objects. 
  3. I then set the datasource of thescheduler to the generic list.

I first put this code in the PageLoad() event, but though the data showed in the scheduler just fine, it seemed to cause issues with the navigation pane's calendar popup.

I then moved the code to the PageInit() event.  I get unpredictable behavior now where sometimes when i open the page, the scheduler does not contain data, but when I refresh it finally shows the appointments. 

Questions:
1. Where should I put my server side data binding statement?
2. Should it be wrapped in an "If(!IsPostBack)" call?

Thanks,

Ryan
Peter
Telerik team
 answered on 28 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?