Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
179 views

Hi,

 How can I set the height using CSS?

 

<telerik:RadListBox runat="server" ID="rlb" CssClass="height40" ><Items><telerik:RadListBoxItem Text="1" /><telerik:RadListBoxItem Text="2" /><telerik:RadListBoxItem Text="3" /><telerik:RadListBoxItem Text="4" /><telerik:RadListBoxItem Text="5" /><telerik:RadListBoxItem Text="6" /><telerik:RadListBoxItem Text="7" /></Items>     </telerik:RadListBox>

Eyup
Telerik team
 answered on 10 Aug 2015
1 answer
136 views

Hey there,
I'm currently facing following problem:
On an ASP.NET page there is a RadGrid that gets filled on client-side using a SignalR connection.
The databinding is done like this:

var table = $find('blablatableid');
var tableView = table.get_masterTableView();
tableView.set_dataSource(viewModels);
tableView.dataBind();

The grid is filled and the data is displayed correctly. 

During a postback caused by a button click I need to access the data in the server-side code but the grid seems to be empty. The grid doesn't have a datasource and the ItemsCollection is empty. Did I forget something or is this scenario not supported?

 

Best regards,

 

Christian

Angel Petrov
Telerik team
 answered on 10 Aug 2015
1 answer
188 views

I know this has been discussed multiple times in the forum, but unfortunately I was unable to find a solution that was working for me.  So here it is again.  Please someone help! :)

 Here is the code 

<AxnGrids:AxnGrid AllowMultiRowSelection="False" AllowRowClickEventPropagation="True" AllowSorting="True" AutoGenerateColumns="False" 
EnableEmbeddedSkins="False" EnableViewState="True" Height="100%" ID="TimeCardsGrid" InitialResizeToFit="True" 
OnItemDataBound="TimeCardsGrid_OnItemDataBound" OnNeedDataSource="TimeCardsGrid_OnNeedDataSource" runat="server" Skin="TMW_v1" 
TabIndex="-1">
<MasterTableView EditMode="EditForms" AllowMultiColumnSorting="True" TableLayout="Auto" EnableColumnsViewState="True" EnableViewState="True" >
<Columns>
<%-- columns returned: empid, emptimeid, startdate, enddate, status, empdrvid, approved --%>
<telerik:GridBoundColumn DataField="TimecardId" HeaderText="Timecard" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="100px" />
<telerik:GridBoundColumn DataField="StartDate" HeaderText="Start Date" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="100px" />
<telerik:GridBoundColumn DataField="EndDate" HeaderText="End Date" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="100px" />
<telerik:GridBoundColumn DataField="Approved" HeaderText="Approved" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="100px" />
</Columns>
<SortExpressions>
<telerik:GridSortExpression FieldName="TimecardId" SortOrder="Descending" />
</SortExpressions>
</MasterTableView>
<ClientSettings>
<ClientEvents OnGridCreating="FixGridSizers" OnRowDblClick="raiseServerCommandRowDblClick" />
<Resizing AllowColumnResize="True" ClipCellContentOnResize="False" />
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="True" EnableVirtualScrollPaging="False" UseStaticHeaders="True" />
</ClientSettings>
</AxnGrids:AxnGrid>

When this is run, i get the error "An item with the same key has already been added".  if i comment out the line between the SortExpression, it works fine.

Any suggestions

Viktor Tachev
Telerik team
 answered on 10 Aug 2015
3 answers
712 views
Is it possible to disable somehow the css class from a control?
Angel Petrov
Telerik team
 answered on 10 Aug 2015
2 answers
129 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
207 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
112 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
551 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
362 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
104 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
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?