Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
112 views
Hi

I am developing scheduler application, when i insert an appointment, i need two condition
1) insert appointment using single click
2)when insert click it show the Day view

can you please give the appropriate suggesions

regards

imtiyaz
imtiyaz mohammed
Top achievements
Rank 1
 answered on 07 Jul 2009
1 answer
160 views
Hi,

We are using RadControls "Prometheus", with a version of 2007.3.1425.35 for Telerik.Web.UI.dll.  I am using the RadEditor, and adding a custom toolbar button via modifying the ToolsFile.xml file.  I would like to use a custom image for the custom toolbar button.

I can get everything to work when the Skin of the RadEditor is set to Web20.  I do the following:

1) Set up my ToolsFile.xml file as follows:

 

 

<root> 
  <tools> 
  <tool type="custom" name="NewCustomButton" Text="Add Premium Image"/>  
  </tools> 
</root> 
 

2) Add the following style to the ASPX page:
    <style>  
        .retoolbar.Web20 .NewCustomButton  
        {  
           background-image: url(../../images/icons/flag-g.gif);  
        }  
 
    </style> 
(I also have tried naming the style .rade_toolbar.Web20 .NewCustomButton, and that works also.  Your documentation seems to suggest that you can name it either way.)

3) And finally, add the control to the page:
                 <telerik:radeditor ID="RadEditor1" runat="server"   
                    ToolsFile="~/XMLConfigFiles/ToolsFileDemo.xml" EditModes="All" Height="400px"   
                    Skin="Web20" ToolbarMode="ShowOnFocus" Width="670px">  
                      
                 </telerik:radeditor> 

This works fine for the Web20 skin.  However, when I change to a different theme, such as WebBlue, and rename the css style to .retoolbar.WebBlue .NewCustomButton, the image does not appear on the toolbar.  When I look at the HTML that gets generated by the radEditor, it seems that if the Web20 code works, the WebBlue code should work also.

Please let me know how I can get the custom button to appear for the WebBlue skin.

If you need any more information from me or if you'd a more complete code sample, please just let me know.

Thanks so much for the assistance!

Joe

Joseph Alfano
Top achievements
Rank 1
 answered on 07 Jul 2009
4 answers
767 views
Hi All,
I have a radgrid with a gridbuttoncolumn that l use to let users download excel files.
Its straight-forward:
 
<telerik:GridButtonColumn HeaderText="Download" Text="Get Report"  
                                UniqueName="dldReportColumn" CommandName="PullReport"> 
                            </telerik:GridButtonColumn> 

On the click event, I am trying to send the generated file, but its giving a wierd error: 


But thats not the solution I want. In my earlier project, we used to be able to send the file directly to the user using Response.Write() and IE would open a dialog asking users to Open, Save or Cancel the file...

How do I achieve the file download ability using teleric:GridButtonColumn?

My code for the command handler is:
Protected Sub BatchGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles BatchGrid.ItemCommand 
        If e.CommandName = "PullReport" Then 
            Dim chosen As GridDataItem = DirectCast(e.Item, GridDataItem) 
            Dim folder As String = chosen("folder").Text 
            Dim file As String = chosen("file").Text 
 
            'The first task is to ensure that the file exists. 
            Dim fullPath As String = Path.Combine(folder, file) 
            Dim fi As FileInfo = New FileInfo(fullPath) 
            If fi.Exists() Then 
                Dim id As String = chosen("BatchID").Text 
                 
                Response.ClearContent() 
                Response.AddHeader("Content-disposition", "attachment; filename=" & file) 
                Response.AddHeader("Content-Length", fi.Length) 
                Response.ContentType = "application/octet-stream" 
                Response.TransmitFile(fullPath) 
                Response.Flush() 
                Response.End() 
            End If 
        End If 
    End Sub 


This is a common scenario ... how do I get the download functionality?
S
Top achievements
Rank 1
 answered on 07 Jul 2009
1 answer
127 views
I am trying to add a new editorTool  to a n instance of the rad editor. When I run the project with the below code, the editor displays without any tools except the one i have added manualy. When i remove the below and re-run the project all the tools are available.

EditorToolGroup main = new EditorToolGroup();
RadEditor1.Tools.Add(main);

EditorTool insertContentLink = new EditorTool();
insertContentLink.Name = "InsertContentLink";
insertContentLink.Text = "Insert Content Link";
insertContentLink.ShortCut = "CTRL+B";
main.Tools.Add(insertContentLink);

