Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
486 views
I'm having an issue getting my detail table to load properly using NeedDataSource and DetailTableDataBind events.  The main grid loads as expected after the NeedDataSource event, however after clicking to expand the row, the detail table does NOT load after the DetailTableDataBind event.  Stepping through the code shows the DetailTableDataBind does fire and the DataSource is assigned.  If I use a SqlDataSource instead of during the DetailTableDataBind event, the table loads properly.  The "GetDetailView" (see below) uses the exact same stored procedure as the SqlDataSource, returning a DataTable.  Stepping through the code, the DataTable is populated with the same data as that returned using SqlDataSource. 

The events fire properly and the DataSource is assigned a valid DataTable value at the correct moment, therefore I don't understand why the detail table does not load.  Any help in resolving the this issue will be greatly appreciated!

protected void MyGrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
{
    try
    {
         GridDataItem dataItem = e.DetailTableView.ParentItem as GridDataItem;

         int                  id            = (int) dataItem.GetDataKeyValue("Id");

         e.DetailTableView.DataSource = MyClass.GetDetailView(id);
    }
    catch(Exception ex)
    {
         // log error
    }        
}

protected void MyGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
    try
    {
         if(e.IsFromDetailTable == false)
         {
             MyGrid.DataSource = MyClass.GetView();
         }
    }
    catch(Exception ex)
    {
         // log error
    }
}
Eyup
Telerik team
 answered on 05 Oct 2016
2 answers
585 views
What is a good approach to prompting the user 1 minute before the ASP.NET session expires, and then automatically redirecting the user to the login screen?  Does anyone have a code example? 

 

 

Michael
Top achievements
Rank 1
 answered on 05 Oct 2016
6 answers
180 views

Hi All,

I wanted to hide the default AsyncUpload button and call it using my custom button. The loading of file will still show once its called by my button.

My custom buttons is just <a href.. with  FontAwesome.

<a href="#" onclick="callUpload(); return false;" ><i class="fa fa-camera large" title="Change Photo"></i></a>

Any code for JavaScript that can call the AsyncUpload click?

 

Thanks in advance,

RJ

 

 

RJ
Top achievements
Rank 1
 answered on 04 Oct 2016
4 answers
175 views
Is it possible to disable the keyboard navigation on a PanelBar?  I am trying to bind keypress to a radtextbox within an item's ContentTemplate and it is not recognizing the enter press.  I believe this is due to the keyboard navigation feature of the PanelBar overriding the action for specific keycodes.
Tom Rasmussen
Top achievements
Rank 1
 answered on 04 Oct 2016
9 answers
406 views

I have an issue with the minDate of the RadTimePicker.

Problem #1

My schedule is from 9AM to 2AM the next day. 
I can show it properly in the time view picker.
However, when I set the MinDate and the MaxDate I am unable to select a schedule after midnight even thoug it's in the MinDate and MaxDate range.
Is there a workaround ?

Problem #2
The timeview picker won't show the last time if it's equal to EndTime. 
The control will allow you to type it, but you don't see it in the timeview picker.
I patched it by adding 1 second to the end time.  Is it a normal behavior ?

 

<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadTimePicker ID="TimePicker1" runat="server" TimeView-Interval="30"></telerik:RadTimePicker>
    </div>
    </form>
</body>
</html>

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        var startTime = new TimeSpan(9, 0, 0);
        var endTime = new TimeSpan(1, 2, 0, 0);
        TimePicker1.TimeView.StartTime = startTime;
        TimePicker1.TimeView.EndTime = endTime.Add(new TimeSpan(0, 0, 1)); // Patch.  Add 1 sec. to show the end time in the time view picker
        TimePicker1.MinDate = DateTime.Today.Add(startTime);
        TimePicker1.MaxDate = DateTime.Today.Add(endTime);
    }      
}

Maria Ilieva
Telerik team
 answered on 04 Oct 2016
1 answer
181 views

Hi, I'm trying to reproduce this chart style - http://demos.telerik.com/aspnet-ajax/htmlchart/examples/functionality/multipleyaxes/defaultcs.aspx

with a sql datasource that looks like this:

Period     Person          Sales

1              Rick                100

1              Sue                  200

2              Rick                 120

2               Sue                 180

So rick/sue would each have a bar for this respective sales in each period. I cant figure out how to bind the values in the chart?

Thank you

Vessy
Telerik team
 answered on 04 Oct 2016
1 answer
268 views

I have a dropdown column and am filtering the grid.  The drop down has an ID field and a text field, as you would expect.

The filter is actually looking for the ID field, rather than the value field. What happens is when I try to enter a character search, the filter recognized the value entered should be numeric and rejects the search.

 <telerik:GridDropDownColumn
DataField="RequestTypeID"
DataType="System.String"
FilterControlAltText="Filter RequestType column"
HeaderText="Request Type"
Allowfiltering="true"
ShowFilterIcon="true"
CurrentFilterFunction="Contains"
SortExpression="RequestTypeID"
UniqueName="RequestTypeID"
ListValueField="RequestTypeID"
ListTextField="RequestType"
DataSourceID="SqlDataSource2">
</telerik:GridDropDownColumn>

