Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
154 views
I am using RadCaptcha in simple asp user control. It is working fine in normal conditions but stop working when accessed through url rewrtten address. Can you please suggest what is required to fix this problem. I am using asp.net 4.0 on iis7. I cannot find any appropriate property to fix this. Furthermore, I am not using web config to write rules, instead my rules are saved in database and urls are being handled using resolveurl.

Following is a code used in Global.asax to give you an idea of the way I am implementing url rewriting.
void Application_BeginRequest(object sender, EventArgs e)
 {
// URLRewrtingEnabled
     string ue = "";
     try
     {
         ue = System.Configuration.ConfigurationManager.AppSettings["URLRewrtingEnabled"].ToString();
     }
     catch (Exception ex)
     {
         ue = "";
     }
     if (ue.ToLower() == "true")
     {
         string fullOrigionalpath = Request.Url.ToString();
         DataAccessLayer Dal = new DataAccessLayer();
         Activity act = new Activity();
         string st, sv, sn, dp, sn2;
         st = Dal.GetDefautURL(); // Site name
         sn = Request.ServerVariables["SERVER_NAME"].ToString(); // Server name
         string ds = Dal.getDestinationURL(sn, st, fullOrigionalpath);
         if (ds != "")
         {
             try
             {
                 Context.RewritePath(ds);
             }
             catch (Exception ex)
             {
                 Dal.ErrorLog(ex.Message, "URL Rewrite");
             }
         }
     }
Pero
Telerik team
 answered on 16 Feb 2011
3 answers
115 views
I've hit a dilemma that I hope has an obvious answer that I've overlooked.

I am creating a radgrid completely in the code-behind (page_init) and adding it to a place-holding panel in my page.  Since I want to do advance databinding and will need to handle the NeedDataSource event, I expected to then create a handler for it in the code-behind as well.

Since the control isn't in the .aspx page, there is no object reference for it during the design-time programming of the code-behind and I get compilation errors for a function that says it is handling an event for a control that doesn't yet exist.

Is there a way around or through this problem?

Mike
Nikolay Rusev
Telerik team
 answered on 16 Feb 2011
15 answers
952 views
I have a complex rule that requires getting a value in edit mode. depending on the on the value that was retrieved, set a value in another cell that is in editmode.  And, set a value in another cell on a previous row (if it exists).

 All this needs to be done by clicking a button other than the Update Button. (assuming I will be using the event RadGrid1_ItemCommad)

grid is AutoGenerateColumns="False"  EditMode="EditForms"

IS IT POSSIBLE?

Thanks

Veli
Telerik team
 answered on 16 Feb 2011
4 answers
172 views
Hello,

I've got a radgrid with a GridTemplateColumn that has a Label that I set to display my data within the column.  I do this because the object that I'm binding to contains a list of objects.  Using a GridTemplateColumn allows me to display these 1 to many values the way I want to display them.

Now, filtering does not seem to work correctly with this setup.

I've searched the forum and found that you can set the DataField property on the GridTemplateColumn and the filtering will use that field.

Unfortunately, I'm not able to set the DataField property because I want to search within a list of objects.

If I place the name of the List, in this case ICodes, in the DataField property, and then perform a filter, I receive an error.

What is the best way to handle my scenario?

I want to allow the user to type a string within the filter box and use that string to filter within a list.  Is this possible?  Is there an event I can handle to do this work on my own?

Thanks!

Coy
Veli
Telerik team
 answered on 16 Feb 2011
3 answers
338 views
Hi all,
 I'm using RadGrid in Edit mode, with some GridDropDownColumns with the default GridDropDownListColumnEditor. I can even setup the client side event handler for the SelectedIndexChanged event. There I use a javascript alert() to see the contents of the combo.

The challenge is now to transfer this value to another Combobox a) in the same row or b) in another row.

How can i set the Combobox from the client side javascript?
Princy
Top achievements
Rank 2
 answered on 16 Feb 2011
1 answer
185 views
Hello,

I have a basic Grid composed with one GridDropDownColumn.

The grid is filled through ObjectdataSource1 :
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
           OldValuesParameterFormatString="original_{0}" OnSelecting="ObjectDataSource1_Selecting"
           SelectMethod="select_AllWeek" TypeName="Planning.WeekDAL" 
           DataObjectTypeName="Planning.Week" UpdateMethod="update_Week">
           <SelectParameters>
               <asp:Parameter Name="IdFrame" Type="Int32" />
           </SelectParameters>
       </asp:ObjectDataSource>

The SelectMethod returns a generic List of Week:
[DataObjectMethod(DataObjectMethodType.Select)]
       public static List<Week> select_AllWeek(int IdFrame)
       {...}


The DropDownColum is filled through ObjectDataSource2:
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
           SelectMethod="select_Alldays" TypeName="Planning.DayDAL"></asp:ObjectDataSource>

The SelectMethod returns a generic List of Day:
[DataObjectMethod(DataObjectMethodType.Select)]
        public static List<Day> select_AllDays()
        {
....}


The Grid is configured like that:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource1">
            <MasterTableView DataSourceID="ObjectDataSource1" EditMode="InPlace">
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" Groupable="False"
                        HeaderText="Week" UniqueName="Week" DataField="Libelle">
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn DataSourceID="ObjectDataSource2" ListTextField="Code"
                        ListValueField="Id" DataField="Monday.Id" UniqueName="Monday" HeaderText="Monday"
                        FooterStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" AllowFiltering="False"
                        AllowSorting="False" Groupable="False">
                    </telerik:GridDropDownColumn>
                     <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" Groupable="False"
                        HeaderText="Tuesday" UniqueName="Tuesday" DataField="Tuesday.Code">
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn>
                    </telerik:GridEditCommandColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>

