Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
262 views
Does anyone have a way of adding a onmouseover/onmouseout event to the x axis labels in a bar chart?  I was able to add a click event to the x axis labels using the axisLabelClick event.  From what i've read there is no built in event for the hover of the x axis labels.  Does anyone have a custom way to do this?

I'd like the x axis labels to look and act like a hyperlink (cursor pointer and underline upon onmouseover)

<telerik:RadHtmlChart runat="server" ID="BarChart" Height="400" Transitions="true" DataSourceID="ChartsDataSource" OnClientSeriesClicked="OnClientSeriesClicked">
            <PlotArea>
                <Appearance>
                    <FillStyle BackgroundColor="#c5d291"></FillStyle>
                </Appearance>
                 <Series>
                    <telerik:BarSeries DataFieldY="PercentPaid">
                        <Appearance FillStyle-BackgroundColor="#729021"></Appearance>
                        <LabelsAppearance Position="InsideBase" Color="White">
                            <ClientTemplate>
                                $#=dataItem.PaidToDate#
                            </ClientTemplate>
                        </LabelsAppearance>
                    </telerik:BarSeries>
                </Series>
                <XAxis DataLabelsField="CustomerName" Reversed="false" >
                    <TitleAppearance Text="Customer Name" Visible="false">
                        <TextStyle Margin="20" />
                    </TitleAppearance>
                    <MajorGridLines Visible="false" Width="0" />
                    <MinorGridLines Visible="false" />
                </XAxis>
                <YAxis AxisCrossingValue="0" Color="#b3b3b3" MajorTickSize="1" MajorTickType="Outside"
             MinorTickSize="1" MinorTickType="Outside" MinValue="0" MaxValue="100" Reversed="false">
                   <LabelsAppearance DataFormatString="{0}%" RotationAngle="30" Skip="0" ></LabelsAppearance>
                   <MajorGridLines Color="#EFEFEF" Width="0"></MajorGridLines>
                   <MinorGridLines Color="#F7F7F7" Width="0"></MinorGridLines>
                   <TitleAppearance Position="Center" RotationAngle="0" Text="Percent Paid" ></TitleAppearance>
                </YAxis>             
            </PlotArea>
        </telerik:RadHtmlChart>
Danail Vasilev
Telerik team
 answered on 15 Jul 2014
8 answers
289 views
I have a RadTree controls in a single page divided by tabs, 1st tab two radtrees, 2nd tab three, 3rd tab   three.
Child nodes are expanding LoadOnDemand event.

I gonna maintain Tree view state(without session) though user refresh the page. If user expands parent node and press F5 button we have to show expanded nodes as it is. 

Private Shared dictOriginTree As New Dictionary(Of String, Boolean)

Protected Sub rtvOriginTree_NodeExpand(sender As Object, e As RadTreeNodeEventArgs)        
        If Not dictOriginTree.ContainsKey(e.Node.UniqueID) Then
            dictOriginTree.Add(e.Node.UniqueID, e.Node.Expanded)
        End If
    End Sub

Protected Sub ramMasterDocumentsAjaxManager_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)
Dim node As RadTreeNode
                For Each node In rtvOriginTree.GetAllNodes()
                    If dictOriginTree.ContainsKey(node.UniqueID) Then
                        node.ExpandParentNodes()
                        node.ExpandChildNodes()
                        node.Expanded = dictOriginTree.Item(node.UniqueID.ToString())
                        node.ExpandMode = TreeNodeExpandMode.ServerSide
                    End If
                Next
End Sub
Hristo Valyavicharski
Telerik team
 answered on 15 Jul 2014
5 answers
129 views
Hello,
how to change the names of the fonts in dropdown  in french  language,  without changing the names of their font file (English)

Thanks,
walid2013
Top achievements
Rank 1
 answered on 15 Jul 2014
1 answer
171 views
I am using a RadHtmlChart that calls a javascript method when a series is clicked:

<telerik:RadHtmlChart runat="server" ID="SBarChart1" Transitions="false" EnableTheming="true" CssClass="Chart"
                    OnClientSeriesClicked="OnBarClientSeriesClicked" > ...

The chart is bound to a DataTable.  The first row in the table has the data:

- resultsTbl.Rows[0].ItemArray {object[5]} object[]
[0] "Jan '13" object {string}
[1] "012013" object {string}
[2] 5510.83 object {decimal}
[3] 0 object {decimal}
[4] 0 object {decimal}

As you can see the second item is a STRING with a value of "012013".  The column name for this field is "CategoryID.  Take note of the leading zero in the string!

