Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
60 views
When process data in DropdownTree, need add method get ParentofNodeValue,ChildOfNodeValue.
Kate
Telerik team
 answered on 20 Jun 2013
2 answers
383 views
Hello,

I'm having an issue with a radgrid that populates data from a linq query.  The grid uses an OnItemDataBound and OnItemCommand method.

Looking at the page source after being compiled, the viewstate looks absolutely massive, as if the grid is trying to stick the binary file in the viewstate somehow.

I tried increasing the size of the maxJsonLength through web.config to no avail.

The specific error is:

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

I'm uploading a file, and then clicking back to a page that rebinds the radgrid containing an attachment column which triggers the onitemcommand method. 

Thanks ahead of time.


ASPX:

<telerik:RadGrid ID="procGrid" runat="server" AutoGenerateColumns="False" 
                    CellSpacing="0" GridLines="None" onneeddatasource="procGrid_NeedDataSource" OnItemDataBound="grdProcedures_ItemDataBound2" OnItemCommand="grdFiles_ItemCommand">
<MasterTableView>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
  
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
  
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
  
    <Columns>
        <telerik:GridBoundColumn FilterControlAltText="Filter column column" 
            UniqueName="column" DataField="name" HeaderText="Name">
            <ItemStyle Width="400px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Id" 
            FilterControlAltText="Filter column1 column" UniqueName="column1">
        </telerik:GridBoundColumn>
        <telerik:GridHyperLinkColumn AllowSorting="False" 
            FilterControlAltText="Filter column2 column" UniqueName="column2" 
            HeaderText="Review">
            <ItemStyle Width="100px" />
        </telerik:GridHyperLinkColumn>
                    <telerik:GridAttachmentColumn FileName="attachment" 
                        FilterControlAltText="Filter procedure_document column" HeaderText="Procedures" 
                        UniqueName="procedure_document"
                        AttachmentDataField="procedure_document" 
                        AttachmentKeyFields="procedure_document" 
                        Text="View Procedure" >
                         
                    </telerik:GridAttachmentColumn>
    </Columns>
  
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
  
<FilterMenu EnableImageSprites="False"></FilterMenu>
  
<ClientSettings EnablePostBackOnRowClick="true">
  
  
</ClientSettings>
                </telerik:RadGrid>


CS:


protected void grdProcedures_ItemDataBound2(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        string ProcId = item["column1"].Text;
        HyperLink link = (HyperLink)item["column2"].Controls[0];
        link.Text = "Edit Procedure";
        string url = "~/procedure.aspx?AuditType=" + AuditType + "&AuditID=" + AuditID + "&StandardID=" + StandardID + "&ProcedureID=" + ProcId;
        link.NavigateUrl = url;
    }
}
protected void grdFiles_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.DownloadAttachmentCommandName)
    {
        using (var db = new isoAuditModelContainer())
        {
            RadAjaxManager Manager = new RadAjaxManager();
            Manager.EnableAJAX = false;
            GridDownloadAttachmentCommandEventArgs args = e as GridDownloadAttachmentCommandEventArgs;
            GridDataItem item = (GridDataItem)e.Item;
            string fileName = args.FileName;
            string ProcId = item["column1"].Text;
            int ProcId2 = Convert.ToInt16(ProcId);
            //int attachmentId = (int)args.AttachmentKeyValues["procedure_document"];
            var query = (from x in db.procedures where x.Id == ProcId2 select x).First();
            string extension = query.file_extension;
            byte[] binaryData = (byte[])query.procedure_document;
            Response.Clear();
            //Response.ContentType = query.fileExtension;
            Response.AddHeader("content-disposition", "attachment; filename=" + fileName + extension);
            Response.BinaryWrite(binaryData);
            Response.OutputStream.Write(binaryData, 0, binaryData.Length);
            Response.Flush();
            Response.Close();
            Response.End();
        }
    }
}






Kostadin
Telerik team
 answered on 20 Jun 2013
4 answers
998 views
I have a complex RadGrid with many columns and filters on all the columns. As the use can end up with a complex set of filter I want to add a 'clear all filters' button. As it is a parent/detail grid I figured I would use the space next to the filters created by the expand/collapse column. So I managed to 'successfully' put a new image button in that space with the following code which I have in my Grid ItemDataBound method..

// Creating filtering row clear all filters button
if ((e.Item.ItemType == GridItemType.FilteringItem))
{
    var clearFilterButton = new RadButton
    {
        ButtonType = RadButtonType.StandardButton,
        Height = 22,
        Width = 22
    };
 
    clearFilterButton.Image.EnableImageButton = true;
    clearFilterButton.Image.ImageUrl = string.Format("../App_Themes/{0}/Images/ClearFilter.png", Page.Theme);
    clearFilterButton.ToolTip = "Clear current filter(s)";
    clearFilterButton.Click += ClearButton_Click;
 
    var expandCollapseColumn = (GridTableCell) e.Item.Controls[0];
    expandCollapseColumn.Controls.Add(clearFilterButton);
}

