Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
170 views

I have a page "Tracking.aspx" which loads a Radgrid with employee work details(say id(hidden),employee_id, employee_name, hours_worked, date_worked)

Example entries:

id     employee_id    employee_name     hours_worked     date_worked

1         1                              Emp1                          5                 1/1/2015

2         1                              Emp1                          2                 2/1/2015

3         2                              Emp2                          6                 1/1/2015

4         2                              Emp2                          8                 2/1/2015

 

Now, I'm trying to add a functionality to this page. If the user wants to make a new entry very similar to id '4', then he has to click on the Employee_name column of that row, which will open the page in insert mode(we have a separate user control for Insert, "TrackingAddForm.ascx"), with the details of the id '4' populated in it.

This is what I have done so far: 

1)  I have managed to change the employee name column from 'telerik:GridBoundColumn' into 'telerik:GridHyperLinkColumn' 

<telerik:GridHyperLinkColumn DataTextField ="Employee" DataNavigateUrlFields = "ID" DataNavigateUrlFormatString="Tracking.aspx?blank=Employee&id={0}"
                        FilterControlAltText="Filter Employee column" HeaderText="Employee" 
                        SortExpression="Employee" UniqueName="Employee">

 2) When this link is clicked, I'm collecting the ID from the Request.QueryString and fetching the data for the corresponding ID.

 3) I have opened the same "Tracking.aspx" page in the Insert Mode, so that the user control "TrackingAddForm.ascx" is shown in the "Tracking.aspx". (used the below code)

protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {                
                RadGrid1.MasterTableView.IsItemInserted = true;
                RadGrid1.Rebind();
            }
        }

 

Now what I'm NOT ABLE to do is:

4) Populate the fields of the user control "TrackingAddForm.ascx" with the data fetched in step (2).

 

So my question is,

a) While opening the page in Insert Mode(by clicking a 'GridHyperLinkColumn' Employee), is there a way to populate the fields of the Insert UserControl ? 

b) If any of the above steps I have taken is wrong or if there is a better approach to do the same thing, please let me know.

 

Thanks in Advance

Eyup
Telerik team
 answered on 12 Jan 2016
2 answers
207 views

Hi again,

I am using RadTabstrip with 3 tabs in a master page and want to display a counter that shows total number of clicks for each tab. For instance, if I select a tab (which send me to another page) it should show me total number of clicks on that particular page.  

How can I achieve this function?

Veselin Tsvetanov
Telerik team
 answered on 12 Jan 2016
1 answer
117 views

I have a telerik:RadGrid that is configured to automatically adjust the column width based on its data. It does so, but an oddity still persists. When I scroll horizontally to the right, the end columns adjust to fill the entire width of the RadGrid, even though its contents were displayed fully already. Scrolling to the right inflates a 300px-wide column width to three or four times its width.

I'm not sure where to go from there. Aside from that issue, everything else is behaving as I intended.

My code:

<telerik:RadCodeBlock runat="server">
  <script type="text/javascript">
    function reqStart_aegv(sender, args) {
      if (args.get_eventTarget().indexOf("gridToolBar") > 0 && args.get_eventArgument() === "1")
        sender.set_enableAJAX(true);
    }
    function disableAjaxIfExport_aegv(sender, args) {
      if (args.get_item().get_commandName() === "Export")
      sender.get_parent().get_parent().set_enableAJAX(false);
    }
    function pageLoad() {
      var grid = $find("<%= EntityRecordListGrid.ClientID %>");
      var columns = grid.get_masterTableView().get_columns();
       
      for (var i = 0; i < columns.length; i++) {
        columns[i].resizeToFit(false, false);
 
        if (columns[i]._element.UniqueName != "btnEdit" && columns[i]._element.UniqueName != "btnDelete") {
          if (columns[i]._element.clientWidth < 125) {
            grid.get_masterTableView().resizeColumn(i, 125);
          } else if (columns[i]._element.clientWidth > 300) {
            grid.get_masterTableView().resizeColumn(i, 300);
          }
        }
      }
    }
  </script>
</telerik:RadCodeBlock>
 