When a user clicks on a chart series, the Javascript OnClientSeriesClicked method is called and I retrieve the data from the series using the args.get_dataitem() method:

function BarClientSeriesClicked(sender, args) {
    var theDataItem = args.get_dataItem();
    ...

The data I get back in the VAR theDataItem is:
CategoryText   "Jan '13"
CategoryID      12013
Domestic          5510.83
International      0

As you can see the Type of the CategoryID field has changed from STRING to an INTEGER (the value is no longer quoted). A side effect of this TYPE change is that my string value has changed (the leading zero has been removed)! Somewhere after the databind of the chart to the DataTable, and before the Javascript method call occurs, something is reinterpreting my STRING field as an INTEGER and changing the type.  

I want my bound STRING fields to remain as STRING types when I retrieve the data in the Javascript BarClientSeriesClicked method.  A side effect of changing the field type is the leading zero is truncated and my string comparison no longer works (my later code is expecting a string containing a two-digit month and four digit year which is no longer the case).

I believe this is a bug somewhere deep in the RadHtmlChart code.  As you can see I am binding a STRING field to the chart and I have nothing else to do with the data until the chart calls the OnClientSeriesClickedEvent where the data type has magically changed.

I have a work around where I can force a non-numeric character at the start of my string (e.g. prepend the letter 'a' to my original CategoryID value, e.g. 'a012013'). After I get the data value with args.get_dataItem(), my value remains as a STRING type (as you can see the value is now quoted indicating it is a STRING type):

CategoryText   "Jan '13"
CategoryID      "a012013"
Domestic          5510.83
International      0

I can then strip off the leading 'a' character and I have a CategoryID of type STRING that is properly formatted with my leading zero intact.

Even though I have a work around I am bringing this up because it seems to be a bug somewhere in the RadHtmlChart code.

Thanks

Courtney


Danail Vasilev
Telerik team
 answered on 15 Jul 2014
1 answer
81 views
I have two Radcombobox which the first one is binding to a dataTable. when the Item is selected from the first radcombobox according to that the second one Items maybe populated or if not we have to be able to type in it. when I click in the second one to type (for example:5555) the drop down collapses and 5555 is removed and it shows the default text so fast and the user oblige to open it again. I want the Radcombobox doesn't get refresh.
Shinu
Top achievements
Rank 2
 answered on 15 Jul 2014
1 answer
132 views
using a standard radgrid with an editform template when I look at the popup it does have the same look as a radwindow. I'm using the metro skin and would expect flat icons but the close window icon is not. also the window title bar is white but the radwindow title bar is blue. shouldn't they match?
Venelin
Telerik team
 answered on 15 Jul 2014
3 answers
223 views
Hi,
I have a RadGrid which contains Parent Rows and each parent Row has Child Rows(populating Child rows with DetailTableDataBind event).
and i am creating a hyperlink inside the child table
protected void grd_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item.OwnerTableView.Name == "ChildTable" && e.Item is GridDataItem)
       {
         GridDataItem item = (GridDataItem)e.Item;
         string  szID = item.GetDataKeyValue("ID").ToString();
         string szName = item.GetDataKeyValue("NAME").ToString(); 
 
         HyperLink hLink = (HyperLink)item.FindControl("HyperLink1");
         hLink.Text = szName;
 
         hLink.Attributes.Add("onclick", "return onDocClick('" + item.OwnerTableView.ParentItem.ItemIndex + "', '" + item.ItemIndex + "');");
      }
}

Javascript
 function onDocClick(parentindex, childindex) 
 { 
  // here How do i select/check Corresponding Parent Row and Child Row?
 }
Princy
Top achievements
Rank 2
 answered on 15 Jul 2014
5 answers
183 views
Actually I can horizontally increase all
elements width by putting their width in percentage(%). So that in a
normal wide screen(1366x768) the pages are rich with labels and its associated
text-boxes, drop-downs, calendar controls ,text-areas and popups.

But our major clients have huge Desktop Monitors so that the text-box,
drop-downs normal height is 22px and in that huge screens its is not at
all sufficient.

Also Popup windows width & height too have the same issue. Can't resize relatively.
Need a solution please help ASAP.

Thanks in Advance


Please see the attachment
Vargis
Top achievements
Rank 2
 answered on 15 Jul 2014
5 answers
358 views

I have created Telerik Grid like this and item Bound Function also shown like as follows:

Please tell me if I resized the columns then how will I get the width of column present in RadGrid.Please find that telerik Auto Generated Column is set to true.



"

Namespace="Microsoft.SharePoint.WebControls" %>

