Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
430 views

I have created a drag-and-drop workflow builder where all of the shapes are complex (i.e. non-standard shapes comprised of several appended SVG commands).  Each of these shapes was created using one of six (6) custom visual templates ("Author", "Transmittal", "Review", "Print", "Publish" and "Email").  Unfortunately, I cannot rely on the built-in diagram.save method to store the finished diagrams as complex shapes reference visual templates which are functions and the JSON serialization process strips out all non-data (i.e. no functions).  When I attempt to reload the diagram from the file system, the diagram is correctly recreated but the complex shapes are replaced by squares.

The solution to this problem recommended to me was to include a "type" property with each complex shape and then interrogate this property after diagram.load to reinstantiate the correct visual template for each shape. At a high level, this sounds very logical and straight-forward.  While I have successfully assigned a "type" to each shape and have encountered no problems saving and subsequently re-loading a diagram, I have yet to figure out the correct way change existing shapes after re-load per the visual template functions originally used to create them. The approach I envision (but have yet to figure out the specifics) goes something like this:

  • Re-load the diagram using the diagram.load method.
  • Enumerate all of the shapes in a diagram by looping through the ShapesCollection.
  • For each shape in the collection, somehow assign the correct visual template to the shape based on its "type" property.

Am I close? <grin>  Is there a better way to go about doing what I'm trying to achieve? For what it's worth, I did try an alternative approach to this problem.  Knowing that the crux of the dilemma centers around the fact that serialization strips function info from the result object, I tried saving the raw diagram.save object without serialization.  It appears that diagram.save does indeed save all of the original diagram info as I was able to successfully reload the diagram from this object and everything looked great but...  I have yet to find a successful way to move the raw object from the client-side Javascript where it is created over to the the codebehind and subsequently write the object to disk. The conventional approach I would normally take would be to use a hidden form field (e.g. <asp:HiddenField...), retrieve it in the codebehind and then do whatever I need to do.  Unfortunately, hidden fields do not allow storing objects (just text) so all I ever end up in the codebehind is the string "[object Object]" instead of the actual object itself. <grrr>

Any help you can provide me with with either of the two approaches above would be very much appreciated.  Thanks.

Lloyd

Vessy
Telerik team
 answered on 19 Jan 2018
1 answer
182 views

I'm using the transitions in order to animate my RadHtmlChart.  However, I'm also using the client side getSVGString() to facilitate allowing the user to download an image of the chart.  I convert the svg string to png on the server and push back to client.  All of this is working EXCEPT, occasionally the getSVGString() is called before the animation has completed.

In order to work around the issue, I'm doing the following:
function setSvgContent<%=Me.ClientID%>() {
            setTimeout(function () {
                var chartRendering = $find("<%=radChart.ClientID%>");
                if (chartRendering != null) {
                    $get("<%=svgHolder.ClientID%>").value = escape(chartRendering.getSVGString());
                }
            }, 2000);
        }

I'm not fond of using a setTimeout and I'd prefer to call the getSVGString() after the animation has completed.

Is there a way to determine when the RadHtmlChart animation has completed??

Thanks!

Marin Bratanov
Telerik team
 answered on 19 Jan 2018
1 answer
325 views

I am currently successfully compressing the server responses to HTTP requests for both regular requests and XMLHTTPRequests.

 