Help, please.

 

Maria Ilieva
Telerik team
 answered on 04 Oct 2016
1 answer
139 views

Hi all,

Wondering if you can help me please.

How can i assign the background image of a radmap.Marker.tooltip from a folder.

It is currently setup to save the user's profile image PATH in the database and then once the marker is created I want to bind the marker tooltipsettings.Background image with the path from the database.

Can you please assist me.

 

Regards,

Barend

Marin Bratanov
Telerik team
 answered on 04 Oct 2016
2 answers
231 views

I have a RadGrid which pops an WebUserControl to allow the user to update the data. I want to perform some simple validation on some of the NumericTextBoxes in the control and need to get the values of other controls to do this but my JavaScript returns null values for each of the other controls I need. Unfortunately my knowledge of JavaScript is limited and I really don't know why the $find is returning nulls so and pointers in the right direction much appreciated.

 

My WebUserControl includes the following controls:

<tr>
    <td class="style2">
        <label id="Label2" for="rtbProductGroup">Product Group:</label>
    </td>
    <td class="style1">
        <telerik:RadTextBox ID="rtbProductGroup" runat="server"
            Font-Names="Segoe UI" Resize="None"
            ResolvedRenderMode="Classic" Skin="Metro" AutoPostBack="false"
            Text='<%# DataBinder.Eval(Container, "DataItem.Product_Group") %>'
            TabIndex="2" ReadOnly="True" Width="250px">
        </telerik:RadTextBox>
    </td>
</tr>
<tr>
    <td style="width:10%;">
        <label id="Label64" for="Qty">Qty:</label>
    </td>
    <td style="width:5%;">
        <telerik:RadNumericTextBox ID="ntbQty" runat="server"
            CssClass="rounded" Culture="en-GB" DbValueFactor="1" width="60px"
            ResolvedRenderMode="Classic" Skin="Metro" LabelCssClass=""
            AutoPostBack="false" MaxValue="1000" MinValue="1"
            Text='<%# DataBinder.Eval(Container, "DataItem.Qty") %>'
            TabIndex="6">
            <NegativeStyle Resize="None" />
            <NumberFormat DecimalDigits="0" ZeroPattern="n" />
            <EmptyMessageStyle Resize="None" />
            <ReadOnlyStyle Resize="None" />
            <FocusedStyle Resize="None" />
            <DisabledStyle Resize="None" />
            <InvalidStyle Resize="None" />
            <HoveredStyle Resize="None" />
            <EnabledStyle HorizontalAlign="Right" Resize="None" />
        </telerik:RadNumericTextBox>
    </td>
 
    <td style="width:10%;">Qty (SA): </td>
    <td style="width:5%;">
        <telerik:RadNumericTextBox ID="ntbQtySA" runat="server"
            CssClass="rounded" Width="60px" Culture="en-GB"
            DbValueFactor="1" ResolvedRenderMode="Classic" AutoPostBack="false"
            Text='<%# DataBinder.Eval(Container, "DataItem.Qty_SA") %>'
            TabIndex="7">
            <NegativeStyle Resize="None" />
            <NumberFormat DecimalDigits="0" ZeroPattern="n" />
            <EmptyMessageStyle Resize="None" />
            <ReadOnlyStyle Resize="None" />
            <FocusedStyle Resize="None" />
            <DisabledStyle Resize="None" />
            <InvalidStyle Resize="None" />
            <HoveredStyle Resize="None" />
            <EnabledStyle Resize="None" HorizontalAlign="Right" />
        </telerik:RadNumericTextBox>
    </td>
</tr>

My Validation is triggered by a standard ASP CustomValidator:

<asp:CustomValidator ID="cvNtbQty" runat="server" ForeColor="Red"
                ControlToValidate="ntbQty"
                ClientValidationFunction="ntbQty_FieldValidate"
                ErrorMessage="Number of Licences must be greater than or equal to the number of SA Licences">
</asp:CustomValidator>

The Javascript to perform the validation is in a linked script file within a RadScriptBlock:

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
    <script src="../Scripts/EditValidation.js" type="text/javascript"></script>
 
</telerik:RadScriptBlock>

and which contains this validation function:

function ntbQty_FieldValidate(sender, args) {
    var ntbQtySA = $find("<%= ntbQtySA.ClientID %>");
    var rtbProductGroup = $find("<%= rtbProductGroup.ClientID %>");
 
    if (rtbProductGroup.get_value().toUpperCase() != "CONSULTANCY") {
        if (sender.get_value() < ntbQtySA.get_value()) {
            args.isValid = false;
    }
}

 

I have a break a the 'if' statement in FireBug and this is hit so I know the script is being executed but when I look at the 2 vars 'ntnQtySA' and 'rtbProductGroup' both are null.

 

There's probably a simple solution bu as I said, my JavaScript is very basic currently.

Thanks,

Kyle

CP
Top achievements
Rank 1
Iron
 answered on 04 Oct 2016
3 answers
234 views
Hi,

I don't believe the equation editor is included within the RadEditor for MOSS.

Will it be a new add-on feature in the future?

thanks,
Vincent
Sneha
Top achievements
Rank 1
 answered on 04 Oct 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?