<telerik:RadAjaxPanel ID="radAjaxPanel" runat="server" LoadingPanelID="radAjaxLoadingPanel" ClientEvents-OnRequestStart="reqStart_aegv">
  <asp:Panel runat="server" ID="panelGrid">
    <telerik:RadGrid runat="server" ID="EntityRecordListGrid" GroupingSettings-CaseSensitive="False" AllowPaging="True" AllowSorting="True"
      AllowFilteringByColumn="True" ClientSettings-Selecting-AllowRowSelect="True" FilterType="Classic" HeaderStyle-Wrap="False" PageSize="50">
      <AlternatingItemStyle BackColor="#CDCDCD"/>
      <ClientSettings>
        <Resizing AllowColumnResize="True" ResizeGridOnColumnResize="True" AllowResizeToFit="True" EnableRealTimeResize="True"/>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="240px"></Scrolling>
      </ClientSettings>
      <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False" AllowFilteringByColumn="True">
        <NoRecordsTemplate>
          <asp:Literal runat="server" Text="<%$Resources:TPC_PageWidgetFrontEnd_Resources,PageWidgetFrontEnd.NoRecords.Title %>"></asp:Literal>
        </NoRecordsTemplate>
        <CommandItemTemplate>
          <telerik:RadToolBar runat="server" ID="gridToolBar" autopostback="True" causesvalidation="False" OnClientButtonClicked="disableAjaxIfExport_aegv">
            <Items>
              <telerik:RadToolBarButton  Text="<%$Resources:TPC_PageWidgetFrontEnd_Resources,PageWidgetFrontEnd.AddNew.Title %>" CommandName="AddRecord" ImagePosition="Right"  />
              <telerik:RadToolBarButton  Text="<%$Resources:TPC_PageWidgetFrontEnd_Resources,PageWidgetFrontEnd.Export.Title %>" CommandName="Export" ImagePosition="Right"/>
            </Items>
          </telerik:RadToolBar>
        </CommandItemTemplate>
        <Columns>
          <telerik:GridButtonColumn UniqueName="btnEdit" ButtonType="ImageButton" CommandName="Edit"  />
          <telerik:GridButtonColumn UniqueName="btnDelete" ConfirmText="<%$Resources:TPC_PageWidgetFrontEnd_Resources,PageWidgetFrontEnd.DeleteThisRecord.Title %>" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="100px" ConfirmDialogWidth="220px" />
        </Columns>
      </MasterTableView>
    </telerik:RadGrid>
  </asp:Panel>       
</telerik:RadAjaxPanel>
Angel Petrov
Telerik team
 answered on 12 Jan 2016
1 answer
127 views

There are some scaling issues when maximizing images in RadLightBox. If you maximize LightBox to display an image and some text, the image would shrink horizontally. See image below.

 

Kostadin
Telerik team
 answered on 12 Jan 2016
4 answers
479 views

Good morning

Please, how can find a radnumerictextbox exist in GridTableView Footer inside a telerik radgrid by javascript

 Regards

Kostadin
Telerik team
 answered on 12 Jan 2016
4 answers
474 views

Hello,

I have a custom style sheet, which I use successfully with various controls. I have an issue with a RadButton which I am trying to use as an image button. I find that on initial entry the RadButton styles are not taking effect. On postback the styles DO take effect. Other styles from the same stylesheet DO take effect immediately on initial entry against other controls defined in the same user control.

Some specifics: 1) This is a SharePoint web part which defines user controls dynamically. One of these user controls has the RadButton (which has the problem) and also contains other controls (which DO work).

2) I am using a RadAjaxPanel - all User Controls are added to this Panel.

3) The buttons are disabled in the code on initial entry.

4) the gradient styling does not work at all.

Here is an extract from the styles.css:

 

.classImage
{
    background: url(images/previousAsset200x23.png), linear-gradient(to bottom, #f2f2f2, #a9a9a9),
       -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cbcbcb)),
       -moz-linear-gradient(top, #f2f2f2, #a9a9a9) ;
    background-position: 8px 2px;
    background-repeat:no-repeat;
    width: 250px;
    height: 23px;
    border: solid;
    border-radius: 4px;
    border-width: 1px;
    border-color:black;
    /*padding: 0px 7px 0px 4px ;*/  /* top right bottom left */
    padding: 2px 4px;
}
 
.classHoveredImage
{
    /*background-position: 0 -10px;*/
}
 
.classPressedImage
{
    /*background-position: 0 -20px;*/
}

Here is an extract of the ascx file:

<SharePoint:CssLink ID="cssLink1" runat="server" DefaultUrl="XXX.SharePoint.YYY/Styles.css" />
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" ExpandMode="FullExpandedItem" Width="900px" Height="116px">
        <Items>
            <telerik:RadPanelItem Text="Asset Search" Expanded="true" >
                <ContentTemplate>
                    <table style="width:100%; text-align:center">
                        <tr>
                            <td>       
                                <telerik:RadButton ID="PreviousAssetRadButton" runat="server" Width="210px"
                                     Height="23px" Text="Previous Asset" ButtonType="StandardButton"
                                    ToolTip="Find the prior asset on the pipeline."
                                    OnClick="PreviousAssetRadButton_Click"
                                    CssClass="classImage" HoveredCssClass="classHoveredImage"
                                    PressedCssClass="classPressedImage"
                                    Image-IsBackgroundImage="true">
                                    <Image
                                   ImageUrl="/_layouts/15/images/XXX.SharePoint.YYY/previousAsset56X23.png"
                                        EnableImageButton="true"  />
                                </telerik:RadButton>
                                  

Danail Vasilev
Telerik team
 answered on 12 Jan 2016
1 answer
194 views
Hello all,

We were trying to improvise on the existing Telerik filters in our web application.
We initially had normal filters with existing GridKnownFunction values for some columns, while we had RadComboBox to enable drop-down on top of which there were filters for few other columns.
Now we were trying to use checklist filtering (instead of RadComboBox implementation) along with the existing normal filters in the same RadGrid.
We set the FilterType to Combined and tried using the OnFilterCheckListItemsRequested property of RadGrid along with setting FilterCheckListEnableLoadOnDemand property of GridBoundColumn to true for the columns that required Checklist filtering.
However, we are running into several issues where the normal filtering is not working as expected.
Is it possible to have both these types of filtering in the same RadGrid?
Are we missing out on something else here?

Please guide us through this.

Thanks in advance,
Anushree Ramanath
Maria Ilieva
Telerik team
 answered on 12 Jan 2016
7 answers
275 views

hi,

i jave a chart with line series and it has a different behavior of the auto scale between 200 and 400 items (or more).

the first is loaded correctly and the first value shown in the Yaxis is 0.95 (see attached) but with 400 it starts form zero.

all items are all positive and greater than zero.

what configuration am i missing?

 RadHtmlChart chart = new RadHtmlChart { Transitions = true, Skin = "Bootstrap", CssClass = "plutochart" };
            chart.ID = "htmlChart";
            chart.Legend.Appearance.BackgroundColor = Color.White;
            chart.Legend.Appearance.Position = ChartLegendPosition.Bottom;
            chart.Legend.Appearance.TextStyle.Bold = false;
            chart.Legend.Appearance.TextStyle.FontFamily = "Helvetica";
            chart.Legend.Appearance.TextStyle.Italic = false;
            chart.Legend.Appearance.TextStyle.Color = Color.Black;
            chart.Legend.Appearance.TextStyle.FontSize = 12;
            chart.Legend.Appearance.TextStyle.Margin = "0";
            chart.Legend.Appearance.TextStyle.Padding = "10";

            chart.Appearance.FillStyle.BackgroundColor = Color.Transparent;
            
            chart.PlotArea.XAxis.TitleAppearance.Visible = false;
            chart.PlotArea.XAxis.LabelsAppearance.DataFormatString = LocalizeHelper.DateTimeFormat;
            chart.PlotArea.XAxis.MajorGridLines.Visible = false;
            chart.PlotArea.XAxis.MinorGridLines.Visible = false;

            /*
             * nell'ascisse ci stanno al max 9 label quindi devo calcolare il corretto Step
             */
            double gropu = (listCount / 9);
            int step = Convert.ToInt32(Math.Ceiling(gropu));
            chart.PlotArea.XAxis.LabelsAppearance.Step = step > 0 ? step : 1;
            chart.PlotArea.XAxis.LabelsAppearance.RotationAngle = -45;
            chart.PlotArea.YAxis.TitleAppearance.Text = string.Empty;
            chart.PlotArea.YAxis.TitleAppearance.TextStyle.Margin = "20";
            chart.PlotArea.YAxis.MinorGridLines.Visible = false;
            chart.PlotArea.YAxis.Type = HtmlChartValueAxisType.Numeric;
            chart.PlotArea.YAxis.LabelsAppearance.DataFormatString = LocalizeHelper.RoundDoubleDecimalsToString;

 

LineSeries itemSeries = new LineSeries { Name = quotationsTitle };
            itemSeries.LabelsAppearance.DataFormatString = LocalizeHelper.RoundDoubleDecimalsToString;
            itemSeries.LineAppearance.Width = 3;
            itemSeries.TooltipsAppearance.Color = Color.White;
            itemSeries.LabelsAppearance.Visible = false;
            itemSeries.MarkersAppearance.Visible = false;
            LineSeries minMaxLastSeries = new LineSeries { DataFieldY = "MinMaxLastQuoteDouble", Name = minMaxLastTitle };

