Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
175 views
Hi,

I have a emf image, on which I want to create certain hot spots such that when the mouse is clicked on one of the hot spot the context menu shows up

Kindly let me know what type of control can I use for this purpose to set as the target for the Context menu

e.g.
 <telerik:ContextMenuControlTarget ControlID = "Hotspot1" />

I cant use ImageMaps as the individual maps dont carry an ID
(problem setting it as a targer)

When I use an empty div, the context menu only shows up when clicked on the border and on the text in the div, I want the div to be empty such that the image behind can be seen at all times, I dont want to fill in the Div with spaces as the image will be scaled, same problem with Panels

Any help is appreciated, thanks in advance
Regards
KaranHi,

I have a emf image, on which I want to create certain hot spots such that when the mouse is clicked on one of the hot spot the context menu shows up

Kindly let me know what type of control can I use for this purpose to set as the target for the Context menu

e.g.
 <telerik:ContextMenuControlTarget ControlID = "Hotspot1" />

I cant use ImageMaps as the individual maps dont carry an ID
(problem setting it as a targer)

When I use an empty div, the context menu only shows up when clicked on the border and on the text in the div, I want the div to be empty such that the image behind can be seen at all times, I dont want to fill in the Div with spaces as the image will be scaled, same problem with Panels

Any help is appreciated, thanks in advance
Regards
Karan

Karan
Top achievements
Rank 1
 answered on 06 Feb 2008
4 answers
260 views

I am using the following GridMaskedColumn in my grid. It works great if I want to store my phone numbers in the DB with the special characters but I don't. So I'm stripping the extra characters of the mask off before inserting so a phone is stored as 9999999999 rather than (999) 999-9999.

My first question is why does this write the mask to the database in the first place? A mask is a mask - it should write what's IN the mask and not the mask itself.