I'm assuming I have this all wrong as I have two problems.
1) Clicking the button makes it disappear
2) Clicking the button never fires the clearbutton event.

Can anyone help and maybe this should be a feature in the RadGrid control in the future?

Thanks

Colin
ColinBlakey
Top achievements
Rank 2
 answered on 20 Jun 2013
1 answer
256 views
I have an old project built with ASP.NET 2.0. It is a Website project and the upgrade wizard menu is not available.
When using "Convert to Telerik site" it is not possible to select the current project to be upgraded, there is no entry and manually browsing to the project's root directory is not accepted.

I tried this tutorial: http://www.telerik.com/support/kb/aspnet-ajax/general/updating-radcontrols-for-asp-net-to-another-version-or-license.aspx
However in step 5 ("From the newly downloaded and unzipped files, copy the new DLL ...") it becomes confusing. In my project's bin folder are many files like RadEditorNet2.dll and so on, but in the downloaded hotfix in the folder bin45 I can just find 3 files (Telerik.Web.UI etc.), that are not present in the old project's folder, so I can't replace anything.

Furthermore I copied these 3 files in my project's bin folder and I added them as reference. After setting the target framework to 4.5 it compiled successfully. Now I think, that I have to change all old tags like <prefix:RadEditor2Net ...> to <prefix:RadEditor>.

Is this the right way or do you know any other solution?
Biliana Ficheva
Telerik team
 answered on 20 Jun 2013
1 answer
57 views
Hi,

We are having issues with the Grid sorting and filtering in Windows 8 and IE 10 environment. Seems to work fine in Window 7, IE 10 environment. We using AJAX controls  Q1 2013, .net 3.5. The grid is wrapped in an update panel and displayed in a .aspx page, inside an IFRAME; any suggestions?

Thank you very much!

Randy Sullivan
Maria Ilieva
Telerik team
 answered on 20 Jun 2013
1 answer
84 views
I have a Telerik project that I created with VS2010.  The problem I'm having is as follows: 

 In IE9 when i upload a video and play it in rad editor it works fine.But in design made when i select the video and then try to  delete it the selection box goes away but video stays and continues to play and then i scroll anywhere video box also scrolls with scroll bar.
I am using this code.
<div>
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadEditor ID="ed1" runat="server" Width="722px" Height="750px">
            <Content>
                    <OBJECT  height='400px' width='600px' id='VIDEO' style='position:absolute;left:50px;top:50px;border:1px solid lightgray;'
                     CLASSID = 'CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'type=application/x-oleobject>
                     <param name=URL value='NewFolder1\Wildlife.wmv'/>
                     </OBJECT>
            </Content>
        </telerik:RadEditor>
    </div>
Ivaylo
Telerik team
 answered on 20 Jun 2013
2 answers
218 views

how di programitaccly acces the DataSource property of a RadComboBox that is in the Filtertemplate of a GridDropdownColumn of my grid
I want to set the datasource in code behind at the server side

							<telerik:GridDropDownColumn DataField="ProductVolumeID" DataSourceID="ProductVolumeDataSource"
									HeaderText="Product Volume" ListTextField="LongDesc" ListValueField="ProductVolumeID"
									UniqueName="ProductVolumeID">
									<FilterTemplate>
											<telerik:RadComboBox ID="ProductVolumeComboBox" DataSourceID="ProductVolumeDataSource" DataTextField="LongDesc"
													DataValueField="ProductVolumeID" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ProductVolumeID").CurrentFilterValue %>'
													runat="server" OnClientSelectedIndexChanged="ProductVolumeIndexChanged">
													<Items>
															<telerik:RadComboBoxItem Text="All" />
													</Items>
											</telerik:RadComboBox>
											<telerik:RadScriptBlock ID="ProductVolumeIndexChangedRadScriptBlock" runat="server">
													<script type="text/javascript">
                        		function ProductVolumeIndexChanged(sender, args) {
															var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
															tableView.filter("ProductVolumeID", args.get_item().get_value(), "StartsWith");
														}
													</script>
											</telerik:RadScriptBlock>
									</FilterTemplate>
							</telerik:GridDropDownColumn>
