Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
121 views
Hello,

I was wondering if there's any way to change (or remove) the RadMenu's animation from the client-side?

Background/more info (optional reading):
I'm setting up a 'page tour' and I'm having trouble positioning elements near menu items. I can get the right RadMenu and RadMenuItem client objects and even tell the parent RadMenuItem to open but when I try to position a div relative to a menu item it displays up the top of the menu. I assume this is because it is basing the position on the menu item's position before the animation takes place. It works fine if I set the ExpandAnimation-Type to "None" but I'd like to have an animation and only disable it when the user is going through the 'page tour'.

Thanks,
Pete
Pete
Top achievements
Rank 1
 answered on 17 Sep 2013
1 answer
83 views

 We had RadControls for ASP.NET AJAX 2010 verstion when this app was first created. ASPX file has a simple RadGrid in it and everything worked fine. 
Beginning this year we found out RadGrid in my App is not working with IE10. Telerik suggested us to upgrade to 2013 version.Then we did upgrade.
Now we are haveing the latest version of RadControls (2013 Q2). The .net framework is 3.5. I copied all dll files from C:\Program Files\Telerik\RadControls for ASP.NET AJAX Q2 2013\Bin35
to my own project bin folder and added reference again.

The problem is that RadGrid is getting worse it does not even work for IE8 anymore.
When<telerik:GridButtonColumn ButtonType="LinkButton" DataTextField="type" UniqueName="type" CommandName="OnType"  ></telerik:GridButtonColumn> is clicked
dataItem["document"].Text  keeps on getting a vaule of "&nbsp;".

Below are my ASPX file and code behind it.
  
Thank you for your help.



****ASPX file:***********


<
telerik:RadScriptManager runat="server" ID="RadScriptManager2" />
                        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                            <AjaxSettings>
                                <telerik:AjaxSetting AjaxControlID="dgDocuments">
                                    <UpdatedControls>
                                        <telerik:AjaxUpdatedControl ControlID="dgDocuments" LoadingPanelID="RadAjaxLoadingPanel1" />
                                    </UpdatedControls>
                                </telerik:AjaxSetting>
                            </AjaxSettings>
                        </telerik:RadAjaxManager>
                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />  
             <telerik:RadGrid runat="server" ID="dgDocuments" AllowPaging="True"  Width="60%" 
                   AllowSorting="False" GridLines="None"
                 Skin="Simple" AutoGenerateColumns="False"  PageSize="200" 
                 ShowStatusBar="true" OnItemCommand="dgDocuments_ItemCommand" 
                 onneeddatasource="dgDocuments_NeedDataSource" 
                 oncolumncreated="dgDocuments_ColumnCreated" 
                 onitemcreated="dgDocuments_ItemCreated" >
            <GroupHeaderItemStyle Font-Bold = "true"    /> 
            <GroupingSettings CaseSensitive="false" />
            <ClientSettings AllowGroupExpandCollapse="True" >
            </ClientSettings>
             <MasterTableView   GroupsDefaultExpanded="true" ItemStyle-Wrap="false" 
                  HeaderStyle-Wrap="false"  AutoGenerateColumns="false" EditMode="InPlace"   
                  ShowHeader = "false"    TableLayout="Auto"  GroupLoadMode="Client" >
                <PagerStyle Mode="NumericPages" />
             <Columns>                          
             <telerik:GridButtonColumn ButtonType="LinkButton" DataTextField="type" UniqueName="type" CommandName="OnType"  ></telerik:GridButtonColumn>
             <telerik:GridBoundColumn  DataField="status" Visible="false" ></telerik:GridBoundColumn
             <telerik:GridBoundColumn  DataField="document" Visible="false" ></telerik:GridBoundColumn>                      
            </Columns>          
            <GroupByExpressions>
              <telerik:GridGroupByExpression >
                                    <GroupByFields>
                                        <telerik:GridGroupByField   FieldName="id" HeaderText=" " HeaderValueSeparator=""  />
                                    </GroupByFields>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldName="document" HeaderText=" " HeaderValueSeparator=""   />
                                    </SelectFields>
               </telerik:GridGroupByExpression>
             </GroupByExpressions>
            </MasterTableView>
           </telerik:RadGrid>

*****Code****:

