Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
189 views
Hi, 

   I want to implement this RadAsyncUpload using FileApi and IFrame techniques, I needed some samples to implement them, request you to provide me the same as implementing this feature with silverlight or flash depends on clients desktop environment, am planning to implement the same with FileAPI n IFrame.

 Also I want to know that if these methods work in IE8? 

So please give me some sample code or project to implement multi file upload using RadAsyncUpload FileAPI and IFrame..

Awaiting for your reply.


thanks
Pramodh
Genady Sergeev
Telerik team
 answered on 03 Aug 2011
1 answer
185 views


Is it possible to modify the SqlDataSource of a RadGrid, before it gets bound to the grid?

In my example I have query that is returning sets of data with the following column names.

Parameter1Title
Parameter1Value
Parameter2Title
Parameter2Value
Parameter3Title
Parameter3Value


What I need to do is sort of normalize this set into just two columns that contains only the ones that have a value.

For example, imagine the returned set contains these values.

Parameter1Title   "Age"
Parameter1Value   "45"
Parameter2Title   null
Parameter2Value   null
Parameter3Title   "Color"
Parameter3Value   "Blue"


From this I need to created an SqlDataSource that holds the following info for the grid

Parameter   Value
"Age"       "45"
"Color"     "Blue"

Where the 2nd parameter set was ignored as it had no value.

Note also, this Parameter grid is a child grid to grid called Attributes. That is, it's SqlDataSource is fed the AttributeID as the rows on the Attribute grid as clicked.

Where would I make this change? That is, intercept before the data is bound to the grid? Also, am I better off creating a new DataSet to bind to the grid? Is that possible with the RadGrid?





Daniel
Telerik team
 answered on 03 Aug 2011
3 answers
116 views
Hi,

