Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
177 views
Hello Gurus,

I am giving Path Dynamically, i am getting the following exception:
 
 'C:/TestApplication.WebApp/UserWebDrive/acd8e7a9-1454-43d8-9679-272969ee317c/Images' is a physical path, but a virtual path was expected.

 here is the code i am using:
 -------------------------------------
 
 <telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="520px" Height="520px"
OnClientItemSelected="OnClientItemSelected" AllowPaging="true" PageSize="10">

   </telerik:RadFileExplorer>
 
 
            string Path = Server.MapPath("~/MagicWebDrive/" + UserID);
            string[] arrFiles = System.IO.Directory.GetDirectories(Path); 
            for (int i = 0; i < arrFiles.Length; i++)
            {
                FileExplorer1.Configuration.ViewPaths = arrFiles.ToArray();
                FileExplorer1.Configuration.DeletePaths = arrFiles.ToArray();
                FileExplorer1.Configuration.UploadPaths = arrFiles.ToArray();
            }

Thanks in Advance
Vessy
Telerik team
 answered on 03 Mar 2014
1 answer
142 views
Hello,

I recently made a change to a RadGrid by adding a Calculated column.  My data source is an in-memory dataset.  When I delete the final row in the grid and remove it from the dataset (in the code behind) I receive the following error:

Sys.WebForms.PageRequestManagerServerErrorException: Exception has been thrown by the target of an invocation.

I was able to get a little bit more information by adding a Rebind() to my grid in the deletion method.  I received the following inner exception
{"This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row."}

I have further proven the calculated field is the cause, by simply removing the GridCalculatedColumn and re-running the code with no issues.  The error return as soon as the calculated grid is added to the form.

Here's the markup:
<telerik:RadGrid ID="rdTicketGrid" runat="server" Width="70%" AllowAutomaticUpdates="false" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowSorting="false"
                            OnNeedDataSource="rdTicketGrid_NeedDataSource" AutoGenerateColumns="false" ShowFooter="true"
                            OnInsertCommand="rdTicketGrid_InsertCommand"
                            OnUpdateCommand="rdTicketGrid_UpdateCommand"
                            OnItemCreated="rdTicketGrid_ItemCreated"
                            OnDeleteCommand="rdTicketGrid_DeleteCommand"
                            OnItemDataBound="rdTicketGrid_ItemDataBound">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView DataKeyNames="TicketEntryID" CommandItemDisplay="Top" InsertItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="TicketEntryID" UniqueName="TicketEntryID" Display="false"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="NumOfTickets" HeaderText="Number of Tickets"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="NumberTicketsInSet" HeaderText="Number of Tickets per Set"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="PriceOfTickets" HeaderText="Price of Tickets" DataFormatString="{0:C}"></telerik:GridBoundColumn>
                    <telerik:GridCalculatedColumn HeaderText="Total Amount" UniqueName="TotalSetAmount" DataType="System.Double"  DataFormatString="{0:C}"
                                                    DataFields="NumOfTickets, NumberTicketsInSet, PriceOfTickets" Expression="{0}/{1}*{2}" FooterText="Total: " Aggregate="Sum"
                                                    FooterAggregateFormatString="{0:C}">
                    </telerik:GridCalculatedColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this ticket entry?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
                </Columns>
                <EditFormSettings>
                    <EditColumn ButtonType="ImageButton"></EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDblClick="rowDblClick" />
            </ClientSettings>
        </telerik:RadGrid>
 
        <telerik:RadInputManager runat="server" ID="rdInputMgr" Enabled="true">
            <telerik:NumericTextBoxSetting BehaviorID="TicketEntryIDTBSetting" Type="Number" AllowRounding="false" DecimalDigits="0"></telerik:NumericTextBoxSetting>
            <telerik:NumericTextBoxSetting BehaviorID="NumTicketsTBSetting" Type="Number" AllowRounding="false" DecimalDigits="0"></telerik:NumericTextBoxSetting>
            <telerik:NumericTextBoxSetting BehaviorID="PriceTicketsTBSetting" Type="Currency" AllowRounding="true" DecimalDigits="0"></telerik:NumericTextBoxSetting>
            <telerik:NumericTextBoxSetting BehaviorID="NumberTicketsInSetTBSetting" Type="Number" AllowRounding="true" DecimalDigits="0"></telerik:NumericTextBoxSetting>
        </telerik:RadInputManager>