protected
void dgDocuments_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
       {
           DataTable table = new DataTable();
           table.Columns.Add("document", typeof(string));
           table.Columns.Add("type", typeof(string));
           table.Columns.Add("status", typeof(string));
           table.Columns.Add("id", typeof(int));
           if (Session["commercial"].ToString().ToUpper() == "N")
           {
               table.Rows.Add("Product Catalog", "Active Product", "CURRENT",1);
           }
           table.Rows.Add("Product Specifications (EHB)", "Active Product", "CURRENT", 2);
           table.Rows.Add("Product Specifications (EHB)", "Out of Production", "DISCONTINUED", 2);
           table.Rows.Add("Installation Instructions", "Active Product", "CURRENT",3);
           table.Rows.Add("Installation Instructions", "Out of Production", "DISCONTINUED",3);
           table.Rows.Add("Service Literature", "Active Product & Out of Production", "BOTH", 4);
           table.Rows.Add("Service & Application Notes", "Active Product & Out of Production", "BOTH",5);
           table.Rows.Add("Application and Design Guidelines", "Active Product & Out of Production", "BOTH",6);
           table.Rows.Add("Wiring Diagrams", "Active Product", "CURRENT",7);
           table.Rows.Add("Wiring Diagrams", "Out of Production", "DISCONTINUED",7);
           table.Rows.Add("User Manuals", "Active Product", "CURRENT", 8);
           table.Rows.Add("User Manuals", "Out of Production", "DISCONTINUED", 8);                  
           dgDocuments.DataSource = table;
       }
       protected void dgDocuments_ItemCommand(object source, GridCommandEventArgs e)
       {
           if (e.CommandName.Equals("OnType"))
           {
               GridDataItem dataItem = (GridDataItem)e.Item;
               Session["ProductStatus"] = dataItem["status"].Text;
               if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == PRODUCT_CATALOG.ToUpper())
               {
                   Session["publication"] = PRODUCT_CATALOG;
                   Session["publicationID"] = "9";
                   Response.Redirect("SearchbyCategory_ProductCatlog.aspx");
               }
               else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == ENGINEERING_HANDBOOK.ToUpper())
               {
                   Session["publication"] = ENGINEERING_HANDBOOK;
                   Session["publicationID"] = "8";
                   Response.Redirect("SearchbyCategory_engineering.aspx");
               }
               else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == HOMEOWNERS_MANUALS.ToUpper())
               {
                   Session["publication"] = HOMEOWNERS_MANUALS;                  
                   Session["publicationID"] = "5";
                   Response.Redirect("SearchbyCategory.aspx");
               }
               else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == INSTALLATION_INSTRUCTION.ToUpper())
               {
                   Session["publication"] = INSTALLATION_INSTRUCTION;
                   Session["publicationID"] = "1";
                   Response.Redirect("SearchbyCategory.aspx");
               }
               else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == WIRING_DIAGRAMS.ToUpper())
               {
                   Session["publication"] = WIRING_DIAGRAMS;
                   Session["publicationID"] = "3";
                   Response.Redirect("SearchbyCategory.aspx");
               }
               else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == SERVICE_MANUALS.ToUpper())
               {
                   Session["publication"] = SERVICE_MANUALS;
                   Session["publicationID"] = "4";
                   Response.Redirect("SearchbyCategory.aspx");
               }
               else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == SERVICE_APP.ToUpper())
               {
                   Session["publication"] = SERVICE_APP;
                   Session["publicationID"] = "6";
                   Response.Redirect("SearchbyCategory.aspx");
               }
               else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == APPLICATION_DESIGN.ToUpper())
               {
                   Session["publication"] = APPLICATION_DESIGN;
                   Session["publicationID"] = "13";
                   Response.Redirect("SearchbyCategory.aspx");
               }
           }
       }
Jayesh Goyani
Top achievements
Rank 2
 answered on 17 Sep 2013
4 answers
310 views
When i was running this under debug mode in VS everything looked perfect, so I moved everything on to my webserver and when I did the arrows and borders for the radcombobox is gone.


Here is the import of the css
<head id="Head1" runat="server">
    <title></title>
    <link href="css/signup.css" rel="stylesheet" type="text/css" />
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <style type="text/css">
        .body
        {
        }
    </style>
</head>

Here is the aspx for the RadComboBox

                    <div class="ControlContainerContainer">
                        <telerik:RadComboBox ID="StateComboBox" Runat="server" Width="250px">
                        </telerik:RadComboBox>
                    </div>