Second question - How can I get DataFormatString to work when this column is displayed. Currently my phones are displayed literally as (###) ###-####" . The DataFormatString is not working.

<
telerik:GridMaskedColumn Mask="(###) ###-####"
UniqueName="Phone"
HeaderText="Phone"
DataField="Phone"
CurrentFilterFunction="EqualTo"
DataFormatString="(###) ###-####"
FilterListOptions="VaryByDataType"
ForceExtractValue="None">
<ItemStyle Width="100px" />
</telerik:GridMaskedColumn>

Nicolo
Top achievements
Rank 1
 answered on 05 Feb 2008
5 answers
443 views

I am using the RadWindowManager in my application to show a form for editing purposes when the uses selects a row from a RadGrid.  When the user closes the edit form and returns to the main form (where the grid is located) I automatically refresh the grid by hooking a javascript function to the close event of the edit form, as shown in the last line of the following function:

function
OpenEditForm(sender, eventArgs)
{
    var MasterTableView = eventArgs.get_tableView(); 
    var cell = MasterTableView.getCellByColumnUniqueName
        (MasterTableView.get_dataItems()[eventArgs.get_itemIndexHierarchical
        ()],
"BrokerID"); 
    var oWnd = radopen("./BrokerMaint.aspx?ID=" + cell.innerHTML, "rwBrokerMaint");
    oWnd.add_close(CloseEditForm);
}

Once the user returns back to the main form she can click a button the form that will force a refresh of the grid.  The problem is that the refresh that is already occurring automatically may not have yet finished before she selects to refresh again.  If this happens, I get an error: "Microsoft JScript runtime error: 'null' is null or not an object"

How do I prevent the RefreshGrid function from executing if a refresh is already taking place?  Or, how do I stack one refresh event to occur after another one finishes?

The functions in my code are shown below:

<telerik:RadCodeBlock ID="cb1" runat="server">
<script language="javascript" type="text/javascript">
function CloseEditForm(sender, eventArgs)
{
    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
    ajaxManager.AjaxRequestWithTarget(
'<%= RadGrid1.UniqueID %>',"RefreshData");
}

function RefreshGrid()
{
    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
    ajaxManager.AjaxRequestWithTarget(
'<%= RadGrid1.UniqueID %>',"RefreshGrid");
}
</script>
</
telerik:RadCodeBlock>

Thank You,

David Nowak

Matthew
Top achievements
Rank 1
 answered on 05 Feb 2008
1 answer
122 views
Hi,

Are there any known issues with the getColumnUniqueNameByCellIndex method? If I use the example in the documentation :  

var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();  
var contactName = masterTable.getColumnUniqueNameByCellIndex(
                    masterTable.get_dataItems()[0], 2); 

I get the error message " 'cells.length' is null or not an object ".  I'm using the latest build of Prometheus (RadControls_Prometheus_2007_3_1314).

Thanks
Ves
Telerik team
 answered on 05 Feb 2008
3 answers
267 views
I am getting an error when I try to bind the radgrid promethius. I had this working in the asp.net radgrid version, but decided to upgrade to the most current version of promethius. Thanks

Error: Destination array is not long enough to copy all the items in the collection. Check array index and length. 

<%

@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"

CodeFile="ClassPickNew.aspx.vb" Inherits="ClassPickNew" EnableViewStateMac="false"

EnableEventValidation="false" MaintainScrollPositionOnPostback="true" %>

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%

@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

Namespace="System.Web.UI" TagPrefix="asp" %>

<

asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<

telerik:RadGrid ID="rgMain" Skin="Outlook2007" runat="server" AllowPaging="False"

AllowSorting="True" AllowMultiRowSelection="false" AutoGenerateColumns="False"

OnItemCommand="rgMain_ItemCommand" HorizontalAlign="NotSet" AllowAutomaticDeletes="False"

AllowAutomaticInserts="False" AllowAutomaticUpdates="false" Width="100%" AllowFilteringByColumn="false"

ShowGroupPanel="False">

<ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" ApplyStylesOnClient="True">

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="1"

ScrollHeight="300px"></Scrolling>

<Resizing AllowRowResize="True" ClipCellContentOnResize="False" AllowColumnResize="True">

</Resizing>

</ClientSettings>

<MasterTableView DataKeyNames="ClassID" GridLines="None" AllowMultiColumnSorting="True"

AutoGenerateColumns="False" HorizontalAlign="NotSet" CommandItemDisplay="Top">

<GroupByExpressions>

<telerik:GridGroupByExpression>

<SelectFields>

<telerik:GridGroupByField FieldAlias="ClassDate" FieldName="ClassDate" FormatString="{0:D}"

HeaderText="Classes Offered"></telerik:GridGroupByField>

<telerik:GridGroupByField FieldAlias="StartTime" FieldName="StartTime" FormatString="{0:hh:mm tt}"

HeaderText=" "></telerik:GridGroupByField>

</SelectFields>

<GroupByFields>

<telerik:GridGroupByField FieldName="ClassDate" SortOrder="Ascending"></telerik:GridGroupByField>

<telerik:GridGroupByField FieldName="StartTime" SortOrder="Ascending"></telerik:GridGroupByField>

</GroupByFields>

</telerik:GridGroupByExpression>

</GroupByExpressions>

<Columns>

<telerik:GridBoundColumn HeaderText="ClassSchedulingID" DataField="ClassSchedulingID"

SortExpression="ClassSchedulingID" UniqueName="ClassSchedulingID" Display="False"

ReadOnly="True">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="SlotCode" SortExpression="SlotCode" HeaderText="SlotCode"

DataField="SlotCode" Display="False" ReadOnly="True">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="ClassTitleFull" SortExpression="ClassTitleFull"

HeaderText="Class" DataField="ClassTitleFull">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="ClassDate" SortExpression="ClassDate" HeaderText="ClassDate"

DataField="ClassDate" DataFormatString="{0:M/dd}">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="StartTime" SortExpression="StartTime" HeaderText="StartTime"

DataField="StartTime" DataFormatString="{0:hh:mm tt}">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="HandsOn" HeaderText="HandsOn" SortExpression="HandsOn"

UniqueName="HandsOn">

</telerik:GridBoundColumn>

<telerik:GridTemplateColumn UniqueName="Segment" HeaderText="Segment">

<ItemTemplate>

<%

--<asp:Label ID="lblSegment" runat="server"></asp:Label>--%>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridBoundColumn UniqueName="ClassFull" SortExpression="ClassFull" HeaderText="ClassFull"

DataField="ClassFull">

</telerik:GridBoundColumn>

<telerik:GridButtonColumn CommandName="Details" Text="Details" UniqueName="Details">

</telerik:GridButtonColumn>

<telerik:GridButtonColumn UniqueName="Select" Text="Select" CommandName="Select">

</telerik:GridButtonColumn>

</Columns>

<ExpandCollapseColumn ButtonType="ImageButton" Visible="true" UniqueName="ExpandColumn">

<HeaderStyle Width="19px"></HeaderStyle>

</ExpandCollapseColumn>

<RowIndicatorColumn ItemStyle-Width="0px" HeaderStyle-Width="0px" />

<CommandItemTemplate>

</CommandItemTemplate>

</MasterTableView>

</telerik:RadGrid>

</

asp:Content>

----------------------------------------------------

Imports

System.Data.SqlClient

Imports

System.Data

Imports

Telerik.Web.UI


Sub

BindAvailableClasses()

Dim strConnection As String = ConfigurationManager.ConnectionStrings("MCHPEvents").ConnectionString

Dim cnMain As New SqlConnection(strConnection)

Try

Dim cmdMain As New SqlCommand("pr_Event_ListClassSchedulingInfo", cnMain)

cmdMain.CommandType = CommandType.StoredProcedure

cmdMain.Parameters.Clear()

cmdMain.Parameters.Add(

New SqlParameter("@EventTypeID", SqlDbType.Int))

cmdMain.Parameters(

"@EventTypeID").Value = oUser.EventID

'cmdMain.Parameters.Add(New SqlParameter("@SlotCode", SqlDbType.Int))

'cmdMain.Parameters("@SlotCode").Value = SlotCode

cmdMain.Parameters.Add(

New SqlParameter("@ReturnOnePerClassGroup", SqlDbType.Bit))

cmdMain.Parameters(

"@ReturnOnePerClassGroup").Value = 0

cmdMain.Parameters.Add(

New SqlParameter("@EventPart", SqlDbType.Int))

cmdMain.Parameters(

"@EventPart").Value = Convert.ToInt16(ConfigurationManager.AppSettings("MastersEventPart"))

Dim daMain As New SqlDataAdapter(cmdMain)

Dim dsMain As New DataSet

daMain.Fill(dsMain,

"Main")

rgMain.DataSource = dsMain.Tables(

"Main")

rgMain.DataMember =

"Main"

rgMain.DataBind()

Catch ex As SystemException

Finally

'Cleanup

If cnMain.State = ConnectionState.Open Then

cnMain.Close()

End If

cnMain.Dispose()

End Try

End Sub



Darren
Top achievements
Rank 1
 answered on 05 Feb 2008
2 answers
107 views
I put editor in user control then i brown page and edit text in editor when click "Bold" or other event its was error that "Microsoft JScript runtime error: 'Document.selection' is null or not an object"
this error in WebResource.axd (

RadEditorCommandList[RadEditorNamespace.RADCOMMAND_BOLD]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_ITALIC]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_UNDERLINE]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_JUSTIFY_LEFT]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_JUSTIFY_RIGHT]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_JUSTIFY_CENTER]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_JUSTIFY_NONE]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_INDENT]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_OUTDENT]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_SELECT_ALL]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_UNLINK]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_JUSTIFY_FULL]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_STRIKETHROUGH]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_SUBSCRIPT]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_SUPERSCRIPT]=RadEditorCommandList[RadEditorNamespace.RADCOMMAND_ABSOLUTE_POSITION]=function(_10,_11,_12){

var _13=RadEditorNamespace.RADCOMMAND_SELECT_ALL!=_10;

_11.SetActive();

if(_11.Document.selection) ---- this line was error.
{

var rng=_11.Document.selection.createRange();

rng.select();

}

_11.ExecuteBrowserCommand(_10,_13,null);

};)