And the code behind data source.  The dataset is built and then stored to session.  The data will be gathered later on submit.:

DataSet ds = new DataSet();
DataTable dt = new DataTable();
dt.Columns.Add("TicketEntryID");
dt.Columns.Add("NumOfTickets", typeof(int));
dt.Columns.Add("NumberTicketsInSet", typeof(int));
dt.Columns.Add("PriceOfTickets", typeof(double));
 
ds.Tables.Add(dt);               
Session["ticketGridSrc"] = ds;.

Finally the offending method that brakes the grid:

protected void rdTicketGrid_DeleteCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem editableItem = ((GridEditableItem)e.Item);
 
            try
            {
                int ticketEntryID = int.Parse(((GridDataItem)e.Item).GetDataKeyValue("TicketEntryID").ToString());
 
                //Access the data stored in the session
                DataSet currentDataSrc = ((DataSet)Session["ticketGridSrc"]);
 
                if (currentDataSrc != null)
                {
                    //build the select string we need to get the data from the table to delete
                    String selectStmt = string.Format("TicketEntryID = '{0}'", ticketEntryID);
 
                    //Get the row we are deleting from the source.              
                    DataRow[] updateRow = currentDataSrc.Tables[0].Select(selectStmt);
 
                    updateRow[0].Delete();
                    currentDataSrc.AcceptChanges();
                }
 
                Session["ticketGridSrc"] = currentDataSrc;
            }
            catch (Exception ex)
            {
                //TODO: Error Handling Here
            }
        }

Any help on determining why the error occurs would be greatly appreciated.

Thank you,
Konstantin Dikov
Telerik team
 answered on 03 Mar 2014
1 answer
75 views
I can't find any documentation to show how to write connection strings for pulling from SSAS into Scheduler. I did find this for PivotGrid: http://www.telerik.com/forums/ssas-with-pivotgrid I'm curious if anyone has used the same snippet of code that's listed in the comments:

<AdomdConnectionSettings Cube="Adventure Works" DataBase="Adventure Works DW 2008R2" ConnectionString="Data Source=http://demos.telerik.com/olap/msmdpump.dll;Catalog=Adventure Works DW 2008R2"></AdomdConnectionSettings>
Peter Filipov
Telerik team
 answered on 03 Mar 2014
1 answer
133 views
Hi;

After upgrading Telerik ASP.NET Ajax Q3 SP1, embedded CSS class PrimaryIconCssClass = rbAdd24 not shows icon on Hay Theme, but works on Metro theme.

You can find the working version of CSS Class.
https://demos.telerik.com/aspnet-ajax/button/examples/buttonheight65pixels/defaultcs.aspx
Bozhidar
Telerik team
 answered on 03 Mar 2014
2 answers
56 views
Dear All

I have a radgrid need to client side bind. All things work fine except lost alignment after the row initialized from server.

You can see from this demos: http://www.telerik.com/forums/bind-radgrid-client-side-to-a-json-array

if you set the column item alignment to "center" in declaration, you will found only first 4 rows are proper align, which  come from server. The rest of them lost alignment.

it also can see from page source code, the rest <td> didn't include the alignment attribute.

Please let me know how to fix it.

Thank you very much.

With best regards

Tommy
Jason
Top achievements
Rank 1
 answered on 03 Mar 2014
2 answers
161 views

I'm dynamically creating a RadDatePicker in the VB .NET code behind like so...

Dim oCalCell As New HtmlTableCell()
 
Dim oRadPicker As New Telerik.WebControls.RadDatePicker()
oRadPicker.ID = "cldrStageDate"
oRadPicker.Calendar.ID = "cldrStageDate_calendar"
oRadPicker.Calendar.ClientEvents.OnLoad = "cldrLoaded"
 