Unfortunately, some of my users are experiencing the following (per browser's debugging tools):

- The Request Header specifies its content-length at over three million bytes

- The Form Data section of the Request does in fact contain the key "__VIEWSTATE", whose value is 3MB (corroborating the Request Header size)

- The Request Sent time is over a minute, because the upload speed is abysmal.

 

So, I'm interested in compressing the view state specifically for XMLHTTPRequests, with the expectation that this will behave better with the user's upload speeds. I've attempted to use the RadCompression module to do this, and have been unsuccessful, which leads me to my question here:

 

How can I compress the Request Header of an AJAX request (containing the view state)?

Marin Bratanov
Telerik team
 answered on 19 Jan 2018
1 answer
98 views
Its 2018. Why is there no client-side .clear() function on the RadPageViewCollection?
Marin Bratanov
Telerik team
 answered on 19 Jan 2018
1 answer
169 views

I have been utilizing the asp:gridview and use this syntax to determine which columns to hide:

    private int GetColumnIndex(GridView grid, string ColName)
    {
        foreach (DataControlField col in grid.Columns)
        {
            if (col.HeaderText.ToLower().Trim() == ColName.ToLower().Trim())
            {
                return grid.Columns.IndexOf(col);
            }
        }
        return -1;
    }

 

Now when converting to radgrid I get the error of

'Unable to cast object of type 'Telerik.Web.UI.GridBoundColumn' to type 'System.Web.UI.WebControls.DataControlField'.'

With the below syntax:

    private int GetColumnIndexRad(Telerik.Web.UI.RadGrid grid, string colName)
    {
        foreach (DataControlField col in grid.Columns)
        {
            if (col.HeaderText.ToLower().Trim() == colName.ToLower().Trim())
            {
                return grid.Columns.IndexOf(col);
            }
        }
        return -1;
    }

 

What would be the proper way to conditionally hide columns based off a check box list selection?

 

 

Attila Antal
Telerik team
 answered on 19 Jan 2018
1 answer
138 views

Hello,

   We upgraded our controls and now our toolbar buttons are moved to a drop down button to the right.  There is plenty of room for our buttons, but they still go into the menu.  I've attached a screenshot.

Marin Bratanov
Telerik team
 answered on 19 Jan 2018
25 answers
965 views
Is there a way to have the system create automatic page breaks as opposed to creating a single paged PDF document.  I was hoping to maybe use this as an option to export a page to a PDF report but the text cuts off because it's larger than a single A4 page.  I'm guessing that is beyond the scope of this but thought it was worth asking.

Thanks,

Richard
Rumen
Telerik team
 answered on 19 Jan 2018
7 answers
345 views
Hi,
I am using the aggregate function of the Telerik. see code below)

<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldName="Category" HeaderText="Categoria" />
<telerik:GridGroupByField FieldName="RiskValue" Aggregate="Avg" HeaderText="Valore medio di rischio" />
</SelectFields>                                    
<GroupByFields>
<telerik:GridGroupByField FieldName="Category" HeaderText="categoria" />
</GroupByFields>                                   
</telerik:GridGroupByExpression>  
</GroupByExpressions>          

Is it possible to sort the columns according to the value of the aggregate function (average)?

Kind regards,

Dario Zanelli
Eyup
Telerik team
 answered on 19 Jan 2018
1 answer
281 views

The drop down list is populated with values, but when they are selected nothing happens to the table.

I am trying to iterate through the column, get the distinct values and add them to a filter.

It works when i Add a new asp:SqlDataSource with a distinct sql statement, then add datasourceID, datavalue and datatext to the ComboBox, but need to get this working programmatically.

Column:

<telerik:GridBoundColumn DataField="OperationalTypeName" HeaderText="OperationalTypeName" SortExpression="OperationalTypeName">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="operationtypeComboBox" runat="server" RenderMode="Lightweight"
                            SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("OperationalTypeName").CurrentFilterValue %>'
                            OnClientSelectedIndexChanged="OpertationalTypeIndexChanged">
                        </telerik:RadComboBox>

                        <telerik:RadScriptBlock runat="server">
                            <script type="text/javascript">
                                function OpertationalTypeIndexChanged(sender, args) {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("OperationalTypeName", args.get_item().get_value();, "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
               </telerik:GridBoundColumn>

 

ItemDataBound:

    protected void GridView1_ItemDataBound(object sender, GridItemEventArgs e)
    {
         if (e.Item is GridFilteringItem)
        {
            GridFilteringItem item = (GridFilteringItem)e.Item;
            RadComboBox combo = (RadComboBox)item.FindControl("operationtypeComboBox");
            //combo.Items.Add(new RadComboBoxItem("ALL"));
            foreach (var filter in filterOperationalType())

//filterOperatiionType returns the correct list

           {

                combo.Items.Add(new RadComboBoxItem(filter, filter));

// they are added to the ComboBox but do not work, the html generated is exactly the same as the filter options that work through using DataSourceID used on the ComboBox.
            }
        }        
    }

    private List<string> filterOperationalType()
    {

        DataView view = (DataView)this.SqlDataSource1.Select(DataSourceSelectArguments.Empty);
        List<string> list = new List<string>();
        foreach (DataRow item in view.Table.Rows)
        {
            list.Add(item.ItemArray[1].ToString());
        }
        var a = list.Distinct().ToList();
        return a;
    }

 

 

Thank you

Attila Antal
Telerik team
 answered on 19 Jan 2018
7 answers
106 views

In Chrome and IE the clicking of the SELECT button for the uploads is kinda difficult when using MATERIAL skin, see attached screenshot.

The cursor becomes caret when hovering the button's text and clicking it is not always working.

This not the case when we try the same at RadAsyncUpload itself so maybe something to do with IFRAME use?

Marc
Rumen
Telerik team
 answered on 19 Jan 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?