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

I have a RadFileExplorer on a page that loads up pdf's and images(jpgs). Ideally the functionality that I want is that the end-user can double click on an image file and and it should open up a modal popup with the image as well as 2 buttons that will allow them to rotate the image by 90 degrees, saves the image file and using the RadAjaxManager I could do a postback and show them the newly rotated image. If the file they click on is a pdf file, it just opens up modal window with the pdf.

How I went about trying to create this functionality is to create a RadToolTip which would display the image (using just the normal HTML img tag) and i can put the buttons on it along with event handlers for the buttons. So on the OnClientFileOpen function, I would check to see if the clicked file is an image then i would show the tooptip through javascript.
I'm stumped on how to get this accomplished. Here is the code that I have tried.

Javascript code
<script type="text/javascript"> 
        function OnClientFileOpen(sender, args) { 
            var pvwImage = $get("pvwImage"); 
            var imageSrc = args.get_path(); 
 
            if (imageSrc.match(/\.(gif|jpg)$/gi)) { 
                pvwImage.src = imageSrc; 
                pvwImage.style.display = ""; 
                var tooltip = $find("RadToolTip1"); 
                tooltip.show(); 
            } 
        } 
             
    </script> 

FIle Explorer  code
<telerik:RadFileExplorer ID="RadFileExplorer1" Runat="server"  
        Skin="Vista" TreePaneWidth="200px" VisibleControls="Grid, AddressBox" Height=""  
                Width="" OnClientFileOpen="OnClientFileOpen" > 
<Configuration SearchPatterns="*.*"></Configuration> 
</telerik:RadFileExplorer> 

Tooltip code:
<telerik:RadToolTip ID="RadToolTip1" runat="server" Animation="Fade" HideEvent="ManualClose"  
              ManualClose="True" Modal="True" Position="Center"  
            RelativeTo="BrowserWindow" Skin="Web20" Width="700px"> 
            <div align="center" > 
                <br />                 
                <br /> 
                <img id="pvwImage" src="#" alt="" style="display: none;vertical-align: middle;" /> 
                <br /> 
            </div> 
        </telerik:RadToolTip> 

I have tried to run this and when I click on the image file, it just says "tooltip is null" in the JS debugger. Could someone please help with this issue. Or if this approach is not the right one, I'm open to other suggestions on how to get this accomplished as well.

Thanks in advance!
Fiko
Telerik team
 answered on 01 Jun 2009
1 answer
52 views
I'm building some complex forms that use custom data access code so I'm trying to keep other parts of my plumbing and inheritance as generic and simple as possible. I also want to use a common header on a number of pages, and I want that header to include a RadMenu with common items.

I was scared away from using Master Pages when I saw the example at http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/masterpage/defaultcs.aspx. I won't have time to troubleshoot something like that if and when I break it down the road. So I've been looking at creating a header as a user control. I'm not sure how a RadMenu will function in a user control. Ultimately, for this project I would rather copy-and-paste a header that I'm sure will work rather than create something reusable that adds complexity.

For the first time in years I'm missing my old ASP "include" statement!

Any suggestions on the best way to re-use a RadMenu accross pages?
Atanas Korchev
Telerik team
 answered on 01 Jun 2009
3 answers
197 views
Hi,
I was wondering if there is any plan to allow for custom toolbar buttons/commands in a future update.

I am also interested in knowing whether there are any plans to allow for custom context menu items?

I think that these would be great additions to the new control, and hope to see them added soon. Is there any solid plan or date when this might happen?

Thanks,
Jenna
Fiko
Telerik team
 answered on 01 Jun 2009
6 answers
355 views
I want to have two hierarchy columns for each row in a telerik radgrid....

if any solution found please give ...................
Sebastian
Telerik team
 answered on 01 Jun 2009
3 answers
148 views
Same setup; a UserControl with a grid which has a ToolBar as the CommandItem.

I'm reacting to events on my calling page to enable/disable buttons on the ToolBar using code like this ...
          function NodeClicked(sender, args) { 
            var node = args.get_node(); 
 
            if (GridCommandItem != null) { 
              GridCommandItem.trackChanges(); 
              var btn = GridCommandItem.findItemByValue("doStuff"); 
              btn.set_enabled(true); 
              GridCommandItem.commitChanges(); 
            } 
            AjaxRequest("ShowDocuments;" + node.get_value()); 
          } 