This is what I noticed, when I renamed the css everything broke, so I know it's picking up the css, when I removed <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <style type="text/css">
        .body
        {
        }
    </style>
what happeneded was the css broke, however the border showed up for the radcombobox but the arrow still did not.

Below is my entire css

/* CSS Document */
body{
    background:url(images/bg.gif) repeat-x 0 0 #F7F7F7; color:#171717;
    font:normal 13px/20px Georgia, "Times New Roman", Times, serif;
    margin:0; padding:0;}
div, h1, h2, h3, h4, h5, h6, form, label, input, span, ul, li, p, a{
    margin:0; padding:0;}
ul{
    list-style:none;}
.spacer{
    font-size:0; line-height:0; clear:both;}


/* -- top navigation start -- */
#topNav{
    width:683px; margin:0 auto; height:45px;}
#topNav ul{
    width:620px; margin:0 auto;}
#topNav ul li{
    height:37px; float:left;
    background:url(images/bg.gif) repeat-x 0 0 #292929; color:#C1C1C1;
    font:bold 16px/37px Arial, Helvetica, sans-serif;}
#topNav ul li a{
    padding:0 18px; height:37px; float:left; text-decoration:none; display:block;
    background:url(images/bg.gif) repeat-x 0 0 #292929; color:#C1C1C1;
    font:bold 16px/37px Arial, Helvetica, sans-serif;}
#topNav ul li a:hover{
    background:url(images/top_btn_h.gif) no-repeat center bottom;}
#topNav ul li a.hover{
    padding:0 18px; height:37px; float:left; text-decoration:none; display:block;
    background:url(images/top_btn_h.gif) no-repeat center bottom; color:#C1C1C1;
    font:bold 12px/37px Arial, Helvetica, sans-serif;}
/* -- top navigation start -- */

#userCreate div.userCreationouter
{
width: 100%;
height:auto;
}
    
#userCreate div.userCreationleft{
margin-left:auto;
margin-right:auto;
width: 53%;
height:auto;
}
#userCreate div.userCreationleft h2{
    font:bold italic 16px/20px Georgia, "Times New Roman", Times, serif; color:#800080; text-align:left; padding-left:19px;}
#userCreate div.userCreationleft h2 span{
    color:#000000; background-color:#800080}

#userCreate div.userCreationmiddle{
margin-left:auto;
margin-right:auto;
width:50%;
height:auto;
}

#userCreate div.ControlOuterContainer{
    margin: 0 auto 2px auto;
width: 100%;
height:auto;
float: left;
border-top-style:solid;
border-top-color:Black;
padding-top:10px;
padding-bottom:10px;
padding-right:10px;
padding-left:10px;
border-width:thin;
}
#userCreate div.ControlLabelContainer{
width: 35%;
height:auto;
float: left;
text-align:right;
padding-right:1em;
padding-bottom:8px;
font-size:8pt;
}
#userCreate div.ControlContainerContainer{
width: 60%;
height:auto;
float: left;
padding-bottom:8px;
}
#userCreate div.LoginBox{
margin-left:auto;
margin-right:auto;
width: 53%;
height:auto;
border-style:solid;
border-top-color:Black;
padding-top:10px;
padding-bottom:10px;
padding-right:10px;
padding-left:10px;
border-width:thin;
background:url(../images/blue_bg.gif);color:#4B2B3E;
}
#userCreate div.LoginBoxFont
{
    font:bold 8px/12px Georgia, "Times New Roman", Times, serif; padding:0 9px 0 22px; color#F7F7F7;
}

/* -- body start -- */
#body{
    width:683px; margin:0 auto; padding:0 0 60px 0;
    background:url(../images/header_bg.gif) no-repeat right top #F7F7F7; color:#171717;}
#body img.logo{
    border:none; margin:30px 0 0 0;}
#body h1{
    background:url(../images/punch_line.gif) no-repeat 0 0 #F7F7F7; color:#171717;
    width:142px; height:49px; text-indent:-20000px;}
    /*--Body end -- */



Thanks!
Kevin
Top achievements
Rank 1
 answered on 17 Sep 2013
5 answers
348 views
Hi,

How can we find all RadCombobox using jQuery Seletor and also attach javascript function to it.

Actual requirement is to find all controls on the page by jquery selector or telerik client api if available.
moegal
Top achievements
Rank 1
 answered on 16 Sep 2013