oCalCell.Controls.Add(oRadPicker)

Then on the client side I have the following javascript code:

function cldrLoaded(oCtl) {
   var sCtlId = null;
   if (typeof(oCtl.get_id) === "function") sCtlId = oCtl.get_id().split('_calendar')[0];
   else sCtlId = oCtl.ClientID; 
   var oCldr = $find(sCtlId);
}

The control is rendered on the page and appears to be working.  But inside "cldrLoaded",  oCtl doesn't have a function named "get_id" when this function is called, but it does have a "ClientID" set.  But the $find(sCtlID) won't find the RadDatePicker.

I have a DatePicker declared in the .aspx page that works as expected:

<telerik:RadDatePicker id="cldrStageDate" runat="server">
   <Calendar ID="cldrStageDate_calendar" runat="server">
      <ClientEvents OnLoad="cldrLoaded" />
   </Calendar>
</telerik:RadDatePicker>

How can I get the proper object get sent to the OnLoad function?

Thanks!

Daniel
Top achievements
Rank 1
 answered on 03 Mar 2014
1 answer
84 views
Hello,

I've a grid where in each column I've an item template with two time picker. 
That shows the start and end time.

I need to show the total duration in decimal at the footer.

i would also like to reflect the duration as the time is selected dynamically in each row. 






Eyup
Telerik team
 answered on 03 Mar 2014
1 answer
96 views
Hi, 

i've a grid with cells in a time interval of 15 mins. It's a 24 hours cycle.I'm trying to change the color of the cells based on the start and end time.

the cells should be coloured from start to end time.

Also I need to count the shaded cells per column and display it on a footer. 

please can someone suggest how can I achieve this functionality? 

Thanks
Eyup
Telerik team
 answered on 03 Mar 2014
3 answers
234 views
Below is my code for radgid edit form, It's working fine but i want to hide place holder control ID="plupload" on Insert/Edit mode of EditFormSettings on RadComboBox1 index chnaged event

<EditFormSettings EditFormType="Template">
<FormTemplate>
    <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none" style="border-collapse: collapse;">
        <tr>
            <td>
                <table id="Table4" cellspacing="1" cellpadding="1" width="50%" border="0" class="module">
                <tr>
                    <td>Name:</td>
                    <td><asp:TextBox ID="TextBox2" Text='<%# Bind( "Name") %>' runat="server" TabIndex="8"></asp:TextBox></td>
                </tr>
                <asp:PlaceHolder ID="plupload" runat="server" >
                <tr>
                    <td>File Upload :</td>
                    <td><telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" OnClientFileUploaded="OnClientFileUploaded" MultipleFileSelection="Disabled"
                            AllowedFileExtensions="jpg,jpeg,png,gif" MaxFileSize="1048576" onvalidatingfile="RadAsyncUpload1_ValidatingFile"></telerik:RadAsyncUpload>
                    </td>
                </tr>
                </asp:PlaceHolder>
                </table>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td align="right" colspan="2">
                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                    </asp:Button
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
            </td>
        </tr>
    </table>
</FormTemplate>
</EditFormSettings>

hear is my RadComboBox code

<telerik:RadComboBox ID="RadComboBox1" runat="server" onselectedindexchanged="RadComboBox1_SelectedIndexChanged" autopostback="True" >
<Items>
<telerik:RadComboBoxItem Value="1" Text="Show All" />
<telerik:RadComboBoxItem Value="2" Text="Hide File Upload" />
</Items>
</telerik:RadComboBox>
riddhish chaudhari
Top achievements
Rank 1
 answered on 03 Mar 2014
3 answers
208 views
Hi I have been having this issue in many development requests. Basically I use RadAjaxManager to update controls on a webform, but sometimes certain code is called on the server that should update a control and I need to cause that control to be upated on the screen from code behind. Is there a way to use the RadAjaxManager to achieve this task?

Thanks
Eyup
Telerik team
 answered on 03 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?