Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
163 views
Working Code: I have a Grid, and it has list of filename's with radio button. If I select a radio button, I can display image for the filename in the RadImageEditor. If I change the radio button or click another row, the image is updated properly. When image is displayed and If I click on zoom in zoom out, and then reset, the image is displayed in its original form the way it was loaded.
1) The problem comes when I first rotate an image, then click on reset changes , the image does not come to its original form the way it was initially loaded.
2) Continuing the step 1, if I now try to change radiobutton so try to load another image, an error is thrown.

Let me know any better way or possible solution to this issue. The demo does not give proper information for this issue, so putting in this forum.
 Markup Code:
<%@ Page Title="Home Page" Language="vb"   AutoEventWireup="false"   CodeBehind="Default.aspx.vb" Inherits="DocumentMgr._Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"  >
    <title></title>
   
     <script type="text/javascript">
         function OnClientCommandExecuting(sender, eventArgs) {

             if (eventArgs.get_commandName() == "Reset") {                 
                 var imgEditor = $find("<%=rie.ClientID %>");
                 imgEditor.getEditableImage()._finishReset();
                 eventArgs.set_cancel(true);
             }
             return false;
         }
         
    </script>
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
   <%--<asp:FileUpload ID="fup" runat="server" />
    <asp:Button ID="submit" runat="server"  Text="Submit" OnClick="Submit_Click" />--%>
     <asp:ScriptManager ID="sm" runat="server"  ></asp:ScriptManager>
    <asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <telerik:radgrid id="grTL" skin="Office2010Silver" allowfilteringbycolumn="false"  
        width="100%" height="150px" showstatusbar="true" runat="server" allowpaging="True"
        allowsorting="True" enableajax="True" allowcustompaging="false" pagesize="23"
        editformitem="false" autogeneratecolumns="false" enablecolumnsviewstate="false"
        autogenerateeditcolumn="false" enableariasupport="true" MasterTableView-DataKeyNames="ID"
        >
       
        <MasterTableView HeaderStyle-Font-Bold="true" ShowFooter="False" AllowNaturalSort="false"
                                    EditMode="InPlace" CommandItemDisplay="None" Summary ="">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="Select" HeaderText="" HeaderStyle-Width="40"
                    HeaderStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:RadioButton ID="rbSelect" AutoPostBack="true" EnableTheming="true" Font-Bold="true"
                            runat="server" OnCheckedChanged="rbSelect_CheckedChanged" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                
                 <telerik:GridTemplateColumn HeaderText="FileName" >
                    <ItemTemplate>
                        <asp:Label ID="lblFileName" runat="server" Width="200px" Text='<%# Eval("FileName") %>'></asp:Label>                        
                    </ItemTemplate>
                    <EditItemTemplate>
                         <asp:Label ID="lblEFileName" runat="server" Width="200px" Text='<%# Eval("FileName") %>'></asp:Label>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Information" >
                    <ItemTemplate>
                        <asp:Label ID="lblInfo" runat="server" Width="200px" Text='<%# Eval("Information") %>'>
                        </asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="txtEditInfo" runat="server"  Width="200px" Text='<%# Bind("Information") %>' TabIndex="1" />                                                
                    </EditItemTemplate>
                   
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings AllowColumnsReorder="true">
            <Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="3" />
            <Resizing AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="false"
                ClipCellContentOnResize="true" EnableRealTimeResize="false" />
        </ClientSettings>
    </telerik:radgrid>
 

<telerik:RadImageEditor ID="rie" runat="server" EnableResize="true"    
  Width="100%" Height="500px" EnableEmbeddedScripts="true"   OnClientCommandExecuting="OnClientCommandExecuting"   
ToolsFile="Basic.xml"  >
 
</telerik:RadImageEditor>
    </ContentTemplate>
    </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>

Code Behind:
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            BindData()
        End If
    End Sub

    Private Sub BindData()
        grTL.DataSource = GetListOfImages()
        grTL.DataBind()
    End Sub
    Private Function GetListOfImages() As List(Of FileData)
        Dim images = New List(Of String)()
        Dim arr As List(Of FileData) = New List(Of FileData)
        Dim files As Files = New Files
        Try
            arr = files.GetFileWoAttachment()
            ' Get a list of FileName with extension to be displayed in Grid.
            
            
        Catch ex As Exception
            'log exception

        End Try

        Return arr

    End Function
    Protected Sub rbSelect_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)


        Dim bCAllToday As Boolean = False
        'Session("RowIndex") = 0

        Dim item As GridDataItem = DirectCast(TryCast(sender, RadioButton).NamingContainer, GridDataItem)
        Dim rdBtn As RadioButton = TryCast(sender, RadioButton)

        If rdBtn.Checked Then
            Session("RowIndex") = item.ItemIndex
            item.Selected = True
            rie.ImageUrl = "ShowImg.ashx?ID=" + CType(grTL.SelectedValues("ID"), String)
            Session("RowIndex") = CType(grTL.SelectedValues("ID"), String)
            rie.DataBind()

          
        End If

    End Sub

