Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
265 views
this code of my normal fileupload of ASP.NET then what for radupload control :-

if (FileUpload1.HasFile)
            {
                byte[]img = new byte[FileUpload1.PostedFile.ContentLength];
                HttpPostedFile myimg = FileUpload1.PostedFile;
                myimg.InputStream.Read(img,0,FileUpload1.PostedFile.ContentLength);


                SqlCommand cmd = new SqlCommand("insert into FTAB (CMTID,IMAGEDT) values (@imgid,@image)", conn);


                SqlParameter imgid = new SqlParameter("@imgid",SqlDbType.Int);
                imgid.Value = 2;
                cmd.Parameters.Add(imgid);


                SqlParameter uploading = new SqlParameter("@image", SqlDbType.Image);
                uploading.Value = img;
                cmd.Parameters.Add(uploading);


                conn.Open();
                cmd.ExecuteNonQuery();
                conn.Close();
                lblHead.Text = "Image uploded";
            }
            else
            {
                lblHead.Text = "No file selected";
            }


So tell me solutions bcoz I am not very familiar with radtelerik controls /.
Navin
Top achievements
Rank 1
 answered on 15 Oct 2012
5 answers
80 views
Hi,

there is an error message pop up "Error while executing filter PdfExportFilter - [object error]" when i open a page using telerik radeditor. This message only appears for that particular content(suspecting is because of the content that causes such error).

after some investigation, i deactivate the contentfilter PDFExportFilter, the message no longer pop up. can i know what is the cause of the error display?

Regards.
Rumen
Telerik team
 answered on 15 Oct 2012
8 answers
298 views
Hi

I was just wondering if there is a way of retrieving the recurrence rule in javascript when you edit an appointment. I want to retireve it while inside the advanced edit form. Something like get_recurrenceRule().
Princy
Top achievements
Rank 2
 answered on 15 Oct 2012
1 answer
132 views
I'm having some issues with the display of a RadGrid in a printer friendly window.  I have a simple RadWindow that combines multiple elements (RadGrids and other divs) into a single printable flow.  When the window is opened the following code runs to generate the content:
var multiPage = $find('<%= InquiryDetailNotesMultiPage.ClientID %>');
var tabStrip = $find("<%= InquiryDetailNotesTabStrip.ClientID %>");
var baseId = "<%= CombinedNotesArea.ClientID %>".replace("CombinedNotesArea", "");
var baseGridId = "<%= InquiryDetailCombinedGrid.ClientID %>".replace("InquiryDetailCombinedGrid", "");
var views = multiPage.get_pageViews();
var tabs = tabStrip.get_tabs();
 
var additionalInformationHtml = "";
for (var i = 0; i< views.get_count(); i++) {
    var view = views.getPageView(i);
    var tab = tabs.getTab(i);
    var grid = $find(baseGridId + "InquiryDetail" + tab.get_text().replace(" ", "") + "Grid");
    if (grid) {
        additionalInformationHtml = "Additional Information - ";
        additionalInformationHtml += tab.get_text();
        additionalInformationHtml += view.get_element().children[0].outerHTML;
    }
    document.getElementById(baseId + tab.get_text().replace(" ", "") + "NotesArea").innerHTML = additionalInformationHtml;
}
This basically iterates a tabstrip/multipage and grabs the grids on each then takes injects the html of each into a pre-defined area on "Print Preview" window.  This works fine and the content looks correct.  After clicking a print button a separate script is called that takes this content and passes it to an iFrame and calls print() as described here:  http://www.telerik.com/support/kb/aspnet-ajax/window/printing-the-contents-of-a-radwindow.aspx.  I am also trying to maintain the grid styles as described here: http://www.telerik.com/community/code-library/aspnet-ajax/grid/print-radgrid-contents.aspx.  This is my print function:
function CallPrint() {
    var content = $get("<%= PrintableArea.ClientID %>").innerHTML;
    var styleSheet = '<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(Page, InquiryDetailOnlineActivityGrid.GetType(), String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css", InquiryDetailOnlineActivityGrid.Skin)) %>';
    var baseStyleSheet = '<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(Page, InquiryDetailOnlineActivityGrid.GetType(), "Telerik.Web.UI.Skins.Grid.css") %>';
    //remove any script elements
    content = content.replace( /<script .*?>(.|\n)*?<\/script>/gi , "");
 
    var printIframe = $get("ifmcontentstoprint");
    var printDocument = printIframe.contentWindow.document;
    printDocument.designMode = "on";
    printDocument.open();
    printDocument.write("<html><head><link href = '" + styleSheet + "' rel='stylesheet' type='text/css'><link href = '" + baseStyleSheet + "' rel='stylesheet' type='text/css'></head><body>" + content + "</body></html>");
    printDocument.close();
    try {
        if (document.all) {
            printDocument.execCommand("Print", null, false);
        }
        else {
            printIframe.contentWindow.print();
        }
 
    }
    catch (ex) {
        alert("error printing");
    }
}

