Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
583 views

I built a grid that has a hyperlink column and also a context menu associated to it. The hyperlink column was added to the grid in codebehind when the grid was built ( needed to built the grid in code behind to control what columns would show dynamically). The column was added fine but I had to manually create the hyperlink that would be placed on the grid so I can add attributes to it. I set the "onmouseover" attribute for example.

The problem is that I can open the context menu associated to the grid from anywhere on a row except on the hyperlink column Text. Anywhere around the text withing the column works fine too. Is there an attribute that I have to set? Or is there a certain way I have to build the hyperlink column? Or is the context menu even able to load from a right click on a hyperlink?

Any advise or assitance would be very appreciated.

Thanks in advance.
Rosen
Telerik team
 answered on 29 Sep 2008
1 answer
175 views
Hi Guys

I have been working on a dynamic docking environment over the last few weeks and I made some very good progress loading dynamic zone layouts and adding docks to them with widgets, now at the moment i am a bit stuck regarding the drag and drop function , becuase everytime i drop a dock into the first index(top) of another zone it jumps back to its original position but when i drop it at the bottom of another zone it work perfectly and adds the dock to the zone correctly

First i set the layout (framework of the page) I declared a array of DockZones (5) then i initilise them in a for loop , load all the widget docks then add them to the page.
private void SetLayout(string layouts)  
    {  
        for (int i = 0; i < zone.Length; i++)  
        {  
            zone[i] = LoadZone(pageID, langID, i);  
            zone[i].Skin = "Default";  
            zone[i].ID = "ZoneLayout" + i;  
 
        }  
        Table tt = WebCMSTemplate.WidgetHelpers.WidgetHelper.GetLayout1(zone[0], zone[1], zone[2], zone[3], zone[4]);  
        siteLayout.Controls.Add(tt);  
        tt.ID = "bodyLayoutCC";  
 
    } 

The logic that loads each zone is the LoadZone method described here, it pulls the pageID, langID and the zone number that will call the Linq statement in the database to populate it from the CMSWidgets Table. AdminEnabled is just a boolean variable that defines if it is editable or not
public RadDockZone LoadZone(string pagename, string language, int zoneid)  
    {  
        RadDockZone zone = new RadDockZone();  
          
        if (!adminEnabled)  
        {  
            zone.MinHeight = Unit.Pixel(1);  
            zone.MinWidth = Unit.Pixel(1);  
        }  
        
        CMSLayerDataContext db = new CMSLayerDataContext();  
 
        var cmsWidgets = from p in db.CMSWidgets  
                         where p.pageName.Equals(pagename) && p.language.Equals(language) && p.zoneNo.Equals(zoneid)  
                         orderby p.sequence descending  
                         select p;  
 
        foreach (CMSWidget cmswidget in cmsWidgets)  
        {  
            Control cn = LoadControl(cmswidget.controlascx);  
            cn.ID = cmswidget.widget.ToString();  
            zone.Controls.Add(CreateDockWidget(cn, cmswidget.title, true, cmswidget.widget, cmswidget.height, cmswidget.width, cmswidget.nonadminStyle));  
        }  
 
        return zone;  
    } 

