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

Hi,

I've seen this use of the template which styles each tab - http://demos.telerik.com/aspnet-ajax/tabstrip/examples/functionality/server-templates/defaultcs.aspx

 Is there a way to have a specific tab that contains a radbutton?

 

thank you

david
Top achievements
Rank 1
 answered on 08 Aug 2015
5 answers
175 views
Hi Telerik,

This looks to be a fairly straight forward thing, be I cannot seem to detect which Arrow (To Right or To Left) have been clicked on the OnTransferred event (server-side).

Here is some sample codes:
<telerik:RadListBox runat="server" ID="listBoxSourceOS" Height="200px" Width="230px"                                                    OnDropped="listBoxSourceOS_OnDropped" ButtonSettings-ShowTransferAll="false"                                                    EnableDragAndDrop="true" AutoPostBackOnTransfer="true" OnTransferred="ListBoxSourceOS_OnTransferred"                                                    AllowTransfer="true" TransferToID="listBoxDestinationOS">
</telerik:RadListBox>
 
<telerik:RadListBox TransferToID="listBoxSourceOS" Height="200px" ID="listBoxDestinationOS" AutoPostBackOnTransfer="true" AllowTransfer="true" runat="server" Width="230px" />

protected void ListBoxSourceOS_OnTransferred(object sender, RadListBoxTransferredEventArgs e)
        {
            //((Telerik.Web.UI.RadListBoxItem[])(e.Items))[0].Value
            if (e.Items != null)
            {
                //Insert new item
                //Refresh List
            }
        }


Based on the type of transfer, a delete or insert operation will the be carried out into the database, all in the code-behind page(server side)

Furthermore, this same scenario will be applied for the OnDropped events.

Thanks
Josef Rogovsky
Top achievements
Rank 2
 answered on 07 Aug 2015
1 answer
88 views

I know that I can localize the GridHeaders like the below

 

Protected Sub MyGrid_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles MyGrid.ItemCreated​

  If TypeOf e.Item Is GridHeaderItem Then
    Dim headerItem As GridHeaderItem = CType(e.Item, GridHeaderItem)

    Dim header As GridHeaderItem = CType(e.Item, GridHeaderItem)

    header.Cells(9).Text = Resources.PageLocalizations.GridHeaderApp
    header("Active").Text = Resources.PageLocalizations.GridHeaderActive​

  End If

End Sub

 

But the headers in Insert/edit mode doesn't get changed when using EditMode="PopUp"

Anyone knows how to edit the headers there?

 

Best Regards Pelle

Eyup
Telerik team
 answered on 07 Aug 2015
1 answer
487 views

I'd much rather comment out a Telerik line in HTML than remove it.  Using <!-- --> yields an error.  Is this this possible?

    <telerik:RadGrid ID="Dashboard_RadGrid"
        AutoGenerateColumns="false"
        AllowPaging="true"
        OnNeedDataSource="Dashboard_NeedDataSource"
        OnItemDataBound="Dashboard_ItemDataBound"
        OnItemCommand="Dashboard_ItemCommand"
        PageSize="20"
        EnableViewState="true"
        SelectedItemStyle-CssClass="MeasuredResultsDetail"
        runat="server" >
        <ClientSettings EnableRowHoverStyle="true"
                        EnablePostBackOnRowClick="true" >
 
        <MasterTableView DataKeyNames="Build.ID, BuildResult.ID" Name="TableMain" >
            <Columns>
                <telerik:GridBoundColumn DataField="Build.BuildNumber" HeaderText="Build Number" HeaderStyle-Width="120px" />
                <telerik:GridBoundColumn DataField="BuildResult.CreationDate" HeaderText="Date" HeaderStyle-Width="140px" DataFormatString="<nobr>{0}</nobr>" />
 
<!--
                    <telerik:GridBoundColumn DataField="BuildResult.EvaluatorResultsErrorLevel" HeaderText="Full" HeaderStyle-Width="80px" />
    -->
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
 

 

 

Eyup
Telerik team
 answered on 07 Aug 2015
9 answers
310 views

hey

im using advanced databinding with data from sql db.

so i have this code that when a column (files recieved) is sorted, i highlight rows that a month has passed since the since it was created, files were received but still it was not processed (to alert users). I had the idea i will add an unbound column, and assign it a priority number for the rows that are highlighted. There will be different priority for different "rules", so i could have some rows highlighted red with priority 1, while some are yellow with priority 2. now when this happens i want to create a default sort, before any other sorts are applied, that the rows with highest priority will show up first.