2 answers
102 views
Hello,
I am extremely new to asp.net and especially new to telerik. I am trying to create a gridview with the following code, just to see how it works, but i ran into a wierd problem, i added the commanditemdisplay to top, and it adds the "add button" every time i click it for some reason it adds the edit and delete buttons multipe times per row, not sure what i am doing wrong in order to cause that, but can someone please help me with this.

public partial class Default4 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["GridData"] == null)
        {
            DataTable table = GetTable();
            Session.Add("GridData", table);
        }
        DefineGridStructure();
    }


    private void DefineGridStructure()
    {
        
        DataTable current = (DataTable)Session["GridData"];

        RadGrid grid = new RadGrid();
        grid.ID = "RadGrid1";
        grid.DataSource = current;
        grid.AutoGenerateEditColumn = true;
        grid.AutoGenerateDeleteColumn = true;
        grid.AllowAutomaticInserts = true;
        grid.Width = Unit.Percentage(100);
        grid.PageSize = 15;
        grid.AllowPaging = true;
        grid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
        grid.AutoGenerateColumns = false;
        grid.MasterTableView.Width = Unit.Percentage(100);
        grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom;
        grid.MasterTableView.DataKeyNames = new string[] { "RowNumber" };
        GridBoundColumn boundColumn = new GridBoundColumn();
        boundColumn.DataField = "RowNumber";
        boundColumn.HeaderText = "RowNumber";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Size";
        boundColumn.HeaderText = "Size";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Description";
        boundColumn.HeaderText = "Description";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Quantity";
        boundColumn.HeaderText = "Quantity";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Duration";
        boundColumn.HeaderText = "Duration";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "DurationType";
        boundColumn.HeaderText = "DurationType";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Amount";
        boundColumn.HeaderText = "Amount";
        grid.MasterTableView.Columns.Add(boundColumn);
        grid.DataBind();
        PlaceHolder1.Controls.Add(grid);
    }



    static DataTable GetTable()
    {
        //
        // Here we create a DataTable with a few columns.
        //
        // Create Datatable to store all colums
        DataTable dt = new DataTable();
        DataRow dr = null;

        dt.Columns.Add(new DataColumn("RowNumber", typeof(string)));
        dt.Columns.Add(new DataColumn("Size", typeof(string)));
        dt.Columns.Add(new DataColumn("Description", typeof(string)));
        dt.Columns.Add(new DataColumn("Quantity", typeof(string)));
        dt.Columns.Add(new DataColumn("Unit", typeof(string)));
        dt.Columns.Add(new DataColumn("Duration", typeof(string)));
        dt.Columns.Add(new DataColumn("DurationType", typeof(string)));
        dt.Columns.Add(new DataColumn("Amount", typeof(string)));

        dr = dt.NewRow();
        dr["RowNumber"] = 1;
        dr["Size"] = string.Empty;
        dr["Description"] = string.Empty;
        dr["Quantity"] = string.Empty;
        dr["Unit"] = string.Empty;
        dr["Duration"] = string.Empty;
        dr["DurationType"] = string.Empty;
        dr["Amount"] = string.Empty;
        dt.Rows.Add(dr);
        return dt;
    }
}
Brad
Top achievements
Rank 1
 answered on 16 Sep 2013
1 answer
107 views
Hi,

I've got a problem where i'm trying to build a webpart that uses a RadTreeList that nests a RadGrid within the second column of the RadTreeList to give me a hierarchy of grids. This allows me to view a set of grid data at each level of a hierarchy and alter the data within, due to the size of the hierarchies and grids i only want to load the grid data if an item has been selected within a filter control.

I have managed to create my RadTreeList with the nested Grids which loads and add a NeedDataSource to each grid as its being loaded. This will load the initial set of data and i can then trigger the edit on the grids which seems to work OK.

My problem is when i come to deselect a grid from my filter control and then in the Grid NeedDataSource it sets the datasource back to null and in turn i would expect on the loading of the grid the grid shouldn't be displayed as its datasource is empty. However for some reason the grid is still persisting the previously loaded data? Can anyone tell me why this is, have i missed something?

I have posted my HTML/ASP markup and C# code below:

<telerik:RadTreeList ID="rtl_TaxonomyGrids" runat="server" AutoGenerateColumns="False" DataKeyNames="Allocation" ParentDataKeyNames="Parent_Allocation" OnItemDataBound="rtl_TaxonomyGrids_ItemDataBound" OnLoad="rtl_TaxonomyGrids_Load" OnNeedDataSource="rtl_TaxonomyGrids_NeedDataSource" OnItemCreated="rtl_TaxonomyGrids_ItemCreated">
    <Columns>
        <telerik:TreeListBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name">
            <HeaderStyle Width="100px"></HeaderStyle>
        </telerik:TreeListBoundColumn>
        <telerik:TreeListTemplateColumn UniqueName="PermissionsGrid" HeaderText="Permissions"
            DataField="Allocation">
            <ItemStyle CssClass="TreeGridCell NoPadding"></ItemStyle>
            <ItemTemplate>
                <asp:Label ID="lb_GridAllocation" Font-Bold="true" Font-Italic="true" Text='<%# Eval("Allocation") %>'
                    Visible="false" runat="server"></asp:Label>
                <telerik:RadGrid ID="rg_TaxonomyGroupProfiling" AllowMultiRowSelection="True" BorderStyle="None" runat="server" AutoGenerateColumns="false" OnItemDataBound="rg_TaxonomyGroupProfiling_ItemDataBound" OnItemCreated="rg_TaxonomyGroupProfiling_ItemCreated">
                    <ClientSettings AllowExpandCollapse="true">
                        <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True"></Selecting>                     
                    </ClientSettings>
                    <MasterTableView ClientDataKeyNames="Allocation" Width="100%" EditMode="InPlace">
                        <Columns>                        
                            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                            </telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn Visible="false" UniqueName="Allocation" DataField="Allocation" HeaderText="Allocation" ReadOnly="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="UserGroup" DataField="UserGroup" HeaderText="UserGroup" ReadOnly="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="Status" DataField="Status" HeaderText="Status" ReadOnly="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  UniqueName="Inherits" DataField="Inherits" HeaderText="Inherits" ColumnEditorID="GridTextBoxColumnEditor1">
                            </telerik:GridBoundColumn>                          
                            <telerik:GridBoundColumn UniqueName="View" DataField="View" HeaderText="View" ColumnEditorID="GridTextBoxColumnEditor1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  UniqueName="Competent" DataField="Process" HeaderText="Competent" ColumnEditorID="GridTextBoxColumnEditor1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="BatchSize" DataField="BatchSize" HeaderText="Batch Size" ColumnEditorID="GridTextBoxColumnEditor1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="Escalate" DataField="Escalate" HeaderText="Escalate" ColumnEditorID="GridTextBoxColumnEditor1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  UniqueName="Suspend" DataField="Suspend" HeaderText="Suspend" ColumnEditorID="GridTextBoxColumnEditor1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="SamplingX" DataField="SamplingX" HeaderText="SamplingX" ColumnEditorID="GridTextBoxColumnEditor1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="SamplingY" DataField="SamplingY" HeaderText="SamplingY" ColumnEditorID="GridTextBoxColumnEditor1">
                            </telerik:GridBoundColumn>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">
                                <HeaderStyle Width="20px"></HeaderStyle>
                                <ItemStyle CssClass="MyImageButton"></ItemStyle>
                            </telerik:GridEditCommandColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="35px">
                </telerik:GridTextBoxColumnEditor>
                <telerik:GridDropDownListColumnEditor ID="GridDropDownListColumnEditor1" runat="server"
                    DropDownStyle-Width="70px">
                </telerik:GridDropDownListColumnEditor>               
            </ItemTemplate>
        </telerik:TreeListTemplateColumn>
    </Columns>
</telerik:RadTreeList>

protected void rtl_TaxonomyGrids_NeedDataSource(object sender, Telerik.Web.UI.TreeListNeedDataSourceEventArgs e)
{
    if (sender is RadTreeList)
    {
        RadTreeList tree = sender as RadTreeList;
        tree.DataSource = null;
        tree.DataSource = dh.GetTaxonomyData();
    }
}
 
protected void rtl_TaxonomyGrids_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
{
    if (e.Item is TreeListDataItem)
    {               
        RadGrid grid = (RadGrid) e.Item.FindControl("rg_TaxonomyGroupProfiling");
        grid.NeedDataSource += new GridNeedDataSourceEventHandler(rg_TaxonomyGroupProfiling_NeedDataSource);
    }
}
 