HANDLER:

Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        Dim my_Id As Int32
        If context.Request.QueryString("ID") IsNot Nothing Then
            my_Id = Convert.ToInt32(context.Request.QueryString("ID"))
            context.Response.ContentType = "image/png"
            context.Response.Buffer = True
            Dim strm As Stream = ShowEmpImage(my_Id)
            Dim bmp As Bitmap = New Bitmap(strm)
            bmp.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png)
          
        End If
        
    End Sub

    Public Function ShowEmpImage(ByVal my_Id As Integer) As Stream
        Dim fs As Files = New Files()
        Dim fdata As FileData = fs.GetFile(my_Id)
        'Attachment property defined in Class  As Byte()
        If (fdata.Attachment IsNot Nothing) Then
            Return New MemoryStream(DirectCast(fdata.Attachment, Byte()))
        Else
            Return Nothing
        End If

    End Function

Vessy
Telerik team
 answered on 13 Dec 2013
2 answers
255 views
I'm trying to Clear a RadComboBox in javascript, and have it post back (when AutoPostBack is enabled). I've been searching around for a solution, and this is the best I can come up with - but it feels incredibly hacky - is there a more appropriate method of doing this?

var combo = $find(comboId);
combo.hideDropDown();
combo.trackChanges();
combo.clearSelection();
combo.commitChanges();
var f = { Command: "Select", Index: combo.get_selectedIndex() };
combo.postback(f);

Thanks
Fergal
Fergal
Top achievements
Rank 1
 answered on 13 Dec 2013
1 answer
342 views
Hi Telerik developers;

This problem RadGrid in radwindow open in server side GridClientSelectColumn selected

Gird in Columns
<Columns>
                       <telerik:GridClientSelectColumn UniqueName="chkSelectColumn" HeaderStyle-Width="20px"></telerik:GridClientSelectColumn>
                       <telerik:GridBoundColumn DataField="CekKartID" HeaderText="ID" ReadOnly="true" ShowFilterIcon="false" Display="false" UniqueName="CekKartID"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="CekNo" HeaderText="Çek No" FilterControlWidth="80%" ShowFilterIcon="false" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="BankaAdi" HeaderText="Banka Adi" FilterControlWidth="80%" ShowFilterIcon="false" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="AlinanCari" HeaderText="Alinan Cari Unvan" FilterControlWidth="80%" ShowFilterIcon="false" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="VadeTarihi" HeaderText="Vade Tarihi" FilterControlWidth="80%" ShowFilterIcon="false" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
                       <telerik:GridNumericColumn DataField="Tutar" HeaderText="Tutar" DataFormatString="{0:N}" Aggregate="Sum" FilterControlWidth="20%" ShowFilterIcon="false" HeaderStyle-Width="100px" />
                   </Columns>


C# is Radgrid item data bound
protected void grdPortCekIade_ItemDataBound(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridDataItem)
           {
 
               GridDataItem dataBoundItem = e.Item as GridDataItem;
 
               var rowID= dataBoundItem["CekKartID"].Text;
                
                //sesCekKart = session in CekKart Table
               if (Convert.ToInt32(rowID) == sesCekKart.CekKartID)
               {
                   CheckBox chk = (CheckBox)dataBoundItem["chkSelectColumn"].Controls[0];                   
                   chk.Checked = true;
               }
           }
 
 
       }

RadWindow open and grid columns no selected GridClientSelectColumn
I want you selected the selected object
This radwindow image in click


Konstantin Dikov
Telerik team
 answered on 13 Dec 2013
1 answer
78 views
I have a RadGrid that displays the results of a query submitted by the user. If the user requeries I want the vertical scroll position to be at the top of the grid, not at the position of the previous query. How do I do this?

I have tried the following in the PreRender event all to no avail:

           RadGrid1.MasterTableView.CurrentPageIndex = 0;

and this..

          if (RadGrid1.MasterTableView.Items.Count > 0)
            {
                RadGrid1.MasterTableView.Items[0].Selected = true;
            }