Unfortunately what comes back is a little odd.  Not all of the styling is there and the print appears to be inserting some odd page breaks based on the content.  See attached screenshots for examples.  I'm sure I'm missing something simple here.  Any help would be appreciated.
Daniel
Telerik team
 answered on 15 Oct 2012
7 answers
796 views
I have a following code in my ASPX:

<

 

td class="TD" style="width: 32px;" valign="bottom" align="center">

 

 

<asp:CheckBox ID="CheckBoxA101S" runat="server" Height="12px" Style="position: relative"

 

 

Text=" " TextAlign="Left" Width="12px" />

 

 

</td>

 

 

<td class="TD" style="width: 31px;" valign="bottom" align="center">

 

 

<asp:CheckBox ID="CheckBoxA101U" runat="server" Height="12px" Style="position: relative"

 

 

Text=" " TextAlign="Left" Width="12px" /></td>

 

 

There are two checkboxes and user only can check one box.
How can I code that in ASPX?

Thanks so much.

 

Princy
Top achievements
Rank 2
 answered on 15 Oct 2012
1 answer
122 views
Hi,

Is there any way to work in-line filter when we turn off grid filter. I have set EnableViewState=false for radgrid but when I applied inline filter then in NeedDataSource event FilterExpression is showing empty and I applied filter again then FilterExpression is showing previous value.

please help.

Thanks
Praveen Tomar
Andrey
Telerik team
 answered on 15 Oct 2012
8 answers
654 views
I am trying to place a radscheduler as a user control on one of my pages, I am getting this error

script control 'RadAjaxManager1" is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptSescriptors. Parameter name: scriptControl.

it's weird because when I run my code on my local machine everything is honky dory, but once I move it to the server it no longer works.

 any ideas on why this would be happening?

code:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
......
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <%--//commentedout to seperate grid from scheduler
            <telerik:AjaxSetting AjaxControlID="RadGrid1">--%>
            <telerik:AjaxSetting AjaxControlID="RadScheduler3">
            <UpdatedControls>
                <%--//commentedout to seperate grid from scheduler
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />--%>
                <telerik:AjaxUpdatedControl ControlID="RadScheduler3" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <%--<telerik:AjaxSetting AjaxControlID="Panel1">
         <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler3" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />

                    </UpdatedControls>
        </telerik:AjaxSetting>--%>
    </AjaxSettings>
</telerik:RadAjaxManager>
<%--<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
 <asp:Label id="Label2" runat="server" ForeColor="Red">Loading... </asp:Label>
</telerik:RadAjaxLoadingPanel> />
--%>
.......


<telerik:RadScheduler ID="RadScheduler3"
RegisterWithScriptManager="false"
    runat="server"
    DataEndField="EndDate"
    DataKeyField="EventID"
    DataSourceID="Event"
    DataStartField="StartDate"
    DataSubjectField="Description"
    Skin="Sunset"
    DayView-UserSelectable="false"
    WeekView-UserSelectable="false"
    SelectedView="MonthView"
    TimelineView-UserSelectable="false"
    MonthView-VisibleAppointmentsPerDay="10"
    OverflowBehavior="Scroll"
    OnAppointmentDataBound="RadScheduler3_AppointmentDataBound"
    OnPreRender="RadScheduler3_PreRender"
    OnAppointmentUpdate="Update"
    OnAppointmentDelete="Delete"
    MinimumInlineFormWidth="700"
    OnClientAppointmentContextMenu="appointmentContextMenu"
    MinimumInlineFormHeight="1500"
    AppointmentContextMenuSettings-Skin="Sunset"
    Width="100%"
    Height="1000px"
    OnFormCreated="RadScheduler3_FormCreated"
    ShowViewTabs="false"
    TimelineView-NumberOfSlots="10"
    StartEditingInAdvancedForm ="true"
     
    StartInsertingInAdvancedForm="true">
    <Reminders Enabled="True" />
.....................
</telerik:RadScheduler>


Thanks,

Adam Pierce



Plamen
Telerik team
 answered on 15 Oct 2012
1 answer
271 views
Hi All,

I am using RadToolTip control and under that I have place a textbox control when a user click on a radtooltip I would like to set the focus on a textbox control. For some reason I am not able to that. Please look at the code below and advise me anything which might be useful for me.

I am getting the textNote ID but for some reason when I call the focus method it doesn't set the focus.


Thanks for your response in advance.





<script type="text/javascript">
 
       function SetFocusToTextBox(txt) {
 
           var txtNote = document.getElementById(txt);
           alert(txtNote);
           txtNote.focus();
       }
 
   </script>