I have based my code on the demo here http://demos.telerik.com/aspnet-ajax/editor/examples/customtools/defaultcs.aspx

Rumen
Telerik team
 answered on 07 Jul 2009
1 answer
181 views
Hi,

Actually I did it but wonder if there is another way. Here is my code. Any improvements are appreciated.

        protected void RadSkinManager1_PreRender(object sender, EventArgs e) 
        { 
            DataTable table = new DataTable(); 
            DataRow row; 
 
            table.Columns.Add("ImgUrl"); 
            table.Columns.Add("val"); 
            table.Columns.Add("txt"); 
 
            row = table.NewRow(); 
            row.ItemArray = new string[] { "images/default.gif", "Default", "Default" }; 
            table.Rows.Add(row); 
 
            row = table.NewRow(); 
            row.ItemArray = new string[] { "images/black.gif", "Black", "Black" }; 
            table.Rows.Add(row); 
 
            row = table.NewRow(); 
            row.ItemArray = new string[] { "images/forest.gif", "Forest", "Forest" }; 
            table.Rows.Add(row); 
 
            RadComboBox skinChooser = RadSkinManager1.FindControl("SkinChooser") as RadComboBox; 
 
            skinChooser.DataSource = table; 
            skinChooser.ItemTemplate = new IMGTemplate("ImgUrl"); 
            skinChooser.DataTextField = "txt"; 
            skinChooser.DataValueField = "val"; 
            skinChooser.Width = 240; 
            skinChooser.Height = 202; 
            skinChooser.DataBind(); 
             
            skinChooser.SelectedValue = RadSkinManager1.Skin; 
 
         } 

class IMGTemplate : ITemplate 
    { 
     string pathColumn; 
 
     public IMGTemplate(string imgPathColumn) 
        { 
            pathColumn = imgPathColumn; 
        } 
 
        public void InstantiateIn(Control c) 
        { 
            Image imgt = new Image(); 
            imgt.DataBinding += new EventHandler(imgDataBinding); 
            c.Controls.Add(imgt); 
        } 
 
        void imgDataBinding(object sender, EventArgs e) 
        { 
            Image img_ = (Image)sender; 
            RadComboBoxItem item = (RadComboBoxItem)img_.BindingContainer; 
            DataRowView drv = ((DataRowView)item.DataItem); 
            img_.ImageUrl = drv[pathColumn].ToString(); 
        } 
    } 
Sebastian
Telerik team
 answered on 07 Jul 2009
4 answers
71 views

Hello everyone,

I am trying to accept users' credit card number into 4 maskedtextboxes. When user completes every four digit in the box, I shift the focus to the next text box.

For that reason I tried to check the carret position whenever user presses a key. But unfortunately everytime the carretPosition results with 0.

Is there any work around or is it natural for carretPosition to be 0 in keypressed event on client side?

You can find the code below :

 <script type="text/javascript">

               function goNextCreditCardTextBox(sender, args) {
            
                if (args._keyCode > 47 && args._keyCode < 58) {
                   alert(  $find(sender._clientID).get_carretPosition());
                }
            }
   </script>



<telerik:RadMaskedTextBox ID="creditCardNumberTextBox1" runat="server" Mask="####"  Width="27">
          <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
</telerik:RadMaskedTextBox>
<telerik:RadMaskedTextBox ID="creditCardNumberTextBox2" runat="server" Mask="####"  Width="27">
          <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
</telerik:RadMaskedTextBox>

<telerik:RadMaskedTextBox ID="creditCardNumberTextBox3" runat="server" Mask="####"  Width="27">
          <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
</telerik:RadMaskedTextBox>
<telerik:RadMaskedTextBox ID="creditCardNumberTextBox4" runat="server" Mask="####"  Width="27">
          <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
</telerik:RadMaskedTextBox>

Tsvetoslav
Telerik team
 answered on 07 Jul 2009
1 answer
71 views
Go to the online demo: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/slider/defaultcs.aspx and choose Advanced-style Pager "NextPrevNumericAndAdvanced", page through the grid and you will see the behavior (may need to page more than once to see it). Tested on IE6 only.
This happens with different skins.
Pavlina
Telerik team
 answered on 07 Jul 2009
1 answer
127 views
hi
i want to open a radAlert popup with animaiton
for that....
i hav done...

java script!

function

 