The Week class is defined like that :
public class Week: IEnumerable
    {
  
        #region Fields
  
        protected List<Day> Days= new List<Day>();
  
        private int _id;
   ...

# region properties

     public Day Monday
        {
            get{return Days[0];}
            set{Days[0] = value;}
        }


and the Day class :

public class Day
    {
        #region Fields
  
        private int _id;
        private string _code;
       ...
#endregion
  
  
        #region Properties
  
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }
  
        public string Code
        {
            get {return _code;}
            set  { _code = value;}
        }
...
]


The values are correctly displayed in both Grid and DropdownList. The problem is during the update phase.  

The Update method of the ObjectDataSource1 is defined like that:

[DataObjectMethod(DataObjectMethodType.Update)]
        public static void update_Week(Week oneweek)
        {
            PrepareConnexion();
            connexion.Open();
            ...


The selected value of the Dropdownlist  ("Code" property of the Day object) is not saved in the database. It seems there is "no link" between RadGrid and Dropdowlist controls. What is the best practise to link a GridDropDownColumn Value in a  RadGridView Using ObjectDataSource (one for Dropdownlist and one for Gridview) ?

Thanks for your support.

Regards,

Stephane


































































Veli
Telerik team
 answered on 16 Feb 2011
1 answer
55 views
Hi,
I am developing a scheduler system taking Telerik Rad Scheduler as base. I am customizing it maximum as per my choice and design.If I want to deploy it in my commercial website, can I do it?
Veronica
Telerik team
 answered on 16 Feb 2011
5 answers
70 views
Hi. I'm trying to use the RadTagCloud. I am trying to build the content iteratively with code behind (upon certain events items will get added to the cloud).

In code behind I have:
                var nodes = from n in dContext.table where select n;
                foreach (var j in nodes)
                {
                    RadTagCloudItem item = new RadTagCloudItem()
                    {
                        Text = j.Description,
                        DataItem = j.CtId
                    };
                    myCloud.Items.Add(item);
                }

This works fine. If I watch the cloud in debug mode I items.count increases and I can view individual RadTagCloudItems and they contain text and dataItems.

However, I also have a method for the itemClick event:
    protected void myCloud_ItemClick(object sender, RadTagCloudEventArgs e)
    {
        doSomething(Convert.ToInt16( e.Item.DataItem));
    }

When this executes the e.item.DataItem is null and if I view myCloud the dataitem for every item in the items collection is null. WHY?
Pero
Telerik team
 answered on 16 Feb 2011
1 answer
99 views
Hello,

I have a page that inherits from compositecontrol and i am trying to load the filter the first time the page loads but i'm getting the following exception:

PS - i am able to load the filter on postback..

Object reference not set to an instance of an object. 
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.NullReferenceException: Object reference not set to an instance of an object.
  
Source Error: 
  
  
Line 537:                {
Line 538:                    ((IStateManager)myRadFilter.RootGroup).LoadViewState(DoFilterSerialize(new BL.GPSearchFilterBL(RequestParam.RequestParamIntValue("SID")).SearchFilter));
Line 539:                    myRadFilter.RecreateControl();
Line 540:
Line 541:                    myRadFilter.FireApplyCommand();
   
  
Source File: C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web.Map.TG\UI\WebControls\ResultsControl\ResultsControl.cs    Line: 539 
  
Stack Trace: 
  
  
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadFilterDataFieldEditor.CreateEditorFrom(RadFilterDataFieldEditor baseEditor) +9
   Telerik.Web.UI.RadFilterDataFieldEditorCollection.RetrieveEditorForFieldName(String fieldName) +106
   Telerik.Web.UI.RadFilterSingleExpressionItem.SetupFunctionInterface(Control container) +55
   Telerik.Web.UI.RadFilterExpressionItem.CreateFunctionalInterface() +72
   Telerik.Web.UI.RadFilter.CreateFilterItems() +286
   Telerik.Web.UI.RadFilter.CreateControlHierarchy() +13
   Telerik.Web.UI.RadFilter.CreateChildControls() +87
   System.Web.UI.Control.EnsureChildControls() +87
   Telerik.Web.UI.RadFilter.get_RootGroupItem() +21
   Telerik.Web.UI.RadFilter.RecreateControl() +12
   AmbiSIG.GeoPortal.Web.Map.TG.UI.WebControls.ResultsControl.ResultsControl.DoOnLoad(EventArgs e) in C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web.Map.TG\UI\WebControls\ResultsControl\ResultsControl.cs:539
   AmbiSIG.GeoPortal.Web.UI.BaseCompositeControl.OnLoad(EventArgs e) in C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web\UI\BaseCompositeControl.cs:109
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  
  
Martin
Telerik team
 answered on 16 Feb 2011
1 answer
174 views
I have button which launch ajax request. That button manage a panel.
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="button_launcher">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="panel" />
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>
I can change size of panel in server-side. But sometimes I need manage other elements which unavailable in server-side. So I want to calculate values and pass it to client-side and then make changes which I need to do. After long searching I did not find how to do that. Now I do it in ugly way - I write this parameters on hidden labels and then parse it in OnResponseEnd function. Can I avoid it somehow?
Iana Tsolova
Telerik team
 answered on 16 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?