<telerik:RadGrid ID="gvTopics" runat="server" Font-Names="Verdana" Font-Size="XX-Small"
            Skin="Office2007" EnableEmbeddedSkins="true" GridLines="Both" AllowSorting="true"
            AllowPaging="true" PageSize="10" Width="99%" CellPadding="2" AutoGenerateColumns="False">
            <MasterTableView CommandItemDisplay="Top">
                <CommandItemSettings ShowAddNewRecordButton="false" RefreshImageUrl="" />
                <Columns>
                    <telerik:GridTemplateColumn>
                        <ItemTemplate>
                            <asp:ImageButton ID="btnShowMessagesFromTopicList" ToolTip="Show messages" runat="server"
                                CommandArgument='<%# Container.DataItem("id")%>' Text="show msgs" OnClick="btnShowMessagesFromTopicList_Click" />
                             <asp:ImageButton ID="btnAddMessage" runat="server" ToolTip="Reply to agent"
                                Text="Reply" CommandArgument='<%# Container.DataItem("id")%>' OnClick="btnReply_Click" />
                             <asp:ImageButton ID="btnAddNote" runat="server" Text="Add Note" CommandArgument='<%# Container.DataItem("id")%>' />
                             <asp:ImageButton ID="btnCloseTopic" runat="server" Text="close" Visible="false"
                                CommandArgument='<%# Container.DataItem("id")%>' OnClick="btnCloseTopic_Click"
                                ToolTip="Close topic" />
                            <asp:HiddenField ID="hidID" Value='<%# Bind("ID") %>' runat="server" />
                            <asp:HiddenField ID="hidCreatedBy" Value='<%# Bind("CreatedBy") %>' runat="server" />
                            <asp:HiddenField ID="hidNewAgentMessage" Value='<%# Bind("NewAgentMessage") %>' runat="server" />
                            <telerik:RadToolTip ID="rttpNote" Width="210" Height="200" HideEvent="ManualClose"
                                TargetControlID="btnAddNote" RelativeTo="Element" Skin="Windows7" Position="TopRight"
                                ManualClose="true" ShowEvent="OnClick" runat="server">
                                <table width="100%">
                                    <tr>
                                        <td>
                                            Notes :
                                            <asp:TextBox ID="txtNote" TextMode="MultiLine" Width="200" Height="200" onblur runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnSaveNote" CommandArgument='<%# Container.DataItem("id")%>' Text="Save"
                                                OnClick="btnSaveNote_Click" runat="server" />
                                        </td>
                                    </tr>
                                </table>
                            </telerik:RadToolTip>
                        </ItemTemplate>
                        <ItemStyle Width="15%" />
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>



  Protected Sub gvTopics_OnItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles gvTopics.ItemDataBound


        If TypeOf (e.Item) Is GridDataItem Then         

            Dim txtNote As TextBox = e.Item.FindControl("txtNote")             
            btnAddNote.Attributes.Add("onClick", "javascript:SetFocusToTextBox('" & txtNote.ClientID & "')")        

    End Sub
Shinu
Top achievements
Rank 2
 answered on 15 Oct 2012
4 answers
278 views
Hello,

Thank you in advance for any and all assistance.

I have a gridbound column that is ignoring alignment settings.

<telerik:GridBoundColumn DataField="TOTAL_AMOUNT" Aggregate="Sum"
    ItemStyle-Font-Size="XX-Small" HeaderStyle-Font-Size="XX-Small" FooterStyle-Font-Size="XX-Small" ItemStyle-Wrap="false" FooterStyle-Wrap="false" HeaderStyle-Wrap="false"
    ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right"
    DataFormatString="{0:$###,##0.00}" DataType="System.Double"
    HeaderText="RQMT AMOUNT" SortExpression="Number" UniqueName="AMOUNT"
    FilterControlAltText="Filter AMOUNT column">
    <ItemStyle HorizontalAlign="right" />
</telerik:GridBoundColumn>

When I remove the attribute DataFormatString="{0:$###,##0.00}", the column then aligns correctly to the right.  I've also tried taking the CSS style approach, with no results.  Is there some tip/trick that I'm missing?

Thanks again for any assistance!
Tsvetina
Telerik team
 answered on 15 Oct 2012
4 answers
153 views
Hi,
this is the first time i touch asp.net and telerik. 
I have been trying to figure something out for quite a while :

i have a table in a database: 
ID NAME  NICK
123  Mario        Mar
234  Maria        Mia
.
. and so on...

I am starting out with an empty radgrid containing a template column that has a radComboBox inside. that radComboBox is populated from SqlDataSource (the ID). I have two more columns, Name and Nickname that all i need them to display is the Name and Nickname according to that table in the database that is in a Dataview variable called data now. it does not matter if the Name and Nickname columns are read only textboxes or labels.... the RadGrid is editable in-line. 

how can i display the name and nickname when the user selects an ID from the RadComboBox  while in edit mode and save that line in the table ? 

Example: in edit mode if i select the ID 123 it will instantly display Mario and Mar in the corresponding columns. and when I click the Insert button it will be inserted in the table. and then finally if i click the submit button it will send the table to the database... but thats another issue.. 

THANK YOU HELPERS ! ( just take it easy on me.. I'm still very new and learning.. )
Shinu
Top achievements
Rank 2
 answered on 15 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?