Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
174 views

I want to zoom out the image since it is so large you can only see a small portion of it. I found this code to use.

 

    <script type="text/javascript">
        function OnClientLoad(sender) {
            //sender.zoomImage(50);
            sender.zoomBestFit();
        }
    </script>

 

Neither 'zooms' work. They both skew the image to the wrong proportions. How do you do exactly what the zoom out toolbar button does? That works fine.

Vessy
Telerik team
 answered on 18 Aug 2015
1 answer
86 views

Hi all,

I have use:

http://demos.telerik.com/aspnet-ajax/imageeditor/examples/imageupload/defaultcs.aspx?product=asyncupload

But when I upload new image file, it's be not show on RadImageEditor. When I click change Skin, it's be show
​I Have attach file 2 image.

Thanks

Aneliya Petkova
Telerik team
 answered on 18 Aug 2015
3 answers
205 views
Hi :)

I tried to implement a pivot for radgrid ... And I have some problems ....

I'd like my line's name are not the field of my database (for example, now I have "db_name" and I want "Name").
I'd like to make a header for all the grid with "User Informations"

This is my code :

ASP :

<telerik:RadGrid runat="server" ID="view" 
  ShowStatusBar="true"
  AutoGenerateColumns="false"
  Visible="false">
   
  <ClientSettings>
     <Selecting AllowRowSelect="True"/>
  </ClientSettings>
 
  <GroupingSettings CaseSensitive="false" />
     
  <MasterTableView  ShowHeadersWhenNoRecords="true" DataKeyNames="Id"  ClientDataKeyNames="Id">
 
  <Columns>
 
       <telerik:GridBoundColumn DataField="Name" UniqueName="Name" HeaderText="User Name"
       AutoPostBackOnFilter="true"  Visible="true">
       </telerik:GridBoundColumn>
 
       <telerik:GridBoundColumn DataField="Phone" UniqueName="Phone" HeaderText="User Phone"
       AutoPostBackOnFilter="true"  Visible="true">
       </telerik:GridBoundColumn>
 
       <telerik:GridBoundColumn DataField="Email" UniqueName="Email" HeaderText="User Email"
       AutoPostBackOnFilter="true"  Visible="true">
       </telerik:GridBoundColumn>
  </Columns>
  </MasterTableView>   
</telerik:RadGrid>
 
<br />
 
<telerik:RadGrid runat="server" ID="view2" 
  ShowStatusBar="true"
  Visible="true">
   
  <ClientSettings>
     <Selecting AllowRowSelect="True"/>
  </ClientSettings>
 
  <GroupingSettings CaseSensitive="false" />
     
  <MasterTableView  ShowHeader="false" >
   
  </MasterTableView>
  </telerik:RadGrid>


C#

protected void Page_Load(object sender, EventArgs e)
 {
            if (!Page.IsPostBack)
            {
                BindGridView();
            }
 
 }
 
 
        private DataTable PivotTable(DataTable origTable)
        {
 
            DataTable newTable = new DataTable();
            DataRow dr = null;
            //Add Columns to new Table
            for (int i = 0; i <= origTable.Rows.Count; i++)
            {
                newTable.Columns.Add(new DataColumn(origTable.Columns[i].ColumnName, typeof(String)));
            }
 
            //Execute the Pivot Method
            for (int cols = 0; cols < origTable.Columns.Count; cols++)
            {
                dr = newTable.NewRow();
                for (int rows = 0; rows < origTable.Rows.Count; rows++)
                {
                    if (rows < origTable.Columns.Count)
                    {
                        dr[0] = origTable.Columns[cols].ColumnName; // Add the Column Name in the first Column
                        dr[rows + 1] = origTable.Rows[rows][cols];
                    }
                }
                newTable.Rows.Add(dr); //add the DataRow to the new Table rows collection
            }
            return newTable;
        }
 
        private void BindGridView()
        {
            String str = Request.RawUrl;
            if (!IsPostBack)
            {
                if (str.Contains("?a"))
                {
                    Int32 url_id = Convert.ToInt32(Request.Params["a"]);
                    user_id = url_id;
                    DataTable dt = new DataTable();
                    SqlConnection cn = new SqlConnection("");
                    SqlCommand cmd = new SqlCommand("user_data", cn);
                    cmd.Parameters.Add(new SqlParameter("@id", SqlDbType.Int));
                    cmd.Parameters["@id"].Value = url_id;
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlDataAdapter sqlDa = new SqlDataAdapter(cmd);
                    sqlDa.Fill(dt);
 
                    try
                    {
                        cn.Open();
                        if (dt.Rows.Count > 0)
                        {
                            //Bind the First GridView with the original data from the DataTable
                            view.DataSource = dt;
                            view.DataBind();
 
                            //Pivot the Original data from the DataTable by calling the
                            //method PivotTable and pass the dt as the parameter
 
                            DataTable pivotedTable = PivotTable(dt);
                            view2.DataSource = pivotedTable;
                            view2.DataBind();
                        }
                    }
 
                    catch (SqlException ex)
                    {
                        //...
                    }
                    finally
                    {
                        if (cn.State != ConnectionState.Closed)
                        {
                            cn.Close();
                            cmd.Parameters.Clear();
                        }
                    }
                }
            }
        }

