Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
384 views
How in the simplest way to resize whole component to make it bigger ?
Princy
Top achievements
Rank 2
 answered on 21 Mar 2012
4 answers
126 views
Hi,

We are using radGrid extensively in our project. We have enabled drag and drop and it also enable the user to add/remove columns. While we remove columns, columns are not alignned and it shows huge space where columns are removed. it got adjusted perfectly if you click " Ungroup " menu. It will be great if it gets adjusted at the moment column is removed. Please see the attached screen shot.

Thanks
Venkat
Princy
Top achievements
Rank 2
 answered on 21 Mar 2012
1 answer
250 views

How can I get value from GridDropDownColumn ? in c# on Code behind

Could you please help ?

<telerik:RadScriptManager ID="RadScriptManager" runat="server"></telerik:RadScriptManager>
        <!-- content start -->
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadGrid ID="RadGrid1" Width="97%"
             AllowPaging="True"
             PageSize="15"
             runat="server"
             AllowSorting="True"
             OnCreateColumnEditor="RadGrid1_CreateColumnEditor"
             OnNeedDataSource="RadGrid1_NeedDataSource"
             OnDeleteCommand="RadGrid1_DeleteCommand"
             OnInsertCommand="RadGrid1_InsertCommand"
             OnItemDataBound="RadGrid1_ItemDataBound"
             AllowAutomaticDeletes="True"
             GridLines="None" Skin="WebBlue"
             AllowAutomaticInserts="True">
              <MasterTableView Width="100%" DataKeyNames="DestinationId" AutoGenerateColumns="False">
               <Columns>
 
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="MyImageButton" />
                </telerik:GridEditCommandColumn>
 
                <telerik:GridBoundColumn DataField="DestinationId" HeaderText="DestinationId" SortExpression="DestinationId"
                    UniqueName="DestinationId" ColumnEditorID="GridTextBoxColumnEditor1" ReadOnly="false" Visible="true">
                </telerik:GridBoundColumn>
                 
                <telerik:GridDropDownColumn DataField="OriginCountryCode"
                    HeaderText="Traveling From Country" ListTextField="CountryName" ListValueField="CountryCode"
                    UniqueName="OriginCountryCode" ColumnEditorID="GridDropDownColumnEditor1">
                </telerik:GridDropDownColumn>
 
                <telerik:GridDropDownColumn DataField="DestinationCountryCode"
                    HeaderText="Destination Country" ListTextField="CountryName" ListValueField="CountryCode"
                    UniqueName="DestinationCountryCode" ColumnEditorID="GridDropDownColumnEditor1">
                </telerik:GridDropDownColumn>
 
                <telerik:GridDropDownColumn DataField="PurposeId"
                    HeaderText="Purpose of Trip" ListTextField="Description" ListValueField="PurposeId"
                    UniqueName="PurposeId" ColumnEditorID="GridDropDownColumnEditor1">
                </telerik:GridDropDownColumn>
 
                <telerik:GridDateTimeColumn UniqueName="DateOfArrival" PickerType="DatePicker" HeaderText="Date of Arrival"
                            DataField="DateOfArrival"
                            <ItemStyle Width="120px" />
                        </telerik:GridDateTimeColumn>
 
                <telerik:GridDateTimeColumn UniqueName="DateOfDeparture" PickerType="DatePicker" HeaderText="Date of Departure"
                            DataField="DateOfDeparture"
                            <ItemStyle Width="120px" />
                        </telerik:GridDateTimeColumn>
 
                <telerik:GridCheckBoxColumn DataField="MultiEntry" HeaderText="Multi Entry Visa ?" SortExpression="MultiEntry"
                    UniqueName="MultiEntry">
                    <ItemStyle Width="120px" />
                </telerik:GridCheckBoxColumn>
 
                <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                </telerik:GridButtonColumn>
                </Columns>
 
<EditFormSettings ColumnNumber="1" CaptionDataField="DestinationId" CaptionFormatString="Destination Info {0}" >
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
</EditFormSettings>
                </MasterTableView>
            </telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 21 Mar 2012