Here are my property settings

        <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" Width="100%"  
            Height="450px" ShowStatusBar="True"
            AutoGenerateColumns="False" CellSpacing="0" GridLines="None" 
            onprerender="RadGrid1_PreRender" 
            onitemdatabound="RadGrid1_ItemDataBound" 
            ondetailtabledatabind="RadGrid1_DetailTableDataBind" 
            onneeddatasource="RadGrid1_NeedDataSource" 
                OnItemCreated="RadGrid1_ItemCreated" 
                onsortcommand="RadGrid1_SortCommand">
                  <MasterTableView DataKeyNames="GloveId, MaterialType, Chemical" HierarchyDefaultExpanded="true" Name="PermDataGroup" CssClass="masterTablePadding" 
                GroupsDefaultExpanded="False" >


Thanks,
Rob
Eyup
Telerik team
 answered on 13 Dec 2013
17 answers
605 views
 i have create tab and alone with it's pageview .it's work fine for deleting i add close image button to another class .(i.e. add tab and pageview in one class and deleting tab in another class) tab is deleting but pageview of that tab is not delete.how can i delete tab alone with pageview.pls help me
Nencho
Telerik team
 answered on 13 Dec 2013
1 answer
269 views
Hi - After upgrading from Q3 2013 to Q3 2013 SP1 I get borders around my check boxes in IE 8.  Chrome and firefox do not have them. 
You can see this here in your demo
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx

Is this change expected behavior for IE 8? or is this a bug?

Thanks
Eyup
Telerik team
 answered on 13 Dec 2013
1 answer
879 views
Hey

I'm trying to figure out how to edit the default css in the webresource.axd file, as its failing compatibility and accessibility tests. 

For example..

*html .RadTreeView .rtMinus{margin-right:1px}

Anyone know where I can find that file and edit it?

Thanks

John
Ivan Zhekov
Telerik team
 answered on 13 Dec 2013
15 answers
343 views
Hello,
    In the web application we are developing using the latest version of RadControls for Ajax, we make use of RadSplitter and RadTabStrip. We would like to format the selected tab's  text as bold so we have tried several approaches to accomplish it, one of them using the tab's SelectedCssClass:
tab.SelectedCssClass  = "highlightedTab";
  
  
where
  
  
  .highlightedTab
  {
         font-weight: bold !important;
  }
The other approach we have tried is to directly modify the CSS class of the selected tab:
.RadTabStripTop_Office2007 .rtsSelected
 {
        font-weight: bold !important;
 }

Both of these approaches produce the expected result but are also causing a problem: the last tab in the tabstrip ocassionally disappears. We have looked into the issue using Firebug and we noticed that the inner list of the tabstrip does not update its width when a tab caption is made bold (therefore the tab width increases) and it causes the last tab to be wrapped on the following row because there is not enough room left for it.
We have tried updating the list's width through client side code every time a tab is selected, but we couldn't get the tabstrip to work properly given that it also has the scroll buttons enabled.
Please advise us on how to fix this issue.
Thank you.
Ivan Zhekov
Telerik team
 answered on 13 Dec 2013
5 answers
210 views
Hi ,
           I have only the root tab with few items , the tabs are generated from a datasource . the code generated is like this

<div id="ctl00__RadTabStrip1" class="RadTabStrip RadTabStrip_Suntab RadTabStripTop_Suntab ">
<div class="rtsLevel rtsLevel1">
<ul class="rtsUL"><li class="rtsLI rtsFirst"><a title="" class="rtsLink rtsSelected" href=""><span class="rtsOut"><span class="rtsIn"><span class="rtsTxt">Overview</span></span></span></a></li></ul>
</div>


I need to change the class name of ul from rtsUL to something else . How is this possible?

Thanks
Thomson
Kate
Telerik team
 answered on 13 Dec 2013
7 answers
170 views
Hi,

I'm trying to use the RadGrid in a composite user control, where some of the features of the RadGrid are to be set dynamically by the user control (and the page the user control is placed on dictates its settings and appearance).

For example:
The user control is told which columns to present to the user and wether sorting is allowed, and then the user control will need to tell all that to the RadGrid so it can initialize itself with the proper columns and settings before databinding.

I'm struggling to make this work, as I don't know at which point in the life cycle I can get hold of the encapsulated RadGrid instance to set its options.
If I do that in the OnInit event of the user control, the RadGrid is not available yet. But as I understand, I need to define the RadGrid columns in its Init event, and I only know its required settings after the Init event has already passed.

I've tried placing a RadGrid declaratively in the user control, and I've also tried adding it programmatically to a placeholder, but I can't seem to get it working.

Can anyone give me any pointers? Thanks in advance!
Eyup
Telerik team
 answered on 13 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?