Where "GridCommandItem" is a reference to the ToolBar.

Now, this works but only without the AjaxRequest call. The button is enabled and subsequent postbacks honour the enabled state of the control. However, my handler for the "ShowDocuments" AjaxRequest calls ReBind() on the Grid control and this resets the state of the ToolBar buttons.

Why? And what can I do about it?

--
Stuart

Stuart Hemming
Top achievements
Rank 2
 answered on 01 Jun 2009
1 answer
109 views
Hi All,

I have a client side process taking some time to do. how can I display the redajaxloadingpanel while the client side fucntion is runing?


TIA

Jerry

Pavlina
Telerik team
 answered on 01 Jun 2009
1 answer
231 views
How does one go about setting the VisibleControls property of the FileExplorer declaratively?
Fiko
Telerik team
 answered on 01 Jun 2009
1 answer
120 views
Ive built a website and used the defaull skin for combo boxes.  Everything works ok on my development machine, but after delpoying the site, the combos dont have any styling, the actual drop down box is transparent and the text is centred.  Ive copied the RADControls directory and the default skin folder am I missing something else ?

Is there some documentation outlining all the files necessary for deployment ?
Princy
Top achievements
Rank 2
 answered on 01 Jun 2009
1 answer
258 views
Is there a way to remove the toolbar?   I just want to use the RadEditor as textbox with its AutoResizeHeight capability.

Currently I use a workaround of EmptyTools.xml, ToolsWidth of 1 px and ToolbarMode = PageTop.
It displays a slight border.
Rumen
Telerik team
 answered on 01 Jun 2009
2 answers
155 views
I am new to rad grid. I have tried the following sample code for <EditItemTemplate>. But when I clicked the edit button, nothing was in the grid. When I saw the demo, everything was done using SQLDataSource. So I have confusion on what I have missed. Can anyone suggest me what I have missed in the following code.

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Black" OnItemDeleted="RadGrid1_ItemDeleted" OnItemUpdated="RadGrid1_ItemUpdated">
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductID" CommandItemDisplay="Top"
                    EditMode="InPlace">
                    <Columns>
                        <telerik:GridTemplateColumn DataField="ProductID" HeaderText="Product ID" UniqueName="ProductID">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblProductID" Text='<%# Eval("ProductID") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="ProductName" HeaderText="Product Name" UniqueName="ProductName">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblProductName" Text='<%# Eval("ProductName") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="txtProductName" Text='<%# Bind("ProductName") %>'></asp:TextBox>
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtProductName"
                                    ErrorMessage="Required" runat="server">
                                </asp:RequiredFieldValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="UnitPrice" SortExpression="UnitPrice" UniqueName="TemplateColumn"
                            EditFormColumnIndex="1">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblUnitPrice" Text='<%# Eval("UnitPrice", "{0:C}") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="txtUnitPrice" Text='<%# Bind("UnitPrice") %>'></asp:TextBox>
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtUnitPrice"
                                    ErrorMessage="Required" runat="server">
                                </asp:RequiredFieldValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton">
                            <ItemStyle CssClass="MyImageButton" />
                        </telerik:GridEditCommandColumn>
                        <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>
                </MasterTableView>
            </telerik:RadGrid>

Code Behind: 

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindProducts();
        }
    }

private void BindProducts()
{
        try 
   {
            conn = new SqlConnection("Data Source=server1;Initial Catalog=Northwind;User ID=sa;Password=sa");
            conn.Open();
            SqlCommand cmd = new SqlCommand("select * from Products", conn);
            SqlDataAdapter ad = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            ad.Fill(ds);
            RadGrid1.DataSource = ds;
            RadGrid1.DataBind();
   }
   finally
   {
            if (conn != null)
            {
                conn.Close();
            }
   }
}

    protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
    {
        GridDataItem dataItem = (GridDataItem)e.Item;
        String id = dataItem.GetDataKeyValue("ProductID").ToString();
....
        // code to handle deletion process
....
    }

    protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
    {
            GridEditableItem item = (GridEditableItem)e.Item;
            String id = item.GetDataKeyValue("ProductID").ToString();
     ....
             // code to handle Updation process
     ....           
     }
Thanks in advance,
Katte
Katte
Top achievements
Rank 1
 answered on 01 Jun 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?