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

I'm trying to disable the menu items if the user is not in certain role's i don't know why the ItemDataBound is not firing.
Please see the code below.
## ASPX file........
  <telerik:RadMenu ID="RadMenu1" Text="MenuOne" runat="server" AccessKey="P" DataNavigateUrlField="Url" EnableShadows="true" Skin="default" EnableEmbeddedSkins="False" CssClass="dropDown" OnItemDataBound="RadMenu1_ItemDataBound" OnItemClick="RadMenu1_ItemClick" ></telerik:RadMenu>

## CS file..............
 protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string xmlFileName = "~/xml/MainMenu.xml";
                RadMenu1.LoadContentFile(xmlFileName);
            }               
        }

        protected void RadMenu1_ItemDataBound(object sender, Telerik.Web.UI.RadMenuEventArgs e)
        {
            if (!Roles.IsUserInRole("Admin"))
            {
                XmlElement element = (XmlElement)e.Item.DataItem;
                if (element.Attributes["text"].Value == "Contact History")
                    e.Item.Enabled = false;
            }          
        }     
        protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
        {   
            Response.Redirect(e.Item.Attributes["Url"].ToString());
        }  
Yana
Telerik team
 answered on 25 Nov 2010
1 answer
83 views
Hi,

I have been facing a issue with Radpopup window is...,if i open the radpopup 1st time, then page load of radpoup is executing but when open radpopup 2nd time, then page load of radpoup is not executing. please let us know the best solution to achieve this.

Thanks.
Shinu
Top achievements
Rank 2
 answered on 25 Nov 2010
5 answers
170 views
Hi

I have a grid with the default Edit format in-Grid.   This works fine but what I actually want
is a similar detail view that is not editable, and does not show an 'Update' link. ie choices are only
'view detail' or 'Delete' 

I could make all the items read-only in Edit mode, but how to I get read of the 'Update' link?

Am I going about this the wrong way?

Thanks for help!

Clive

Q2 2010/asp.net 4.0
Princy
Top achievements
Rank 2
 answered on 25 Nov 2010
1 answer
134 views
Hi,

I have a three tier datagrid Hierarchy which basically consists of a Radgrid, in the Radgrid i have specified a master table and a detail table.  Within the detail table i have also specified a nested view template which holds another radgrid.  The set up works fine as everything expands as it should.

However, while selecting an item in the 3rd level of the hierarchy i would like to obtain a reference to the item expanded in the first level.
at present i am trying to perform this operation like so 

e.Item.OwnerTableView.ParentItem.GetDataKeyValue("EnquiryNo");
 The event isn't important, but e is of type GridSortCommandEventArgs.

The problem with this is that ParentItem is null.

This technique has worked in the same project when trying to get a handle from the detail table to the master table which leaves me to believe that a relationship must be set up between the nested view template and the detail table.

Any help will be greatly appreciated thank you
Princy
Top achievements
Rank 2
 answered on 25 Nov 2010
1 answer
198 views
I have a table with too many columns to display in the grid.

I want to display selected columns in the grid and be able to show all columns for a particular row upon clicking a button on something like that.
More like a add/edit FormTemplate where I can customize the template.

Any help would be appreciated.

Thanks
Shinu
Top achievements
Rank 2
 answered on 25 Nov 2010
1 answer
72 views
How can I set the visible page of a rad grid in the code behind of an aspx page?

Supposing I have a grid with 100 pages, and a user is on the 50th page of data and clicks on a link in one of the rows which redirects them to another page. When they click the "Back" button, they are taken to the first page of the grid and have to navigate back to the 50th page.

Can anyone tell me if this is possible without setting up routes?
Shinu
Top achievements
Rank 2
 answered on 25 Nov 2010
2 answers
154 views
Hi,
  I have a problem regarding the retrieving latest 10 images into rad rotator from folder by using the image name stored in sql server.