1 answer
102 views
I am unable to locate how to access data from a GridEditMode.PopUp in your object model. In my RadGrid1_ItemCommand I have code to show the popup and this works(see below) but when I click on the insert button at the bottom of the popup the RadGrid1_ItemCommand fires again but I am unable to find the data I just entered into the popup.  I have looked on source, on RadGrid1, on e.item. etc...   Can you tell me where in your object model the popup data is stored?  The only example like this I could find was using AllowAutomaticInserts="True" which is not an option for me.  I need to validate the popup data in the codebehind before loading it into a collection and adding it to the grid.
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
 Select Case e.CommandName
    Case "Add"
  
        ' Add button pressed. Reset any rows in Edit mode
  
        Dim grid As RadGrid = CType(source, RadGrid)
  
        If (grid.EditItems.Count > 0) Then
  
            grid.MasterTableView.ClearEditItems()
  
        End If
  
  
  
        ' Manual "Add" Button pressed, put grid in Insert mode
  
        If e.CommandName = "Add" Then
  
            grid.MasterTableView.EditMode = GridEditMode.PopUp
  
            e.Item.OwnerTableView.IsItemInserted = True
  
            e.Item.OwnerTableView.Rebind()
  
        End If
  
      Case "PerformInsert"
             'here is where I cannot find the popup data.
  
  End Select

Shinu
Top achievements
Rank 2
 answered on 21 Mar 2012
2 answers
117 views
Image is not displaying when the file name contains &. How do I handle this in imageUrl?
James Campbell
Top achievements
Rank 1
 answered on 21 Mar 2012
1 answer
141 views
I followed a blog post exactly as explained here.
http://blogs.telerik.com/veselinvasilev/posts/09-04-08/how-to-use-wcf-services-with-asp-net-ajax-databound-controls.aspx

How do I pass additional parameters to the LoadData method? I need to pass customer status as parameter to the LoadData method and retrieve a list of customers that Active/ Inactive/deleted depending on the parameter 'status'.
Thank you!!

Neelima
Jagat
Top achievements
Rank 1
 answered on 20 Mar 2012
0 answers
150 views
The below code snippet is very close to resolving an issue with the sort order of .pdf and .xls documents, contained in a RadFileExplorer;

The following sort order is an example of the issue; 
DD 1-19-12.pdf
DD 1-20-12.pdf
DD 1-3-12.pdf

The last file in the list (DD 1-3-12.pdf) should actually be listed first in this scenario; The date contained in the name of the file is probably causing the sort issue, but modifying the name of the file is not an option;  In the below code snippet, I have replaced Name with Path - but to no avail;

The RadFileExplorer is being loaded in C#, by setting assigning ViewPaths and Upload Paths programmatically;

void RadFileExplorer1_ExplorerPopulated(object sender, RadFileExplorerPopulatedEventArgs e)
       {
           e.List.Sort(delegate(FileBrowserItem fileBrowserItem1, FileBrowserItem fileBrowserItem2)
           {
               return fileBrowserItem1.Name.CompareTo(fileBrowserItem2.Name); 
           });
       }
Robert
Top achievements
Rank 1
 asked on 20 Mar 2012
3 answers
189 views
I've seen many posts on this subject.  I was getting the tooltipmanager error on my local PC and on my DEV server.  I resolved that by changing the ajaxloadingpanel to an asp panel and by changing the DOCTYPE to <!DOCTYPE html >.  Well, the problem went away on the PC and on the DEV server.  BUT now I've moved to QA the problem is showing there. 
There are 4 similar grids on the web page. There are 2 tooltips on each RadGrid.  One on the first column that shows a formview and one on another column that shows a few lines of text and an asp table built dynamically.  I originally used a RadGrid for the table but found it gave me the error shown below.  When I changed the radgrid to visible=false the error went away and that's why I changed to an asp table.  The first tooltip works on QA and the second produces the error every time.