Button1_onclick() {

 

radalert(

"as",300,100,"rock");



 

<

 

telerik:RadWindowManager ID="RadWindowManager1" runat="server" Animation="Resize"> </telerik:RadWindowManager>

THE PROBLEM!!!

when i click the button which brings the alert the animation starts at the left-top position on the page and after the animation is done the alert comes jumps in the center....
plz help

 

Georgi Tunev
Telerik team
 answered on 07 Jul 2009
17 answers
503 views
I've seen this posting a few times in the forums, but no clear answer.

We recently upgraded from 2008.Q1 to 2008.Q2.  After upgrading, we are getting an error that is somewhat predictable.  When the error occurs, the exception is raised within the DataBind() event for the RadComboBox.  In order to make sure the data coming from the stored procedure was not causing the problem, we overwrote the stored proc to return a static set of data.   Considering I have seen other cases reported in the forums for previous versions of this control having the same issue, it looks like your previous fix may have been broken with this most recent release.

Here is the code to populate the combobox - we use almost identical code everywhere we populate the combobox:

                //populate parent categories  
                rcbParentCategory.DataSource = ourDB.Category_GetAvailableParents(CurrentCategoryId);  
                rcbParentCategory.DataValueField = "CategoryId";  
                rcbParentCategory.DataTextField = "CategoryName";  
                rcbParentCategory.ClearSelection();  
                rcbParentCategory.DataBind();  
                rcbParentCategory.Items.Insert(0, new RadComboBoxItem("None Selected", "-1"));  
                rcbParentCategory.SelectedValue =  
                    ((rcbParentCategory.Items.FindItemByValue(category.ParentId.ToString()) != null) ? category.ParentId.ToString() : "-1");  
                rcbParentCategory.DataSource = null; 

I added the ClearSelection call in line 5 after reading a forum entry, but it does not solve the problem.

In case this information is important... we are using DotNetNuke 4.8.3 and the module in which this code exists is using partial page rendering.  In this situation, the user is selecting a row from a grid and then clicking a button called "edit".  This causes the panel with the grid to dissappear and then a panel with the RadComboBox is made visible, during this button click event is where the combobox population code shown above is called.  The predictability of the error is in that I can select an item, click edit, return (hide panel with combo and make grid panel visible again), select another item, click edit, return, click the original item, click edit...kaboom.  It would not be easy to send a project that isolates the error for you.  The DNN module we have in this case is fairly straightforward, though.  There is nothing fancy happenning, just what I mentioned when the edit button is clicked.

We really need this resolved immediately as we have a major deliverable for a client.  Please advise.

Thanks!

Michael
Simon
Telerik team
 answered on 07 Jul 2009
1 answer
168 views
I have a grid where I allow column resizing by default, have fixed widths for some columns, specifically disallow column resizing for those columns, yet when other (resizable) columns are resized, those fixed columns change size too. How can I get some of my columns to never resize...!

Here's an example of my markup. Specifically, notice my two command columns which happen to be the first and last columns in the grid - the GridEditCommandColumn and the GridButtonColumn which both have Resizable="false". It is especially a problem for the last column in the grid, the GridButtonColumn. The Resizable="false" prevents the right column border from being moved, but if the one to the left, which belongs to a column which can be resized is moved (LoanBalance), it will  change the size of the button column.

Is this a bug?
Thanks, Steve

<telerik:RadGrid ID="rgLiens" runat="server" EnableEmbeddedSkins="false" Skin="RealMax" 
        OnNeedDataSource="rgLiens_NeedDataSource" OnItemCreated="rgLiens_ItemCreated"  
        ondeletecommand="rgLiens_DeleteCommand" oninsertcommand="rgLiens_InsertCommand"  
        onupdatecommand="rgLiens_UpdateCommand" OnPreRender="rgLiens_PreRender" OnItemDataBound="rgLiens_ItemDataBound" 
        OnRowDrop="rgLiens_RowDrop" GridLines="None" ShowFooter="True" > 
    <ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true"> 
        <ClientEvents OnRowMouseOut="rowMouseOut" OnRowMouseOver="rowMouseOver" OnPopUpShowing="PopUpCentered" /> 
        <Selecting AllowRowSelect="true" /> 
        <Resizing AllowColumnResize="True" /> 
    </ClientSettings> 
        <FilterMenu EnableTheming="True"> 
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
    </FilterMenu> 
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" EditMode="EditForms" TableLayout="auto" 
            DataKeyNames="LienId,LienIndex,PropertyId">         
      <NoRecordsTemplate><div style="margin:6px">No liens recorded for this property</div></NoRecordsTemplate>        
      <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="false" /> 
      <ItemStyle CssClass="RowMouseOut" /> 
      <AlternatingItemStyle CssClass="RowMouseOut" /> 
      <RowIndicatorColumn HeaderStyle-Width="20px" /> 
      <ExpandCollapseColumn HeaderStyle-Width="20px" /> 
       
      <Columns> 
        <telerik:GridEditCommandColumn EditImageUrl="~/Images/Buttons/edit.gif" ButtonType="ImageButton" Resizable="false" > 
            <HeaderStyle Width="24px" /> 
            <ItemStyle CssClass="CommandColumn" /> 
        </telerik:GridEditCommandColumn> 
        <Telerik:GridBoundColumn DataField="LienIndex" DataType="System.Int16" ReadOnly="true"> 
            <HeaderStyle Width="20px" HorizontalAlign="Center" /> 
        </Telerik:GridBoundColumn> 
        <telerik:GridNumericColumn DataField="LoanAmount" DataType="System.Decimal" NumericType="Currency"   
            HeaderText="Loan Amount" SortExpression="LoanAmount" UniqueName="LoanAmount" Aggregate="Sum" FooterAggregateFormatString="{0:C}"> 
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" /> 
            <FooterStyle HorizontalAlign="Right" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridNumericColumn DataField="InterestRate" DataType="System.Decimal" NumericType="Percent"  
            HeaderText="Interest Rate" SortExpression="InterestRate" DataFormatString="{0}%" 
            UniqueName="InterestRate"> 
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" /> 
            <FooterStyle HorizontalAlign="Right" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridNumericColumn DataField="MonthlyPayment" DataType="System.Decimal" NumericType="Currency"  
            HeaderText="Payment" SortExpression="MonthlyPayment" UniqueName="MonthlyPayment" Aggregate="Sum" FooterAggregateFormatString="{0:C}"> 
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" /> 
            <FooterStyle HorizontalAlign="Right" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:$#,##0.00;($#,##0.00);#}" DataField="Arrears" DataType="System.Decimal" NumericType="Currency"  
            HeaderText="Arrears" SortExpression="Arrears" UniqueName="Arrears" ItemStyle-ForeColor="Red"> 
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" ForeColor="Red" /> 
            <FooterStyle HorizontalAlign="Right" ForeColor="Red" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridBoundColumn DataField="rtp_Lender.Name" DataType="System.String"  
            HeaderText="Lender" SortExpression="rtp_Lenders.Name" UniqueName="LenderName"> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="LoanNumber" DataType="System.String"  
            HeaderText="Loan Number" SortExpression="LoanNumber" UniqueName="LoanNumber"> 
        </telerik:GridBoundColumn> 
        <telerik:GridDateTimeColumn DataField="LoanDate" DataType="System.DateTime"  
            HeaderText="Loan Date" SortExpression="LoanDate" UniqueName="LoanDate"  
            DataFormatString="{0:MM/dd/yyyy}"> 
        </telerik:GridDateTimeColumn> 
        <telerik:GridBoundColumn DataField="rtp_LoanType.Name" DataType="System.String" HeaderText="Loan Type" 
            SortExpression="LoanType" UniqueName="LoanType"> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Term" DataType="System.Int32"  
            HeaderText="Term" SortExpression="Term" UniqueName="Term"> 
        </telerik:GridBoundColumn> 
        <telerik:GridNumericColumn DataField="LoanBalance" DataType="System.Decimal" NumericType="Currency"  
            HeaderText="Loan Balance" SortExpression="LoanBalance" UniqueName="LoanBalance" Aggregate="Sum" FooterAggregateFormatString="{0:C}"> 
            <HeaderStyle Width="90px" HorizontalAlign="Center" /> 
            <ItemStyle HorizontalAlign="Right" /> 
            <FooterStyle HorizontalAlign="Right" /> 
        </telerik:GridNumericColumn> 
        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Resizable="false"    
            ConfirmDialogType="RadWindow" ConfirmText="Are you sure?" ConfirmTitle="Delete Lien?"  
            ImageUrl="~/Images/Buttons/delete.gif" Text="Delete" UniqueName="DeleteColumn"> 
            <HeaderStyle Width="24px" /> 
            <ItemStyle CssClass="CommandColumn" /> 
        </telerik:GridButtonColumn> 
    </Columns> 
 

Georgi Krustev
Telerik team
 answered on 07 Jul 2009
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?