help me please?

pum..

Rumen
Telerik team
 answered on 05 Feb 2008
3 answers
108 views
Is it possible for bottom pane to communicate with top pane's RadTabStrip to set selected tab? I am doing a page redirect in the bottom pane and when redirected I want to change the selected tab in the top pane.
Svetlina Anati
Telerik team
 answered on 05 Feb 2008
3 answers
85 views
I currently work for a company where nearly 60% of traffic is driven by natural search (i.e. people typing keywords into Google for instance). This is a significant amount of traffic in essence for free (i.e. no spend on adverts) and anything that could affect this really worries an SEO Teams Manager.
 
I recently evaluated the ASP.NET Prometheus suite and was really impressed with all the compliance you have managed to achieved (e.g. XHTML, WAI A) but I have not found anything that shows how the controls support SEO best practice. This particular area is becoming more and more important for companies especially those who have dedicated SEO Teams and the slight hint that something could adversely affect rankings can stop adoption of what is an excellent control set.

To give an example - I am referring to the amount of HTML markup that can be created which can increase the code to content ratio which from an SEO perspective can negatively affect rankings (although to what extent it is difficult to quantify, it is more there is a risk). In the prometheus suite there are controls which render tables for layout, although this is XHTML 1.1 compliant it is not semantically correct, tables should be used for tabular data. I know this is to achieve layout, but CSS should be used for Visual Presentation but there appears to be no way to override this in the current controls so it does not output table markup (e.g. RadTextBox)