The Create DockWidget is the method that createds the RadDock and adds the appropriate control to it
public RadDock CreateDockWidget(Control cont, string title, bool showTitleBar, Guid widgetId, int? height, int? width, string nonadminHandle)  
    {  
        RadDock dock = new RadDock();  
          
        dock.Title = "Dock";  
        dock.Text = string.Format("Added at {0}", DateTime.Now);  
        dock.Width = Unit.Pixel(300);  
        dock.Skin = "Default";  
        dock.UniqueName = widgetId.ToString();  
        dock.ID = "dock(" + widgetId.ToString() + ")";  
 
        dock.Commands.Add(new DockExpandCollapseCommand());  
 
          
        //dock.Title = title;  
        dock.Title = dock.ID;  
        if (height.HasValue)  
        {  
            dock.Height = Unit.Pixel(int.Parse(height.ToString()));  
        }  
        if(width.HasValue)  
        {  
            dock.Width = Unit.Pixel(int.Parse(width.ToString()));  
        }  
        dock.ContentContainer.Controls.Add(cont);  
        dock.DockMode = DockMode.Docked;  
        if (adminEnabled)          
        {  
            dock.Commands.Add(new DockCloseCommand());  
            dock.DockHandle = DockHandle.TitleBar;  
            dock.AutoPostBack = true;  
        }  
        else 
        {  
            if (nonadminHandle != null)  
            {  
                if (nonadminHandle.Equals("Title"))  
                {  
                    dock.DockHandle = DockHandle.TitleBar;  
                }  
                else if (nonadminHandle.Equals("Grip"))  
                {  
                    dock.DockHandle = DockHandle.Grip;  
                }  
                else 
                {  
                    dock.DockHandle = DockHandle.None;  
                }  
            }  
            else 
            {  
                dock.DockHandle = DockHandle.None;  
            }  
            dock.EnableDrag = false;              
        }  
 
        dock.DockPositionChanged += new DockPositionChangedEventHandler(dock_DockPositionChanged);  
        return dock;  
    } 
As you can see I have registered my DockPositionChanged EventHander correctly and it makes the call to this method:

protected void dock_DockPositionChanged(object sender, DockPositionChangedEventArgs e)  
    {  
        RadDock dd = (RadDock)sender;        
          
        string guid = dd.ID.Substring(5, dd.ID.Length -(6));  
          
        WebCMSTemplate.WidgetHelpers.WidgetHelper.ChangeWidgetZone(guid, int.Parse(e.DockZoneID.Replace("ZoneLayout","")), e.Index);  
        Response.Redirect(Request.Url.ToString());  
    } 
if gets the guid string from the dock ID to properly reference to correct widget id

And lastly the ChangeWidgetZone property gets called to change teh zone and index  in the database before the page gets redirected to itself(to reload everything from top)
public static void ChangeWidgetZone(string widgetid, int zone, int index)  
        {  
            CMSLayerDataContext db = new CMSLayerDataContext();  
 
            CMSWidget widget = db.CMSWidgets.First(p => p.widget.Equals(widgetid));  
            widget.zoneNo = zone;  
            widget.sequence = index;  
 
            db.SubmitChanges();  
        } 

Now all this runs fine and works as expected except in the drag drop case where I dont drop the dragged widget to the last entry in the relevant zone

I used LINQ to code the database logic.

Any help will be welcome thanx
Stuart
Top achievements
Rank 1
 answered on 29 Sep 2008
3 answers
125 views
Dear All,

When I enable scrolling, it is including too much unwanted space between the rows and the status bar / pager.

Can any one tell me why this happens and how to rectify it?

Thanks a lot in advance.

Shinu
Top achievements
Rank 2
 answered on 29 Sep 2008
3 answers
123 views
I am using the RadScheduler with the Office2007 skin ie I just have the attribute set 

Skin

="Office2007"

I am encountering some problems with it. The day navigation buttons (top left of grid) mouse over property does not seem to behave correctly. I have to very very carefully position the mouse at the top of the arrows to get it to change the day when on the demos the click is a simple one right on the arrow itself. Also the popup calendar has lost it's styling.

As that last sentence suggests I guess this is a styling issue. Am I missing an include and a stylesheet/

Thanks

Gary
Alex Gyoshev
Telerik team
 answered on 29 Sep 2008
2 answers
68 views

Hello
i can set DIR property for masterview

but i have a colummn that dir property of this column is deferent wiht Other
column

can i set dir for a GridBoundcolumn is a rad grid

Thanks
Davari

Javad Davari
Top achievements
Rank 1
 answered on 29 Sep 2008
2 answers
139 views
Hi,

Is it possible to include a RadRotator inside a RadToolTipManager ?