How do i programitaccly access the DataSource property of a RadComboBox that is in the FilterTemplate of a GridDropDownColumn
I want to set the datasource in the server side code and not use the DataSourceID
  
                            <telerik:GridDropDownColumn DataField="ProductVolumeID" DataSourceID="ProductVolumeDataSource"
                                    HeaderText="Product Volume" ListTextField="LongDesc" ListValueField="ProductVolumeID"
                                    UniqueName="ProductVolumeID">
                                    <FilterTemplate>
                                            <telerik:RadComboBox ID="ProductVolumeComboBox" DataSourceID="ProductVolumeDataSource" DataTextField="LongDesc"
                                                    DataValueField="ProductVolumeID" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ProductVolumeID").CurrentFilterValue %>'
                                                    runat="server" OnClientSelectedIndexChanged="ProductVolumeIndexChanged">
                                                    <Items>
                                                            <telerik:RadComboBoxItem Text="All" />
                                                    </Items>
                                            </telerik:RadComboBox>
                                            <telerik:RadScriptBlock ID="ProductVolumeIndexChangedRadScriptBlock" runat="server">
                                                    <script type="text/javascript">
                                function ProductVolumeIndexChanged(sender, args) {
                                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                            tableView.filter("ProductVolumeID", args.get_item().get_value(), "StartsWith");
                                                        }
                                                    </script>
                                            </telerik:RadScriptBlock>
                                    </FilterTemplate>
                            </telerik:GridDropDownColumn>
Richard
Top achievements
Rank 1
 answered on 20 Jun 2013
3 answers
262 views
Good Afternoon,

I am currently having an issue with the OnClick Events of a RadTabStrip which is supposed to change the RadPageViews of a RadMultiPage. After placing the following code on a page which inherits no Master Page, with the following definition of a RadScriptManager, everything works fine.

<asp:Content ID="ContentPlaceHolder_RegisterUser" ContentPlaceHolderID="ContentPlaceHolder_MainContent" runat="server">
     
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RegisterUser_RadTabStrip">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RegisterUser_RadTabStrip" />
                    <telerik:AjaxUpdatedControl ControlID="RegisterUser_RadMultiPage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RegisterUser_RadMultiPage">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RegisterUser_RadTabStrip" />
                    <telerik:AjaxUpdatedControl ControlID="RegisterUser_RadMultiPage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <link href="../../Styles/RegisterEmpresa.css" rel="stylesheet" type="text/css" />
 
    <div id="RegisterUser_FormDecoratorZone">
 
        <fieldset>
 
            <legend>
                <asp:Literal ID="RegisterUser_Fieldset_Legend" runat="server" meta:resourcekey="RegisterUser_Fieldset_Legend" />
            </legend>
 
            <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel">
 
                <telerik:RadTabStrip runat="server" ID="RegisterUser_RadTabStrip" SelectedIndex="1" MultiPageID="RegisterUser_RadMultiPage" AutoPostBack="true">
 
                    <Tabs>
 
                        <telerik:RadTab meta:resourcekey="RegisterUser_RadTabStrip_User" PageViewID="RadPageView_User" runat="server">
                        </telerik:RadTab>
 
                        <telerik:RadTab meta:resourcekey="RegisterUser_RadTabStrip_Company"
                            PageViewID="RadPageView_Company" runat="server" Selected="True">
                        </telerik:RadTab>
 
                    </Tabs>
 
                </telerik:RadTabStrip>
 
                <telerik:RadMultiPage id="RegisterUser_RadMultiPage" runat="server" SelectedIndex="1" EnableEmbeddedScripts="true">
                 
                    <telerik:RadPageView ID="RadPageView_User" runat="server" >
                        olaaaaaaaaaaaaa 1
                    </telerik:RadPageView>
 
                    <telerik:RadPageView ID="RadPageView_Company" runat="server">
                        olaaaaaaaaaaaaa 2
                    </telerik:RadPageView>
 
                </telerik:RadMultiPage>
 
            </telerik:RadAjaxPanel>
 
        </fieldset>
 
    </div>
 
    <script type="text/javascript">
 
        ....
 
    </script>
 
</asp:Content>


But after placing the same code inside a Master Page which defines the RadScriptManager, the OnClick Events performed on the RadTabs do not seem to fire.

<form id="form" runat="server">
 
           <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
               <Scripts>
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
               </Scripts>
               <Services>
                   <asp:ServiceReference Path="../../WebService/PTC_WebService.svc" />
               </Services>
           </telerik:RadScriptManager>


I would be much appreciated if you could assist me.

Thank you for our attention.

Best Regards,

Nencho
Telerik team
 answered on 20 Jun 2013
4 answers
480 views
Hi,


How can I make telerik radtextbox rounded corner?

Thanks,
Danail Vasilev
Telerik team
 answered on 20 Jun 2013
7 answers
112 views

can someone tell me how to do this same thing but, make it for a DATE CONTROL??
and of course not a StartsWith but an Equals

 

 

 

RadFilterStartsWithFilterExpression expr1 = new RadFilterStartsWithFilterExpression("LOGDISPLAY");

 

expr1.Value =

 

"";

 

UnreportedItemsRadFilter.RootGroup.AddExpression(expr1);

UnreportedItemsRadFilter.RecreateControl();

Vasil
Telerik team
 answered on 20 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?