I need to refresh the nested grid for some functions. Please check the attached image for clear idea.
There is one textbox below the nested grid and on enter key press of that textbox, I need to rebind the nested grid without postback.
The code for that is as below. Issue is it always posts back the page, which i don't want.
It stores the data in database which I store on "saveComment" function, but on success of that, it does not call the button event, inestead of that it post backs the page.
Where am I wrong?

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
       <script type="text/javascript">
 
           $(function () {
               $('.water').bind('keypress', function (e) {
                   var bookID = document.getElementById(this.id.replace('txtComment', 'hdnCommentBookID')).value;
                   var btnRefreshComment = document.getElementById('<%=btnRefreshComments.ClientID %>');
 
                   if (e.keyCode == 13) {
                       e.preventDefault();
                       $.ajax({
                           type: "POST",
                           url: "LogbookForCoaches.aspx/saveComment",
                           data: '{commentText:"' + this.value + '",bookid:"' + bookID + '"}',
                           contentType: "application/json; charset=utf-8",
                           dataType: "json",
                           success: function (msg) {
                               btnRefreshComment.click(); //It does not call the event too                           }
                       });
                   }
               });
           });
 
           //Delete comment from the comment list
           $(function () {
               $('.DelComment').click(function () {
                   var commentID = document.getElementById(this.id.replace('btnImgDelete', 'hdnCommentID')).value;
                   var bookID = document.getElementById(this.id.replace('btnImgDelete', 'hdnBookID')).value;
 
                   $.ajax({
                       type: "POST",
                       url: "LogbookForCoaches.aspx/DeleteComment",
                       data: '{commentID:"' + commentID + '",bookid:"' + bookID + '"}',
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function (msg) {
                       }
                   });
               });
           });
       </script>
   </telerik:RadCodeBlock>
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
       EnableAJAX="true">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="btnRefreshComments" EventName="Click">
               <UpdatedControls>
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>
   <telerik:RadGrid ID="dtBook" AllowPaging="True" runat="server" PageSize="10" ShowHeader="false"
       OnItemDataBound="dtBook_ItemDataBound">
       <PagerStyle Mode="NumericPages" />
       <MasterTableView TableLayout="Fixed" DataKeyNames="BookID">
           <ItemTemplate>
               <table>
                   <tr>
                       <td>
                           <div class="eg-bar">
                               <span id="faq2-title" class="iconspan">
                                   <img src="../Images/Logbook_Images/down-arrow.png" class="attachmentImage" /></span>Comments: 
                               <asp:Label ID="lblTotalComments" runat="server" ForeColor="Green"></asp:Label></div>
                           <div id="faq2" class="icongroup1" runat="server">
                               <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                   <tr>
                                       <td>
                                           <div id="divComments" class="Comments" runat="server" style="background-color: #EDEFF4;
                                               border: 1px; border-style: solid; border-color: #dbdbdb; padding-left: 3px;">
                                               <center>
                                                   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
                                                   </telerik:RadAjaxLoadingPanel>
                                               </center>
                                               <asp:Label ID="lblCommentMessage" runat="server" Text="No comments entered yet."
                                                   ForeColor="Red" Visible="false" class="CommentMessage"></asp:Label>
                                               <telerik:RadGrid ID="radComments" AllowPaging="True" runat="server" PageSize="15"
                                                   Skin="" GridLines="None" BorderStyle="None" BorderColor="Transparent" ShowHeader="false"
                                                   OnItemDataBound="radComments_ItemDataBound" Width="97%" EnableTheming="false"
                                                   Style="padding-left: 16px;" OnPageIndexChanged="radComments_PageIndexChanged">
                                                   <PagerStyle Mode="NumericPages" />
                                                   <MasterTableView TableLayout="Fixed" Width="100%" Height="100%" BorderStyle="None"
                                                       DataKeyNames="BookID,commentid,CommentAttachment,userid,Commenttype">
                                                       <ItemTemplate>
                                                           <table width="100%" border="0" cellspacing="1" cellpadding="1">
                                                               <tr>
                                                                   <td class="altbg" width="5%">
                                                                       <asp:Image ImageAlign="AbsMiddle" ID="imgWriterImage" runat="server" />
                                                                   </td>
                                                                   <td class="altbg" width="20%" align="left">
                                                                       <strong>
                                                                           <%# Eval("UserName") + ":" %></strong>
                                                                   </td>
                                                                   <td class="altbg" width="55%" align="left">
                                                                       <%# Eval("Commenttext") %>
                                                                   </td>
                                                                   <td align="center" class="altbg" width="20%">
                                                                       <table border="0" cellspacing="0" cellpadding="4">
                                                                           <tr>
                                                                               <td align="center">
                                                                                   <asp:HiddenField ID="hdnCommentID" runat="server" Value='<%# Eval("commentid") %>' />
                                                                                   <asp:HiddenField ID="hdnBookID" runat="server" Value='<%# Eval("bookid") %>' />
                                                                                   <asp:ImageButton ID="btnImgDelete" runat="server" ImageUrl="~/Forum/ForumImages2/delete.gif"
                                                                                       class="DelComment" ToolTip="Delete" />
                                                                               </td>
                                                                           </tr>
                                                                       </table>
                                                                   </td>
                                                               </tr>
                                                           </table>
                                                       </ItemTemplate>
                                                   </MasterTableView>
                                               </telerik:RadGrid>
                                           </div>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td height="30" class="commentstext">
                                           Write Comments For:
                                       </td>
                                   </tr>
                                   <tr>
                                       <td class="writecommentpad">
                                                <asp:RadioButton ID="rdoPublic" runat="server" AutoPostBack="false"
                                               Checked="true" CssClass="PageLabel" GroupName="GrpCommentType" Text="Player & Coaches" />
                                           <asp:RadioButton ID="rdocoaches" runat="server" AutoPostBack="false" CssClass="PageLabel"
                                               GroupName="GrpCommentType" Text="Coaches" />
                                           <asp:RadioButton ID="rdoPrivate" runat="server" AutoPostBack="false" CssClass="PageLabel"
                                               GroupName="GrpCommentType" Text="Me (Private)" />
                                           <br />
                                              
                                           <asp:Panel ID="pnlComment" runat="server" Style="padding-left: 20px;">
                                               <asp:HiddenField ID="hdnCommentBookID" runat="server" Value='<%# Eval("BookID")%> ' />
                                               <asp:TextBox ID="txtComment" class="water" runat="server" Width="85%" BorderStyle="Solid"
                                                   BorderWidth="1px" ToolTip="Write a comment..." BorderColor="#dbdbdb" Text="Write a comment..."
                                                   ValidationGroup='<%# DataBinder.Eval(Container,"ItemIndex") %>'></asp:TextBox><br />
                                           </asp:Panel>
                                       </td>
                                   </tr>
                               </table>
                           </div>
                       </td>
                   </tr>
               </table>
               <br />
           </ItemTemplate>
       </MasterTableView>
   </telerik:RadGrid>
   <asp:Button ID="btnRefreshComments" runat="server" Text='<%# DataBinder.Eval(Container,"ItemIndex") %>'
       Style="display: none;" />

protected void dtBook_ItemDataBound(object sender, GridItemEventArgs e)
    {
        Book_Comment objComment = new Book_Comment();
        DataTable dt = new DataTable();      
      
        System.Web.UI.WebControls.Label lblAttachmentMsg = null;
        if ((e.Item.ItemType == GridItemType.AlternatingItem | e.Item.ItemType == GridItemType.Item))
        {        
            ID = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["BookID"].ToString();
            string BookId = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["BookID"].ToString();
 
            TextBox txtComment = (TextBox)e.Item.FindControl("txtComment");
            Button btnComment = (Button)e.Item.FindControl("btnComment");
             
            #region "Comments"
 
            RadGrid radComments = (RadGrid)e.Item.FindControl("radComments");
            Button objButtonRefresh = (Button)e.Item.FindControl("btnRefreshComments");
            HtmlGenericControl divComments = (HtmlGenericControl)e.Item.FindControl("divComments");
            Label lblCommentMessage = (Label)e.Item.FindControl("lblCommentMessage");
            if (radComments != null)
            {
                ShowComments(BookId, radComments);
                Label lblTotalComments = (Label)e.Item.FindControl("lblTotalComments");
                lblTotalComments.Text = "(" + radComments.Items.Count.ToString() + ")";
                if (radComments.Items.Count < 1)
                    lblCommentMessage.Visible = true;
                else
                    lblCommentMessage.Visible = false;
            }
 
            AjaxSetting objAjxSetting = new AjaxSetting();
            objAjxSetting.AjaxControlID = btnRefreshComments.ClientID;// txtComment.ClientID;
            AjaxUpdatedControl objUpdatedCntrl = new AjaxUpdatedControl();
            objUpdatedCntrl.ControlID = radComments.ClientID;
            objUpdatedCntrl.UpdatePanelRenderMode = UpdatePanelRenderMode.Inline;
            objAjxSetting.UpdatedControls.Add(objUpdatedCntrl);
            this.RadAjaxManager1.EnableAJAX = true;
            this.RadAjaxManager1.AjaxSettings.Add(objAjxSetting);
 
            AjaxUpdatedControl objUpdatedCntrl1 = new AjaxUpdatedControl();
            objUpdatedCntrl1.ControlID = radComments.ClientID;
            this.RadAjaxManager1.AjaxSettings[0].UpdatedControls.Add(objUpdatedCntrl1);
            #endregion
        }
    public void btnRefreshComments_Click(object sender, System.EventArgs e)
    {
    }
Maria Ilieva
Telerik team
 answered on 03 Aug 2011
1 answer
117 views
Hi,

I want to display a new child window(created by me) for creating a new appointment instead of the one which is built in Telerik Scheduler.
How can I achieve this?

Thanks,
Navya
Peter
Telerik team
 answered on 03 Aug 2011
11 answers
197 views
Dear Telerik,

In IE the TimeLineView looks like this: http://bart.nimio.info/images/fora/verspringScheduler.JPG
In FireFox the same TimeLineView looks like this: http://bart.nimio.info/images/fora/verspringSchedulerFF.JPG

How can I make the IE-timelineview look the same as the FF timelineview?
Ivan Zhekov
Telerik team
 answered on 03 Aug 2011
1 answer
251 views
Hey,
I'm working on fileExplorer and I need to do the following scenario:
- When the user clicks on the file/folder => the path of the file/folder should be posted to the server side.
I've tried to invoke server side method from onClientSide event using PageMethods, but that didn't work !!
Can you help me?

Here's the code using PageMethods:
JavaScript
  
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server" EnablePageMethods="true">
 </telerik:RadScriptManager>
 <telerik:RadFileExplorer ID=
"RadFileExplorer1" runat="server" Skin="WebBlue"   onitemcommand="RadFileExplorer1_ItemCommand" OnClientItemSelected="GetMessage()">


<script type="text/javascript">
 
function OnGetMessageSuccess(result, userContext, methodName) {
        alert(result);<br>    }
 
function OnGetMessageFailure(error, userContext, methodName) {
     alert(error.get_message());  }
   
function GetMessage(sender, args) {     
   PageMethods.Message();}
</script>

CS
 
     [System.Web.Services.WebMethod]
      
public static void Message()
     { label1.Text =
"YES!";<br>        }

Dobromir
Telerik team
 answered on 03 Aug 2011
4 answers
337 views
Hi,

I want to change the current window icon url on radio button click.
i have tried that with following code but its not working .
Please suggest for the same.

 function test() {         

         var parentPage = GetRadWindow().BrowserWindow;
          var currentwindow = parentPage.GetRadWindowManager().getActiveWindow();
         var reportType =2;
         iconUrl='../images/icon2.png';

          if(reportType==1)
               currentwindow .set_iconUrl(iconUrl);    
          else if (reportType == 2)
              currentwindow .set_iconUrl(iconUrl);  
          else
               currentwindow .set_iconUrl(iconUrl);    

     }  
set_iconUrl(iconUrl);     this method is working in parent page, where radwindow is defined.
Marin Bratanov
Telerik team
 answered on 03 Aug 2011
1 answer
132 views

It seems that I am missing something when I tried to change the style of an appointment.  I am catching the AppointmentDataBound event, and I set the CssClass, but it seems that it gets changed to “rsAptContent” after this event and I don’t know where.  Any help someone could provide would be much appreciated.

 

    Protected Sub RadSchedulerInterventions_AppointmentDataBound(ByVal sender As Object, ByVal e As SchedulerEventArgs)

        Dim EndDateFinalized As Boolean = e.Appointment.Attributes("EndDateFinalized")

 

        If EndDateFinalized Then

            e.Appointment.CssClass = "rsCategoryPattern"

            e.Appointment.BorderColor = Drawing.Color.FromName("#B0CC9B")

        Else

            e.Appointment.BackColor = Drawing.Color.FromName("#edd5b7")

            e.Appointment.BorderColor = Drawing.Color.FromName("#cdb597")

        End If

    End Sub

Peter
Telerik team
 answered on 03 Aug 2011
1 answer
96 views
Hi,

I have 2 class files.

public class Employee
    {
        public int EmpId { get; set; }
        public string EmpName { get; set; }
        public IList<Dept> DeptCollection { get; set; }
    }

public class Department
    {
        public int DeptId { get; set; }
        public string DeptName { get; set; }
    }

I am fetching ILIST<Employee> and binding it to my radgrid.

I want to display something like
EmpId   EmpName   DeptName

in the
<telerik:GridBoundColumn ReadOnly="true" HeaderText="Employee Name"DataField="EMP_NAME" />

but how can I bind the deptname field from the nested object?

Regards,
aradhya
           



Daniel
Telerik team
 answered on 03 Aug 2011
1 answer
37 views
In a telerik grid(dynamically created.) when we are checking on the checkbox,the back color of that row is disappering. I want the color to remain as is it,while checking on the check box.



In our telerik grid ,  we gave skin="Windows7". After new insertion of records, that particular row of the grid is becoming megenta colour(backgroundcolour). Now when we are clicking(checking the checkbox) on the chechbox(telerik:GridClientSelectColumn) , the background colour of the particular row is vanishing. But again if we uncheck the checkbox , the colour is coming back. 
I want the background colour to remain as it is , even if we r checking the chechkbox.
Maria Ilieva
Telerik team
 answered on 03 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?