I tryed the following code :

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:bdConnectionString3 %>"
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:bdConnectionString3 %>" 
        SelectCommand="select * from MODELES WHERE id_table=@id_table "
        <SelectParameters> 
            <asp:Parameter Name="id_table" Type="Int32" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
 
    <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Position="MiddleRight" 
        OnAjaxUpdate="OnAjaxUpdate" Skin="Web20" ManualClose="true" 
        Height="220px" Width="220px" Animation="Fade" /> 
 
    <asp:Repeater runat="server" ID="Repeater1" DataSourceID="SqlDataSource1" OnItemDataBound="repeater1_ItemDataBound"
        <ItemTemplate> 
            <asp:Image runat="server" ID="ImageBox" ImageUrl='<%# Eval("id_modele", ".../s/{0}_0.jpg") %>' 
                Style="border: solid 1px #ffc6e3;" /> 
        </ItemTemplate> 
    </asp:Repeater> 
     
    <telerik:RadRotator ID="RadRotator1" DataSourceID="SqlDataSource2" runat="server" Width="328px" Height="120px" 
        ScrollDuration="500" FrameDuration="2000" ItemHeight="118" ItemWidth="108" DataSourceID="SqlDataSource2"
        <ItemTemplate> 
            some images  
        </ItemTemplate> 
    </telerik:RadRotator> 

Code behind :

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        SqlDataSource1.SelectCommand = "select * from MODELES where annee='2009' and id_cl = '" & Request.QueryString("id_cl") & "'" 
 
    End Sub 
    Protected Sub repeater1_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) 
        If e.Item.ItemType = ListItemType.AlternatingItem OrElse e.Item.ItemType = ListItemType.Item Then 
            Dim ctrl As Control = DirectCast(e.Item.FindControl("ImageBox"), Control) 
            Dim rowView As DataRowView = DirectCast(e.Item.DataItem, DataRowView) 
            If Not [Object].Equals(ctrl, Nothing) Then 
                ctrl.ID = rowView.Row("id_table").ToString() 
                Dim clientID As String = ctrl.ClientID 
                Me.RadToolTipManager1.TargetControls.Add(clientID, rowView.Row("id_table").ToString(), True) 
            End If 
        End If 
    End Sub 
    Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs) 
        args.UpdatePanel.ContentTemplateContainer.Controls.Add(Me.RadRotator1) 
        SqlDataSource2.SelectParameters("id_table").DefaultValue = args.Value 
        'Me.RadRotator1.DataBind() 
    End Sub 

So the aim is to have a tooltip on all the repeaters images. Each tooltip must contain 'RadRotator1' (RadRototar1 content depending of the selected image).

I tryed to put a formiew as I saw in one of your tutorial (instead of the Radrotator) and it works. However if I use a RadRotator, the tooltip remains blank on ajax loading.

Could you help ?
Thank you
Regards
AB





Georgi Tunev
Telerik team
 answered on 29 Sep 2008
2 answers
83 views
i am using rad window my web application....

how to i close this window....

when i press close button tht window will be close..

how to i write java script for this one

Rajani
Top achievements
Rank 1
 answered on 29 Sep 2008
1 answer
97 views
this example http://www.telerik.com/help/aspnet-ajax/tab_multipage_dynamic.html

is great but can i have a copy of the project with all headers and footer and controls to help me finish a project please?
Paul
Telerik team
 answered on 29 Sep 2008
1 answer
171 views
I'am using Telerik web RadGrid.The Column names are BranchID, Name, Code.
 These are getting set in the RadGrid then what i would like to know is how to set double Click on a cell and then open popup page to display Branch Data with that BranchID details.
Princy
Top achievements
Rank 2
 answered on 29 Sep 2008
2 answers
100 views
Hi,
I'm having some issues with a tab's value being lost after an AJAX postback. I can disable AJAX and it works as expected.

I'm setting the tab's value on creation of page. It works fine if I don't do an AJAX call the save the page to DB.The tabs are added at design time and the value assigned at runtime.

Once the AJAX is called, the value is lost in the tabs. I'm not updating tabstrip or calling anything that is affected the tab's value after post.

Any thoughts?

Using Q2 2008 SP1.
AK
Top achievements
Rank 1
 answered on 29 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?