<%@ Register Assembly="Telerik.Web.UI, Version=2010.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Table runat="server">

<asp:TableRow>

<asp:TableCell>

<telerik:RadGrid ID="gridForPreNewEdit2" AllowPaging="true" ShowFooter="false" runat="server" AutoGenerateColumns="true" GridLines="Both">

</telerik:RadGrid>

</asp:TableCell>

</asp:TableRow>

</asp:Table>

void grdViewForPreview_ItemDataBound(object sender, GridItemEventArgs e)

{

try

{

 

if (e.Item is GridDataItem)

{

GridDataItem item = e.Item as GridDataItem;

SPWeb web = SPContext.Current.Web;

SPList list = web.Lists[new Guid(ddlSrcList.SelectedValue)];

 

SPListItem itemCol = list.Items.Add();

 

var contex = SPContext.GetContext(this.Context, 0, list.ID, list.ParentWeb);

 

foreach (GridColumn column in item.OwnerTableView.RenderColumns)

{

if (column.HeaderText == "Delete")

{

ImageButton btnDeleteFor = new ImageButton();

btnDeleteFor.ID = column.UniqueName;

btnDeleteFor.Enabled = false;

item[column.HeaderText].Controls.Clear();

item[column.HeaderText].Controls.Add(btnDeleteFor);

}

else

{

foreach (ListItem lstItem in lbDisplayedCols.Items)

{

if (lstItem.Text.ToLower().Trim() == column.HeaderText.ToLower().Trim())

{

SPField listField = list.Fields[column.HeaderText];

 

if (listField.Type != SPFieldType.DateTime && listField.Type != SPFieldType.User)

{

Panel pnlForBFC = new Panel();

pnlForBFC.ID = "Field2_" + listField.InternalName;

BaseFieldControl bfc = listField.FieldRenderingControl;

bfc.ID = "Field_" + listField.InternalName;

 

bfc.ControlMode = SPControlMode.New;

 

bfc.EnableViewState = true;

bfc.RenderContext = contex;

bfc.ItemContext = contex;

bfc.IsValid = true;

bfc.Visible = true;

pnlForBFC.Controls.Add(bfc);

pnlForBFC.Enabled = false;

 

item[column.HeaderText].Controls.Clear();

item[column.HeaderText].Controls.Add(pnlForBFC);

}

else if (listField.Type == SPFieldType.User)

{

 

PeopleEditor peopleEditor = new PeopleEditor();

 

item[column.HeaderText].Controls.Clear();

item[column.HeaderText].Controls.Add(peopleEditor);

}

else if (listField.Type == SPFieldType.DateTime)

{

DateTimeControl dtControl = new DateTimeControl();

dtControl.ID = "Field_" + listField.InternalName;

dtControl.Enabled = false;

item[column.HeaderText].Controls.Clear();

item[column.HeaderText].Controls.Add(dtControl);

}

 

}

}

}

}

}

else if (e.Item is GridFooterItem)

{

GridFooterItem itemForFooter = e.Item as GridFooterItem;

foreach (ListItem chosenListCol in lbDisplayedCols.Items)

{

if (ViewState[chosenListCol.Text] != null)

{

Label lblForFooter = new Label();

lblForFooter.ID = "Field_" + chosenListCol.Text;

lblForFooter.Text = "0";

lblForFooter.Width = Unit.Percentage(100);

lblForFooter.BorderColor = Color.Black;

lblForFooter.BorderStyle = BorderStyle.Solid;

lblForFooter.BorderWidth = 1;

itemForFooter[chosenListCol.Text].Controls.Clear();

itemForFooter[chosenListCol.Text].Controls.Add(lblForFooter);

}

}

}


Pavlina
Telerik team
 answered on 15 Jul 2014
1 answer
116 views
hello telerik,

I have radgrid with number of columns. there is an option to not display all the column on page load. In case of setting display=none to part of them, the grouping operation misses up the column's width. This is not happening if all the columns are displaying and it's happening only in ie10.
 the optional columns are: UserNameColumn,OUNameColumn, PendingUserApprovalColumn, SelectionColumn, MenuColumn

this this the Grid: 
<bks:BksGrid  runat="server" ID="gridUsersCertifications" AutoGenerateColumns="false" OnItemCreated="gridUsersCertifications_OnItemCreated" OnItemDataBound="gridUsersCertifications_OnItemDataBound" OnPreRender="gridUsersCertifications_PreRender" ShowGroupPanel="true" OnNeedDataSource="gridUsersCertifications_OnNeedDataSource" ExtraHeight="55"  AllowMultiRowSelection="true">
    <MasterTableView AllowSorting="false" GroupLoadMode="Client" TableLayout="Fixed" DataKeyNames="UserCertificationID,BE_OriginatedIN,AcquiringStatusID" ClientDataKeyNames="UserCertificationID,BE_OriginatedIN,AcquiringStatusID"  >
     
        <Columns>
            <telerik:GridClientSelectColumn UniqueName="SelectionColumn" ItemStyle-Width="35px" ></telerik:GridClientSelectColumn>
            <telerik:GridTemplateColumn Groupable="false" UniqueName="MenuColumn" ItemStyle-Width="30px">
                <ItemTemplate>
                    <img src="/Images/Edit.png" alt="" onclick="javascript:OpenMenu(event,'<%#Eval("UserCertificationID") %>','<%#Eval("AcquiredCertificationStatusID") %>','<%#Eval("AcquiringStatusID") %>','<%#Eval("AllowUpdateByUser") %>')"/>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="IDColumn" Display="false" DataField="UserCertificationID"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="UserIDColumn" DataField="UserID" Display="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="UserNameColumn" DataField="UserName" HeaderText="CERTIFICATION_USER_NAME"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="OUIDColumn" DataField="BE_OriginatedIN" Display="false"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="OUNameColumn" HeaderText="CERTIFICATION_OU" SortExpression="ParentName" GroupByExpression="ParentName Group By ParentName" >
                <ItemTemplate>
                    <span class="spanFullPath">
                        <bks:BksLabel runat="server" ID="lblOuName" Text='<%#Eval("ParentName") %>'></bks:BksLabel>
                    </span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="CertificationIDColumn" DataField="CertificationID" Display="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="MDTypeName" DataField="MDTypeName" HeaderText="CERTIFICATION_TYPE_NAME" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="MDTypeID" DataField="MDTypeID" Display="false" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="CertificationNameColumn" DataField="CertificationName" HeaderText="CERTIFICATION_NAME"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="StatusColumn" HeaderText="CERTIFICATION_STATUS" SortExpression="CertificationStatus" GroupByExpression="CertificationStatus Group By CertificationStatus">
                <ItemTemplate>
                    <span class="spanStatus"><img runat="server" id="imgStatus" alt="" src="" /></span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="CalculatedExpirationDateColumn" DataField="CalculatedExpirationDateFormat" HeaderText="CALCULATED_CERTIFICATION_EXPIRATION_DATE"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="OriginalExpirationDateColumn" DataField="OriginalExpirationDateFormat" HeaderText="ORIGINAL_CERTIFICATION_EXPIRATION_DATE"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="PlannedStartDateColumn" DataField="PlannedStartDateFormat" HeaderText="CERTIFICATION_PLANNED_START_DATE"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="PlannedAcquiringDateColumn" DataField="PlannedAcquiringDateFormat" HeaderText="CERTIFICATION_PLANNED_ACQUIRING_DATE"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn Groupable="false" UniqueName="acquiringStatusColumn" HeaderText="CERTIFICATION_ACQUIRING_STATUS" >
                <ItemTemplate>
                    <span class="spanApprovalProcess">
                        <bks:BksLabel runat="server" ID="lblacquiringStatus" Text='<%#Eval("AcquiringStatus") %>'></bks:BksLabel>
                    </span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="AcquiringMethodColumn"  DataField="acquiringMethod" HeaderText="CERTIFICATION_ACQUIRING_RENEWAL_METHOD"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn Groupable="false" UniqueName="InitialAcquirementDateColumn" DataField="InitialAcquirementDateFormat" HeaderText="CERTIFICATION_INITIAL_ACQUIREMENT_DATE"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="PendingUserApprovalColumn" Visible="false" HeaderText="CERTIFICATION_PENDING_FOR_USER_APPROVAL" >
                <ItemTemplate>
                    <img runat="server" id="imgPendingUserApproval" alt="" src="/Certifications/Images/PendingApproval.png" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
 
    <ClientSettings AllowGroupExpandCollapse="True" AllowDragToGroup="True" >
        <ClientEvents OnRowMouseOver="GridRowMouseOver" OnRowSelecting="GridUsersCertifications_OnRowSelecting" />
    </ClientSettings>
 
    <GroupingSettings ShowUnGroupButton="true" />
 
    <CommandButtons>
         <bks:BksButton ID="btnUpdateCertification" runat="server" Text="UPDATE_CERTIFICATIONS" OnClientClick="UpdateMultiCertifications()" />
    </CommandButtons>
 
</bks:BksGrid>


thanks in advance,  Shir.

Venelin
Telerik team
 answered on 15 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?