Thanks for the help :)
Viktor Tachev
Telerik team
 answered on 18 Aug 2015
7 answers
143 views
    Hi,

I am trying to create a add controls dynamically from the server side in Form template. I am able to create controls and display the controls in Formtemplate but i couldnt find controls in the server side to the values from controls.

Add Controls code sample

 

 

 

Protected Sub rdGridUDFRule_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rdGridUDFRule.ItemDataBound 
    
If TypeOf e.Item Is Telerik.Web.UI.GridEditFormItem And e.Item.IsInEditMode Then 
    
    
    
If e.Item.OwnerTableView.IsItemInserted Then 
    
    
    
'item is about to be inserted 
    
    
    
For Each editItem As Telerik.Web.UI.GridEditFormItem In rdGridUDFRule.MasterTableView.GetItems(Telerik.Web.UI.GridItemType.EditFormItem) 
    
If (editItem.IsInEditMode) Then 
    
    
    
Dim plcHolder As HtmlTableCell = DirectCast(editITem.FindControl("placeHolderRadGridFormTemplate"), HtmlTableCell) 
    
    
Dim objDynamicTxt As New TextBox 
    
objDynamicTxt.ID = "DynamicControl"  
objDynamicTxt.MaxLength = intLength 
    
plcHolder.Controls.Add(objDynamicTxt) 
    
    
End If 
    
    
    
Next 
    
    
    
Else 
    
    
    
'item is about to be edited 
    
    
    
Dim editedItem As Telerik.Web.UI.GridEditableItem = TryCast(e.Item, Telerik.Web.UI.GridEditableItem) 
    
End If 
    
    
    
End If 
    
    
    
End Sub 

 

 

Retrieve Dynamic control values from server side sample code

 

Protected Sub RadGrid1_UpdateCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles rdGridUDFRule.UpdateCommand 
        If (e.CommandName = RadGrid.UpdateCommandName) Then 
For Each editItem As Telerik.Web.UI.GridEditFormItem In rdGridUDFRule.MasterTableView.GetItems(Telerik.Web.UI.GridItemType.EditFormItem) 
                If (editItem.IsInEditMode) Then 
                    Dim plcHolder As HtmlTableCell = DirectCast(editITem.FindControl("placeHolderRadGridFormTemplate"), HtmlTableCell) 