Partial page code:
<!DOCTYPE html >
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Grid30">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Grid30_60" LoadingPanelID="LoadingPanelGrid30" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Grid60">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Grid60_90" LoadingPanelID="LoadingPanelGrid60" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Grid90">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Grid90Plus" LoadingPanelID="LoadingPanelGrid90" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="GridNeg">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNegative" LoadingPanelID="LoadingPanelGridNegative" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
<asp:Panel runat="server" ID="LoadingPanelGridNegative">
                                        <telerik:RadToolTipManager ID="RadToolTipManagerNegativeClientName" OffsetY="-1"
                                            HideEvent="LeaveToolTip" Width="350" Height="100" runat="server" OnAjaxUpdate="OnAjaxUpdateClientName"
                                            RelativeTo="Element" Position="MiddleRight">
                                        </telerik:RadToolTipManager>
                                        <telerik:RadToolTipManager ID="RadToolTipManagerNegativeInvoice" OffsetY="-1" HideEvent="LeaveToolTip"
                                            Width="400" Height="100" runat="server" OnAjaxUpdate="OnAjaxUpdateInvoice" RelativeTo="Element"
                                            Position="MiddleLeft">
                                        </telerik:RadToolTipManager>
                                        <telerik:RadGrid runat="server" ID="GridNegative" Visible="True" AllowPaging="False"
                                            AllowSorting="true" AutoGenerateColumns="False" Skin="WebBlue" CellPadding="2"
                                            GridLines="None" ShowFooter="False" Height="250px" Width="750px">
                                            <ExportSettings ExportOnlyData="True" FileName="DebtorsCredits" IgnorePaging="True"
                                                OpenInNewWindow="True">
                                                <Excel Format="ExcelML" FileExtension="xls" />
                                            </ExportSettings>
                                            <ClientSettings EnableRowHoverStyle="True">
                                                <Resizing AllowColumnResize="true" AllowResizeToFit="True" ClipCellContentOnResize="False"
                                                    ResizeGridOnColumnResize="false" />
                                                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                                <Selecting AllowRowSelect="true" />
                                                <ClientEvents OnRowCreated="GridCreated" />
                                            </ClientSettings>
                                            <MasterTableView AllowPaging="false" AllowSorting="true" DataKeyNames="client_company_id, base_invoice, billing_line_item_id"
                                                HierarchyLoadMode="Client" Width="100%" AllowAutomaticDeletes="False" AllowAutomaticInserts="False"
                                                AllowAutomaticUpdates="False" CommandItemDisplay="Top" UseAllDataFields="true"
                                                EnableHeaderContextMenu="True">
                                                <CommandItemSettings ShowExportToExcelButton="True" ShowExportToPdfButton="False"
                                                    ShowExportToWordButton="False" ShowExportToCsvButton="False" ShowAddNewRecordButton="False"
                                                    ShowRefreshButton="False" />
                                                <Columns>
                                                    <telerik:GridBoundColumn HeaderText="Client Name" DataField="ClientName" UniqueName="ClientName"
                                                        ItemStyle-Wrap="false">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridDateTimeColumn HeaderText="Invoice Date" SortExpression="due_date" ItemStyle-Wrap="false"
                                                        DataField="due_date" DataFormatString="{0:dd MMM yyyy}">
                                                    </telerik:GridDateTimeColumn>
                                                    <telerik:GridBoundColumn HeaderText="Job<br />Number" DataField="order_code_epro"
                                                        UniqueName="order_code_epro" ItemStyle-Width="80" HeaderStyle-Width="80">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn HeaderText="Candidate" DataField="candidatename" UniqueName="candidatename"
                                                        ItemStyle-Wrap="false">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn HeaderText="Invoice<br />Number" DataField="base_invoice"
                                                        UniqueName="base_invoice" HeaderTooltip="** indicates adjusted or part paid"
                                                        ItemStyle-Width="90" HeaderStyle-Width="90">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridNumericColumn DataField="consultant_unpaid" DataFormatString="{0:n}"
                                                        HeaderText="Outstanding Revenue (Ex GST)" HeaderStyle-HorizontalAlign="Right"
                                                        ItemStyle-HorizontalAlign="Right" UniqueName="consultant_unpaid" ItemStyle-Width="100"
                                                        HeaderStyle-Width="100" ItemStyle-Wrap="false" ItemStyle-ForeColor="Red">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn DataField="unpaid" DataFormatString="{0:n}" HeaderText="Invoice Balance (Inc GST)"
                                                        HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" UniqueName="unpaid"
                                                        ItemStyle-Width="100" HeaderStyle-Width="100" ItemStyle-Wrap="false" ItemStyle-ForeColor="Red">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridBoundColumn HeaderText="Credit Officer" DataField="collectorname" UniqueName="collectorname"
                                                        ItemStyle-Wrap="false" HeaderStyle-Wrap="false">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                            </MasterTableView>
                                        </telerik:RadGrid>
                                    </asp:Panel>

This tooltip works and is attached to the clientname column
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="CompanyTooltip.ascx.vb"
    Inherits="ConsultantDebtors.CompanyTooltip" %>