I know for many internal company web applications and external sites SEO doesn't matter, but for customer facing sites where a significant amount of traffic is driven by natural search and the fact it is such a competitive space anyway to quote a supermarket 'every little helps ...'

I would be interested in hearing peoples opinions on this and from Telerik particularly - is this something they have/will be addressing in a future release of prometheus and is there any information available to allow me to calm my SEO Managers fears.


Dimo
Telerik team
 answered on 05 Feb 2008
1 answer
174 views
OK, I have followed Telerik's advice and put my RadAjaxManager in the masterpage template and then RadAjaxManagerProxies in the sub-forms (ie, templated pages). I'm yet to test, but I'm sure this will probably work fine for telerik's ajaxified controls, but what about calling my own ajax methods from the client-side?

The "old" way (ie, without proxy or masterpages) was to simply wire-up an OnAjaxRequest method and call it via javascript. However that is not a member of the RadAjaxProxy class so how do I achieve the same thing?

Cheers,
Daron
Iana Tsolova
Telerik team
 answered on 05 Feb 2008
5 answers
147 views
Hello everybody!

I'm using a RadTreeView control and implemented LoadonDemand. Whenever a node gets expanded, or the page gets loaded for the first time, I load the childelements of the node too, to estimate whether to display the expand item or not.

This code gets called when i load the page for the first time (or refresh it):


            ParameterTreeView.Nodes.Clear(); 
            ICollection<IHierarchyElement> rootColl = treeStructureService.ParameterRootElements(); 
            foreach (IHierarchyElement element in rootColl) 
            { 
                RadTreeNode node = CreateNode(element); 
                ICollection<IHierarchyElement> childColl = treeStructureService.ParameterChildElements(node.Value); 
                foreach (IHierarchyElement childElement in childColl) 
                { 
                    RadTreeNode cNode = CreateNode(childElement); 
                    node.Nodes.Add(cNode); 
                } 
                ParameterTreeView.Nodes.Add(node); 
            } 

Creating a node happens like that:

private static RadTreeNode CreateNode(IHierarchyElement element) 
        { 
            RadTreeNode node = new RadTreeNode(element.Denotation); 
            node.Value = element.Id; 
            node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack; 
            node.ImageUrl = "~/RadControls/Treeview/Skins/ExampleSkins/ContextMenu/Folder.gif"; 
            node.ExpandedImageUrl = "~/RadControls/Treeview/Skins/ExampleSkins/ContextMenu/FolderOpen.gif"; 
            return node; 
        } 

and expanding a node like that:

foreach (RadTreeNode node in _root.Nodes) 
            { 
                //RadTreeNode node = CreateNode(element); 
                ICollection<IHierarchyElement> childColl = treeStructureService.ParameterChildElements(node.Value); 
                 
                foreach (IHierarchyElement child in childColl) 
                { 
                    RadTreeNode childNode = CreateNode(child); 
                    node.Nodes.Add(childNode); 
                } 
            } 

My Problems in short:

Whenever i refresh the page and expand the root items again, already deleted items are shown.
The node items are only shown in layer 1 and 2. Everything beneath these layers has no items.
After refreshing, the duplicate items are missing the images too.
Timothy Robbins
Top achievements
Rank 1
 answered on 05 Feb 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?