For this i placed the asp:image tag in item template of radrotator and assigned imageurl to handler.ascx file. but i'm not sure about passing "id" from image url to handler.ascx file.
here, in handler.ascx file i retrieved the image name's from sql server db.
Help me from this problem...
saratchand
Top achievements
Rank 2
 answered on 25 Nov 2010
1 answer
57 views
I am using radscheduler with Modal advanced form for one of our clients.  Below are some f the questions i have.

1. Referring to below link.

http://www.telerik.com/community/forums/aspnet-ajax/scheduler/how-to-open-a-new-appointment-using-code-behind.aspx

the script at the path does not work when radscheduler is inside radsplitter.

2. UNDO, CLEAR, SAVE and New buttons

I have these 3 buttons on my advanced edit for on both insert as well as edit mode. Please see below to know how i need them  to work.

i) UNDO : When in insert form clicking on this button should take the advanced form back to as it was when loaded. I used the binding container method to rebind the container in advanced form button click as.

SchedulerFormContainer container = (SchedulerFormContainer)BindingContainer;
            Appointment Apt1 = new Appointment();
            Apt1.Start = Start;
            Apt1.End = End;
            container.Appointment = Apt1;

            container.DataBind();

However this does not reset the values in posted controls.

ii) SAVE and ADD:

This is something for which i was trying the script in step1, but didnt quite make it work. i successfully saved the data and closed advanced form using this button. I can even write teh code to understand the control causing postback however dont understand where and how do i need to put the script to open window for creating new appointment so that i can use ShowAdvancedInsertForm() method. Tried everything for this. Same works if i put the button and call it on button click. Please suggest what to do in this case.

iii) CLEAR button:

Similar to UNDO button in thsi also i need to clear the values and use teh same thing as mentioned above, but the problem with posted controls still exist.

Please try and help me on these items as soon as possible as these are being show stoppers in our upload lined up in coming 2 days.

Many thanks in advance.

Waiting for your response.

Regards,
Sachin

sachin
Top achievements
Rank 1
 answered on 25 Nov 2010
2 answers
32 views
hi,
In the past, we can set the tool button's attribute like this:
WebControl btn= this.Editor1.ToolControls["InsertImage"].Control as WebControl;
btn.Attributes["onclick"] = "alert('hellow telerik');";

But now it seem that we cannot make it like that ! 
this is the client-side way:
<script type="text/javascript">  
var imageManagerCommand = RadEditorCommandList["ImageManager"];  
RadEditorCommandList["ImageManager"] = function(commandName, editor, oTool)   
{   
    imageManagerCommand (commandName, editor, callBackFn);   
      
    function callBackFn(result)   
    {   
        if (result && result.imagePath)   
        {   
           
 
           
        };   
    }   
}  
</script> 

WebControl ctrl = this.Editor1.ToolControls["InsertImage"].Control as WebControl;
            ctrl.Attributes["onclick"] = "alert('damnd');";
WebControl ctrl = this.Editor1.ToolControls["InsertImage"].Control as WebControl;
            ctrl.Attributes["onclick"] = "alert('damnd');";
WebControl ctrl = this.Editor1.ToolControls["InsertImage"].Control as WebControl;
            ctrl.Attributes["onclick"] = "alert('damnd');";
WebControl ctrl = this.Editor1.ToolControls["InsertImage"].Control as WebControl;
            ctrl.Attributes["onclick"] = "alert('damnd');";
 WebControl ctrl = this.Editor1.ToolControls["InsertImage"].Control as WebControl;
            ctrl.Attributes["onclick"] = "alert('damnd');"
Is there a way to do it in C# code?

Thanks for your reply!

Regards
alloovee
Top achievements
Rank 1
 answered on 25 Nov 2010
5 answers
109 views
Hi,

I am manually loading custom user controls, same one few times. the user control has raddatepicker. the page contains few tabs and is set on lazy loading. the first time these controls load it shows the calender image. if clicked on any other tab, the image disappears and open popup calender text appears. even clicking on the link doesnt work. what is the work around for this.

Thanks
Vin
Vineet
Top achievements
Rank 1
 answered on 25 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?