Dim objDynamicTxt As TextBox = DirectCast(plcHolder.FindControl("DynamicControl"
               '******************************* THE objDynamicTxt RETURN NOTHING *******************************
                End If 
            Next 
        End If 
    End Sub


The Couldnt find the controls, but it is available in the FormTemplate while trying to click on the add new record.

Please let me know in which event the dynamic controls should be created

Thanks
Prabhu

Viktor Tachev
Telerik team
 answered on 18 Aug 2015
4 answers
391 views

I am creating a Dynamically built RadGrid. I have to do so because I am generating columns based on how many dates my sql query returns. I am placing the specific dates as header column groups. Under each date I am trying to create a dropdowncolumn that has a different datasource than the radGrid.
The problem is creating it dynamically. I thought about using an item template but how could I place a dropdown in the item template for each drop down that i need to create, which is two per date.  
How do i bind the datasource for the DropDownColumn from code behind when the entire grid is dynamically built.


for (int t = 0; t < datecount; t++)
        {
            int utacount = Convert.ToInt32(getDrill.Rows[t][3].ToString());

            for (int p = 0; p < datecount; p++)
            {

                GridDropDownColumn ddc = new GridDropDownColumn();

                int b = p + 1;

                ddc.UniqueName = "ddc" + p + s;
                if (p - 1 < utacount)
                {
                    string name = "uta" + p + s;
                    ddc.ColumnGroupName = name;
                    //ddc.DataField = "strStatus";
                    //ddc.ListTextField = "strStatus";
                    ////GridEditableItem editedItem = ddc as GridEditableItem;
                    ////GridEditManager editman = editedItem.EditManager;
                    ////GridDropDownColumnEditor editor = editman.GetColumnEditor(name) as GridDropDownColumnEditor;
                    ////editor.DataSource = getDrill;
                    ////editor.DataBind();

                }
                grid.MasterTableView.Columns.Add(ddc);
            }

            s++;
        }

Viktor Tachev
Telerik team
 answered on 18 Aug 2015
6 answers
1.2K+ views
I am trying to set the column width in the code behind and can not figure out how to do this.  My aspx looks like:


<
telerik:RadGrid ID="RadGrid1" AllowMultiRowSelection="True" runat="server" AutoGenerateColumns="False" GridLines="None" >

 

<

 

MasterTableView >

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="INVOICE" UniqueName="INVOICE"

 

 

HeaderText="Invoice">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="DATE" UniqueName="DATE" HeaderText="Date">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="BOL" UniqueName="BOL" HeaderText="BOL">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="PO" UniqueName="PO" HeaderText="PO">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="POHIDE" UniqueName="POHIDE" Visible="false"

 

 

HeaderText="PO Hide" >

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

</

 

MasterTableView>

 

 

 

<ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="True" >

 

 

 

<Selecting AllowRowSelect="True" />

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

I have tried using the RadGrid1_ColumnCreated event but no luck.  How do I change the column width at binding time?

Thanks

John

 

Frank
Top achievements
Rank 1
 answered on 18 Aug 2015
2 answers
351 views

Hi,

Is there a way to disable the RadGrid filter TextBox while keeping the filter button active and visible?  I'm using the button as a combo box and no longer need the TextBox.  Thanks for your help!

Brian
Top achievements
Rank 2
Iron
 answered on 18 Aug 2015
1 answer
63 views

Hi,

      I am Unable to export image of RadHtmlcHart in ie 9 [ Compatibility mode ] using RadClientExportManager. Please find the attachment. It works fine for other versions except ie 8 & 9 [ Compatibility mode ] . 

 

Regards,

Chethan Y

 

Dimitar
Telerik team
 answered on 18 Aug 2015
1 answer
83 views
I am using Telerik:RadImageEditor version 2012.3.1016.40  and getting tools for toolbar from XML file. Most of them tools are working fine but facing issues with some below given tools. These tools are not supporting. and getting message "Cound not find the command Export.Please update your command list." on click below given tools. 
1) Export
2) Draw tools (Pencil, Draw Circle, Draw Rectangle and Line).
HTML script:
<telerik:RadImageEditor ID="imgZipLineViewer" runat="server" ToolsFile="~/Config/RadImageEditor.xml" EnableResize="true" CanvasMode="No"> </telerik:RadImageEditor>

XML Script of RadImageEditor.xml:

<root>
  <tools name="FirstToolbar" dockable="true" enabled="true">
    <tool name="Print" togglebutton="true" />
    <tool name="Save" togglebutton="true" />
    <tool name="Export" togglebutton="true" />
    <tool separator="true"/>
    <tool name="Undo" toolstrip="true" />
    <tool name="Redo" toolstrip="true" />
    <tool name="Reset" />
    <tool separator="true"/>
    <tool name="Zoom" toolstrip="true">
      <tool name="Zoom" togglebutton="true"/>
      <tool name="ZoomIn" togglebutton="true" />
      <tool name="ZoomOut" togglebutton="true" />
    </tool>   
    <tool name="Rotate" toolstrip="true">
      <tool name="Rotate" togglebutton="true" />
      <tool name="RotateRight" togglebutton="true" />
      <tool name="RotateLeft" togglebutton="true"  />
    </tool>
    <tool name="RotateRight" togglebutton="true" />
    <tool name="AddText" togglebutton="true" />
    <tool name="Pencil" toolstrip="true">
      <tool name="Pencil" togglebutton="true" />
      <tool name="DrawCircle" togglebutton="true" />
      <tool name="DrawRectangle" togglebutton="true" />
      <tool name="Line" togglebutton="true" />
    </tool>
  </tools>
</root>

So please give the suitable solution for this.
Vessy
Telerik team
 answered on 18 Aug 2015
1 answer
80 views
I have a RadDateInput with the date format of "m/d/yyyy h:mm" and when I submit the value it parses it and tries to store it in this format "2015-12-20-12-30-00" and then I get a format exception. I want to have it store the value the same as the dat format property "m/d/yyyy h:mm".
Maria Ilieva
Telerik team
 answered on 18 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?