protected void rg_TaxonomyGroupProfiling_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    if (sender is RadGrid)
    {
        RadGrid grid = sender as RadGrid;
        grid.MasterTableView.DataSource = null;
        grid.DataSource = null;
 
        string taxSelection = this.GroupProfilerContainer.GroupProfilerContext.CriteriaSettings.Selection["Taxonomy"].ToString();
        string gpSelection =  ConverToWhereClause(this.GroupProfilerContainer.GroupProfilerContext.CriteriaSettings.Selection);
 
        TreeListDataItem nestedItem = (TreeListDataItem)(grid.NamingContainer);
        string allocation = nestedItem.GetDataKeyValue("Allocation").ToString();
 
        if (!string.IsNullOrEmpty(taxSelection))
        {
            if (taxSelection.Split(',').Contains(allocation))
            {
                grid.DataSource = dh.GetPermissionsData(allocation, gpSelection);
            }
        }
    }
}

Thanks,
JC
Tsvetoslav
Telerik team
 answered on 16 Sep 2013
10 answers
219 views
I have a RadGrid which is constructed in code behind, and datasource is set in the OnNeedDataSource event.
Everything works fine, filling the radgrid, selecting rows and so on.
But when I ajaxify the grid, either by putting it in an asp updatepanel, radajaxpanel or by using radajaxmanager, the postback works fine, but when i select a row in the grid I get this javascript error:  "JavaScript runtime error: Unable to get property 'toLowerCase' of undefined or null reference". Presumably because it can't find document.activeElement.
The javascript code that goes wrong in telerik:
var a=document.activeElement;
if(a&&a.tagName.toLowerCase()==="input"){document.activeElement.blur();

If I first select all rows, by checking the checkbox in the gridcolumn, the error doesn't appear when i select a single row.
Deyan Enchev
Telerik team
 answered on 16 Sep 2013
3 answers
243 views
Hello,

I am trying to implement a custom captcha image cache as described in your article : Captcha: Caching Provider.  I have it running successfully on my local system, storing and retrieving the images to a SQL database.  When I move the code to our web farm environment, however, it fails to instance the provider with the error below.

I think the error has something to do with namespace but I can't figure out how to specify it.  The site in the farm environment is a virtual directory under our main website, if that makes a difference.

I know it is able to read the appsetting from web.config, because if the web.config entry is removed, it fails with a different error.  The same error below is generated of the classname or namespace are changed to something invalid.  This leads me to believe that it fails in instancing the class.

Any help in solving this problem would be greatly appreciated.  I'm so close to getting it to work and I really, REALLY don't want to have to change our entire environment to use out-of-process .Net session state.

Error message, provider class code, and web.config entry follow.

Thank you,

Lisa



Error:

Server Error in '/WSCUSTSERVICE' Application.
Value cannot be null.
Parameter name: Unable to read application setting. Please make sure that you have set Telerik.Web.CaptchaImageStorageProviderTypeName in the web.config.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: Unable to read application setting. Please make sure that you have set Telerik.Web.CaptchaImageStorageProviderTypeName in the web.config.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
 
[ArgumentNullException: Value cannot be null.
Parameter name: Unable to read application setting. Please make sure that you have set Telerik.Web.CaptchaImageStorageProviderTypeName in the web.config.]
   Telerik.Web.UI.Captcha.CachingProviderFactory..ctor(CaptchaImageStorage storage) +334
   Telerik.Web.UI.CaptchaProtector.get_CachingProvider() +52
   Telerik.Web.UI.CaptchaProtector.GenerateNewCaptcha() +160
   Telerik.Web.UI.RadCaptcha.ControlPreRender() +449
   Telerik.Web.UI.RadWebControl.OnPreRender(EventArgs e) +22
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

The code for the provider class is:

Imports System.Data.SqlClient
Imports System.IO
Imports System.Linq
Imports System.Runtime.Serialization.Formatters.Binary
Imports System.Web
Imports Telerik.Web.UI
Imports Telerik.Web.UI.Captcha
Imports WalkStyles.Common
Imports System.Data
 
 
Namespace CustService
 
 
    Public Class DBImageStorageProvider
        Inherits BaseCaptchaCachingProvider
        Public Sub New(ByVal context As HttpContext)
            MyBase.New(context)
        End Sub
 
        Private Function connectionString() As String
            '' = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|CachingProviderDatabase.mdf;Integrated Security=True;User Instance=True;"
            Return ConfigMgr.ConfigSetting(ConfigMgr.CK_DSN)
        End Function
 
        Public Overrides ReadOnly Property ShouldAddCacheDependecy() As Boolean
            Get
                Return True
            End Get
        End Property
 
        Public Overrides Sub Save(ByVal key As String, ByVal image As CaptchaImage)
            Using conn As SqlConnection = GetConnection(connectionString)
                conn.Open()
                Using command As SqlCommand = New SqlCommand("INSERT INTO [RadCaptchaImageCache] ([ImageKey], [ImageContent]) VALUES (@key, @value)", conn)
                    Using ms As MemoryStream = SerializeImage(image)
 
                        command.Parameters.Add("@key", SqlDbType.NVarChar, 100)
                        command.Parameters("@key").Value = key
 
                        command.Parameters.Add("@value", SqlDbType.VarBinary, Int32.MaxValue)
                        command.Parameters("@value").Value = ms.GetBuffer()
 
                        ''command.Parameters.Add(New SqlParameter("key", key))
                        ''command.Parameters.Add(New SqlParameter("value", ms))
 
                        command.ExecuteNonQuery()
                    End Using
                End Using
            End Using
        End Sub
 
        Public Overrides Function Load(ByVal key As String) As CaptchaImage
            Dim result As CaptchaImage = Nothing
            Using conn As SqlConnection = GetConnection(connectionString)
                conn.Open()
                Using command As SqlCommand = New SqlCommand("SELECT [ImageContent] FROM [RadCaptchaImageCache] WHERE [ImageKey] = @key", conn)
                    command.Parameters.Add(New SqlParameter("key", key))
                    Dim bData As Byte() = DirectCast(command.ExecuteScalar(), Byte())
 
                    Using ms As MemoryStream = New MemoryStream()
                        result = DeserializeImage(bData, ms)
                    End Using
                End Using
            End Using
 
            Return result
        End Function
 
        Public Overrides Sub Clear(ByVal key As String)
            Using conn As SqlConnection = GetConnection(connectionString)
                conn.Open()
                Using command As SqlCommand = New SqlCommand("DELETE FROM [RadCaptchaImageCache] WHERE [ImageKey] = @key", conn)
                    command.Parameters.Add(New SqlParameter("key", key))
                    command.ExecuteNonQuery()
                End Using
            End Using
        End Sub
 
 
        Private Function GetConnection(ByVal connString As String) As SqlConnection
            Return New SqlConnection(connString)
        End Function
 
        Private Function SerializeImage(ByVal image As CaptchaImage) As MemoryStream
            Dim ms As MemoryStream = New MemoryStream()
            Dim bFormatter As BinaryFormatter = New BinaryFormatter()
            bFormatter.Serialize(ms, image)
            ms.Seek(0, 0)
 
            Return ms
        End Function
 
        Private Function DeserializeImage(ByVal bData As Byte(), ByVal ms As MemoryStream) As CaptchaImage
            Dim bFormatter As BinaryFormatter = New BinaryFormatter()
 
            ms.Write(bData, 0, bData.Length)
            ms.Seek(0, 0)
 
            Return DirectCast(bFormatter.Deserialize(ms), CaptchaImage)
        End Function
 
 
    End Class
 
End Namespace


The web.config entry for the provider is:

<!-- ================================================================= -->
<!-- Image storage cache handler for radCaptcha controls               -->
<!--                                                                   -->
<add key="Telerik.Web.CaptchaImageStorageProviderTypeName" value="CustService.DBImageStorageProvider, App_Code.lfcwuanr, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"/>

Slav
Telerik team
 answered on 16 Sep 2013
1 answer
90 views
Hi,

How can we add Text to connecting lines?

Thanks
Magdalena
Telerik team
 answered on 16 Sep 2013
1 answer
157 views
Hi, Im using that code block for add small image on the main image. Everything is fine, but when i add the small image on the main page, i can not change that small image position. I want move with mouse that small image after add.

Also, what is the insertImage last array parameter?

function imageEditorAddImage(img)
{
    var imgEditor = $find("imageEditor");
    imgEditor.insertImage(50, 50, '../../theme/images/editorImages/' + img, []);
}

Thank you
Slav
Telerik team
 answered on 16 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?