chart.PlotArea.XAxis.DataLabelsField = "QuoteDateTime";
                    itemSeries.DataFieldY = "QuoteDouble";
                    itemSeries.TooltipsAppearance.ClientTemplate = @"#= kendo.format(\'{0:" + LocalizeHelper.RoundDoubleDecimalsToString + @"}\', dataItem.QuoteDouble) #
                                <br/>
                                #= dataItem.QuoteDateTimeToString #";

                    minMaxLastSeries.TooltipsAppearance.ClientTemplate = @"#= kendo.format(\'{0:" + LocalizeHelper.RoundDoubleDecimalsToString + @"}\', dataItem.MinMaxLastQuoteDouble) #
                                <br/>
                                #= dataItem.QuoteDateTimeToString #";

minMaxLastSeries.LineAppearance.Width = 5;
            minMaxLastSeries.LabelsAppearance.Visible = true;
            minMaxLastSeries.LabelsAppearance.DataFormatString = LocalizeHelper.RoundDoubleDecimalsToString;
            minMaxLastSeries.MarkersAppearance.Visible = true;
            minMaxLastSeries.MarkersAppearance.Size = 14;
            minMaxLastSeries.MarkersAppearance.BackgroundColor = Color.Teal;
            minMaxLastSeries.TooltipsAppearance.DataFormatString = LocalizeHelper.RoundDoubleDecimalsToString;
            minMaxLastSeries.MissingValues = MissingValuesBehavior.Gap;
            

            LineSeries averageQuoteSeries = new LineSeries { DataFieldY = "AverageValue", Name = averageValueTitle };
            averageQuoteSeries.LineAppearance.Width = 3;
            averageQuoteSeries.LabelsAppearance.Visible = false;
            averageQuoteSeries.LabelsAppearance.DataFormatString = LocalizeHelper.RoundDoubleDecimalsToString;
            averageQuoteSeries.Appearance.FillStyle.BackgroundColor = Color.FromArgb(250, 152, 25);
            averageQuoteSeries.MarkersAppearance.Visible = false;
            averageQuoteSeries.TooltipsAppearance.DataFormatString = LocalizeHelper.RoundDoubleDecimalsToString;

            itemSeries.MissingValues = MissingValuesBehavior.Interpolate;

            chart.PlotArea.Series.Add(itemSeries);
            chart.PlotArea.Series.Add(averageQuoteSeries);
            chart.PlotArea.Series.Add(minMaxLastSeries);

Danail Vasilev
Telerik team
 answered on 12 Jan 2016
1 answer
115 views

Hi, this is Ankur and i have some query in binding  RadScheduler  cells. Actually,  I am facing a issue on binding RadScheduler month view each cell with some enteries which are coming from database.

I had attached an image in which, cells in scheduler with blue circles which i had already bind but the circles in red are those cells which i have to bind.

So can you please short out my issue, that how should i bind scheduler all cells of current month with enteries which are coming from database.

Plamen
Telerik team
 answered on 12 Jan 2016
4 answers
583 views
I am trying to switch our use of jquery over to that bundled with telerik since they are now the same version. However, I'm having a problem getting jquery-ui to work with it. I'm using jquery-ui to create a dialog, and it doesn't appear to work. Expanding the $telerik.$, I don't see a .dialog method on it.

I have the script references in our master page, as

</head>
<body>
<form id="form1" runat="server">
 
<telerik:RadScriptManager runat="server" ID="rsmMaster" EnablePartialRendering="true" LoadScriptsBeforeUI="true" >
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
    </Scripts>
</telerik:RadScriptManager>

then in a user control, I have
<link rel="stylesheet" type="text/css" href="/Styles/jquery-ui-1.9.1.min.css"/>
<script type="text/javascript" src="/Scripts/static/jquery-ui-1.9.1.min.js"></script>

When I view the page source, I see the same order as this, the
<script src="/WebResource.axd?d=DuSlCKW6NVW_IvooK_ULRkGrkaQk8B9YO8dMFExK7Zd9u8awk2PNvZljNscyGZmt29aEjTONftL-RFMNd5YH_LVuLwJPS8p7Ny3IB93VcfM1&t=634970873020000000" type="text/javascript"></script>
is far above the jquery-ui lines.

Any thoughts
Danail Vasilev
Telerik team
 answered on 12 Jan 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?