so thats the jist of what im trying to do. i know the regular sort wont work because the item is not bound, so its not a dataitem. what i tried to do was on the onneeddatasource event, after i have my datatable, i apply the sort by priority on the dataview of the datatable (the datatable does have the column with priority with the proper values). This seems to work as the datatable i assign as the datasource for the grid does show up in the exact order it should, priority items first. But i see that the other sort expressions of other columns are not yet applied, this leads me to believe that the datasource gets sorted after the event, overwriting the manual sort i applied. 

is there an event i should override where i can plug in my manual sort? or maybe someone has a better idea how to implement the functionality im looking to achieve? here is the relevant code:

protected void rgListingsReport_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
if ((HttpContext.Current.Cache["data"] == null )
            {
// gets datatable from sql
}​
 else
            {
                _dtReportsSource = (DataTable)HttpContext.Current.Cache["data"];
            } 
            if (_dtReportsSource != null)
            {
                if (doSort) //true when there are rows with priority
                {
                    _dtReportsSource.DefaultView.Sort = "NoticePriority DESC";
                    _dtReportsSource = _dtReportsSource.DefaultView.ToTable();
                    rgListingsReport.DataSource = _dtReportsSource;
                }
                else
                {
                    rgListingsReport.DataSource = _dtReportsSource;
                }
            }
}
​

on the item databound event i set the priority values for the rows and datatable stored in cache

if (rowColor == Color.Red)
                {
                    dataBoundItem["NoticePriority"].Text = "1";
                    (HttpContext.Current.Cache["data"] as DataTable).Rows[e.Item.RowIndex]["NoticePriority"] = "1";
                }
                else
                {
                    dataBoundItem["rowindex"].Text = "0";
                    dataBoundItem["NoticePriority"].Text = "0";
                }

Eyup
Telerik team
 answered on 07 Aug 2015
1 answer
73 views
By default the label appears to the left of the control. Without having to create a template edit form, how can I position the label on top of the control?
Eyup
Telerik team
 answered on 07 Aug 2015
6 answers
309 views
If a particular filter operation does not yield any results, we would like to be able to set focus on the last filter field that the user put data into. For example, suppose I have a "Status" column with options of "All","Active","Inactive". If a user picks "Inactive" and there are no records matching that criteria I would like to set focus on the filter control for the "Status" column.

I may just be missing something obvious, but I'm not having luck with this so far.

Thank you!
Eyup
Telerik team
 answered on 07 Aug 2015
1 answer
160 views

 I'm trying to add JavaScript to allow users to select today's date by pressing "T" key.  I've copied the following code from elsewhere in this forum.  Sorry, I cannot find original post.   The below code does exactly what what we want except the t is showing up in the text.  For example, "8/4/2015t" is what is being displayed.  

 Is there a way to prevent key press from being propagated?  Below is demo code that I'm working with.

<telerik:RadDatePicker ID="DatePicker1" runat="server" >
     <DateInput ClientEvents-OnKeyPress="DateTextBoxKeyPress"/>
</telerik:RadDatePicker>

 

function DateTextBoxKeyPress(sender, args) {
 
    var s1 = args.get_keyCharacter().toUpperCase();
 
    if (s1 === "T") {
 
        var datePicker = sender;
        var date = new Date();
 
        date.setDate(date.getDate());
        datePicker.set_selectedDate(date);
    }
}

Eyup
Telerik team
 answered on 07 Aug 2015
1 answer
313 views
Telerik Team,

We are using telerik rad grid and have implemented custom paging on it. Hence grid maintains page index while filtering and sorting. Now the issue is say for example page size is 50 and we have 150 records the three page will appear. Now if user go to page number 3 and filters any column which returns only 1 records. Obviously when grid rebinds it will only have one page. One page number shows on the grid. But grid shows no records. Now if I click on page number 1, of course it shows records.

I checked by debugging, in this case PageCount property shows 1 which is less than the out CurrentPageIndex.

How do we dynamically reset the page number from code behind. We don't want to always set page index to 0. Hope this makes sense. Thank you.

Pathan  L.
Rahul
Top achievements
Rank 1
 answered on 07 Aug 2015
3 answers
239 views

As of Q2 2015 SP1 the popup element of RadToolTip cannot be shown if the content is empty. This is a result of an important improvement—http://feedback.telerik.com/Project/108/Feedback/Details/54180.

This change will affect implementation where content of tooltip is populated via the OnClientShow event. The proper usage is handling the OnClientBeforeShow event in order for the tooltip to show up.

You can also examine this online demo (http://demos.telerik.com/aspnet-ajax/tooltip/examples/databasetooltipswithoutlod/defaultcs.aspx) to further see such an implementation.

Geoff
Top achievements
Rank 1
 answered on 07 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?