<table>
    <tr>
        <td>
            <b>Latest Collection Note for
                <asp:Label runat="server" ID="clientcompanyid"></asp:Label>
                : </b>
            <br />
            <asp:FormView runat="server" ID="CompanyNoteFormView" DataKeyNames="client_company_id"
                EmptyDataText="No collection notes found for this client.">
                <ItemTemplate>
                    <b>Date: </b>
                    <asp:Label runat="server" ID="CompanyNoteDate"><%# IIf(Eval("timestamp").Equals(DateTime.MinValue), "", Eval("timestamp", "{0:dd MMM yyyy}"))%></asp:Label>
                    <br />
                    <b>Credit Officer: </b>
                    <asp:Label runat="server" ID="CompanyCollectorNameLabel"><%# Eval("collector_name")%></asp:Label>
                    <br />
                    <b>Contact: </b>
                    <asp:Label runat="server" ID="CompanyContactNameLabel"><%# Eval("contact_name")%></asp:Label>
                    <br />
                    <asp:Label runat="server" ID="CompanyNoteComment"><%# Eval("Comment")%></asp:Label>
                </ItemTemplate>
            </asp:FormView>
        </td>
    </tr>
</table>

This one fails and is attached to the invoice column
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="InvoiceToolTip.ascx.vb"
    Inherits="ConsultantDebtors.InvoiceToolTip" %>
 
<table>
    <tr>
        <td>
            <b>Latest Note for Invoice
                <asp:Label runat="server" ID="InvoiceNumberLabel"></asp:Label>
            </b>
            <br />
            <b>Date: </b>
            <asp:Label runat="server" ID="InvoiceNoteDate"></asp:Label>
            <br />
            <b>Credit Officer: </b>
            <asp:Label runat="server" ID="InvoiceCollectorName"></asp:Label>
            <br />
            <b>Category: </b>
            <asp:Label runat="server" ID="InvoiceCategory"></asp:Label>
            <br />
            <b>Description: </b>
            <asp:Label runat="server" ID="InvoiceDescription"></asp:Label>
            <br />
            <asp:Label runat="server" ID="InvoiceNoteComment"></asp:Label>
            <br />
            <b>Invoice Total: </b>
            <asp:Label runat="server" ID="totalinvoice"></asp:Label>
            <b>Outstanding: </b>
            <asp:Label runat="server" ID="totaloutstanding"></asp:Label>
            <br />
            <b>Invoice History</b>
            <div class="RadGrid RadGrid_WebBlue">
                <asp:Table runat="server" ID="InvoiceTable" CssClass="rgMasterTable rgClipCells" CellPadding="0">
                </asp:Table>
            </div>
        </td>
    </tr>
</table>

The targetcontrols are loaded in the prerender event of the grid and are on the CELL of the grid.  The same event code is used for all 4 grids.  I found that when the targetcontrols were loaded in the itemdatabound event that the array was in the original order and not the sorted order with rather confusing results.


RadToolTipManager response error:
 Exception=Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
<!DOCTYPE html P'.

Given that the page does not contain the text shown in the message, I must presume that somehow the QA server is rendering it thus.
Is it at all possible to view the source in the tooltip pop-up?  I'd like to know if the DOCTYPE contains the word PUBLIC or not and of course why it fails to load.

Joan.


Joan
Top achievements
Rank 1
 answered on 20 Mar 2012
0 answers
117 views
I am loading documents from an FTP Server to a RadFileExplorer, programmatically with C# ;

The name and date ordering of the files on the FTP Server is arranged according to file Date modified, and corresponds to the files being in order - based on name and date of file;

However, when the files are loaded to the RadFileExplorer - the ordering of the files is incorrect, based on name and date of files;

Is it possible to configure the RadFileExplorer to exactly mimic the correct ordering of files coming from the FTP Server?

Example of file order on FTP Server :
CD 3-14-12.pdf
CD 3-14-12.xls
CD 3-15-12.pdf
CD 3-15-12.xls
CD 3-16-12.pdf
CD 3-16-12.xls

Example of file order after load to RadFileExplorer :
CD 3-16-12.pdf
CD 3-16-12.xls
CD 3-2-12.pdf
CD 3-2.12.xls
CD 3-5-12.pdf
CD 3-5-12.xls




Robert
Top achievements
Rank 1
 asked on 20 Mar 2012
1 answer
82 views
For my RadGrid, I have an edit FormTemplate that contains a RadComboBox that needs to change the options available based on one of the columns of the Row being edited. I've got an ObjectDataSource hooked up to the RadComboBox but I'm not sure how I can change the parameter of the ObjectDataSource so it shows the proper list of options.

Any suggestions or code samples for this?
Casey
Top achievements
Rank 1
 answered on 20 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?