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

How do i do a multiple if condition on a button text property?

This is my sample code and i could not get it to work.

Text='<%# If(Eval("status") = "Yes", "OK", else If(Eval("status") = "Pending", "Pending", "No"))%>'

Thanks a lot
Danail Vasilev
Telerik team
 answered on 26 Feb 2015
3 answers
89 views
Hi

This is my code (in a with statement)

.DayStartTime = cfg.DayStartTime
.DayEndTime = cfg.DayEndTime
.WorkDayStartTime = cfg.DayStartTime
.WorkDayEndTime = cfg.DayEndTime

Both cfg.DayStartTime and cfg.DayEndTime are Timespans

The .DayStartTime works as expected, but the .DayEndTime always shows 1800.

I currently have this in a function that gets the data in the PageLoad, but I have tried it in the OnPreRender and neither works the Scheduler defaults to 0800 & 1800.

Andy
Boyan Dimitrov
Telerik team
 answered on 26 Feb 2015
1 answer
108 views
I am added RadTreeNodes directly to the control. They are added like this...

new RadTreeNode(item.Name, item.Path)
{
    ImageUrl = GetNodeImage(item.TypeName),
    ToolTip = item.Name,
    PostBack = false
}
I added PostBack and in the past NavigateUrl = "#", but with no result. The message telling me that an attempt to navigate away is happening in Chrome. As a side note, if I do ever click on the "Ok" button nothing happens.
Ivan Danchev
Telerik team
 answered on 26 Feb 2015
3 answers
110 views
Hi,

I having trouble getting a Combobox to display its checked items when the page first loads.

There is enough space to fit all the items but it still reverts to the "# items checked". If I were to uncheck and then recheck one of the items, the items are displayed correctly. It is only when the page initially loads that the combobox only shows how many are checked, even when there is ample room.

Is there any way to force display of items when the page loads, but still reverts back to the number of items checked with the space is filled?

Any help is greatly appreciated,
Thanks.

Aneliya Petkova
Telerik team
 answered on 26 Feb 2015
1 answer
104 views
i want Grid DataSource When changes Context Menu Change Server-Side....

how to??

​
Eyup
Telerik team
 answered on 26 Feb 2015
3 answers
122 views
Hello,

This afternoon, I have been working with Visual Studio 2010 and Telerik controls.

My windows 8.1 computer suddenly became rather unstable - this normally happens when there are Windows Updates to be applied.
So I rebooted the machine and allowed the updates to be installed.

Since doing this, Telerik control databinds have become INCREDIBLY slow. For example, the following code:

DateTime startDate = new DateTime(viewDateStart.Year, viewDateStart.Month, 1);
DateTime endDate = startDate.AddMonths(1);

while ((int)startDate.DayOfWeek != 1) startDate = startDate.AddDays(-1);        // 0 = sunday
while ((int)endDate.DayOfWeek != 0) endDate = endDate.AddDays(1);               // 0 = sunday

while (startDate <= endDate) {
       dayList.Add(startDate);
       startDate = startDate.AddDays(7);
}

rptCalendar.DataSource = dayList;
rptCalendar.DataBind();

At the point of the data bind, the dayList item only contains 5 records. It takes a good 5 to 10 seconds to step over the DataBind() statement.

Similarly, RadGrid is also taking inordinate amounts of time to DataBind(). The data in this instance comes from a Linq call, but this too is virtually instant.

It seems that a Windows update has somehow crippled Telerik control data binding.

Has anyone heard of this happening ?



Eyup
Telerik team
 answered on 26 Feb 2015
1 answer
84 views
Hello,
I have EditMode="Batch". In the grid I have a template column. In EditItemTemplate there is a RadComboBox.
I would like to add RadComboBoxItems to the RadComboBox. How do I find the RadComboBox in EditItemTemplate server side?
Eyup
Telerik team
 answered on 26 Feb 2015
1 answer
162 views
I am adding a tree of RadTreeNodes directly to the control and when node is click it attempts to navigate.

new RadTreeNode(item.Name, item.Path)
{
    ImageUrl = GetNodeImage(item.TypeName),
    ToolTip = item.Name,
    PostBack = false
}

I attempted setting PostBack to false, and in the past setting NavigateUrl to "#" based on another thread. These have no yielding any help to prevent the message (that I know at least shows in Chrome).
Ivan Danchev
Telerik team
 answered on 25 Feb 2015
1 answer
164 views
Hi,

I want to disable the following properties
AllowInsert
AllowEdit
AllowDelete

However, I have got a grid where you can take the appointments and drop onto the scheduler control. Therefore, I have to enable some properties to succeed the action.  Any possible way to disable them meanwhile able to use the drag and drop option ?
Thank you
Nencho
Telerik team
 answered on 25 Feb 2015
2 answers
244 views
I can't seem to get my detail table to load properly. I am using the NeedDataSource and DetailTableDataBind events and entity framework.
The main grid loads as expected after the NeedDataSource event, and in the DetailTableDataBind I can see at least one item in the list being set as the datasource. 
However after clicking to expand the row, the detail table shows no results.


        <telerik:RadGrid ID="StarTranPIsGrid" runat="server" AutoGenerateColumns="false" 
                OnNeedDataSource="StarTranPIsGrid_NeedDataSource"  OnDetailTableDataBind="StarTranPIsGrid_DetailTableDataBind" >
             <MasterTableView DataKeyNames="ID" HierarchyLoadMode="ServerBind" EnableHierarchyExpandAll="true">
                <Columns> 
                    <telerik:GridBoundColumn UniqueName="ID" DataField="ID" Visible="false" />
                    <telerik:GridBoundColumn UniqueName="InvoiceNumber" DataField="InvoiceNumber" HeaderText="Invoice Number" />
                    <telerik:GridBoundColumn UniqueName="ShipDate" DataField="ShipDate" HeaderText="Ship Date" />
                </Columns>
                 <DetailTables>
                     <telerik:GridTableView DataKeyNames="StarTranPIID, SequenceNum">
                         <DetailItemTemplate>
                             <telerik:GridTableView DataKeyNames="StarTranID,SequenceNum" Width="100%" runat="server">
                                 <Columns>
                                    <telerik:GridBoundColumn UniqueName="PartNumber" DataField="PartNumber" HeaderText="Part Number" />
                                    <telerik:GridBoundColumn UniqueName="OrderNumber" DataField="OrderNumber" HeaderText="Order Number" />
                                    <telerik:GridBoundColumn UniqueName="QtyOrder" DataField="QtyOrder" HeaderText="Qty Order" />
                                    <telerik:GridBoundColumn UniqueName="QtyShip" DataField="QtyShip" HeaderText="Qty Ship" />
                                    <telerik:GridBoundColumn UniqueName="ReferenceNumber" DataField="ReferenceNumber" HeaderText="Reference Number" />
                                    <telerik:GridBoundColumn UniqueName="ShipmentNumber" DataField="ShipmentNumber" HeaderText="ShipmentNumber" />
                                 </Columns>
                             </telerik:GridTableView>
                         </DetailItemTemplate>
                     </telerik:GridTableView>
                 </DetailTables>
            </MasterTableView>
        </telerik:RadGrid>


    protected void StarTranPIsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        int ID = (int)Session["ShipperDetailsID"];
        StarTran Transaction = context.StarTrans.FirstOrDefault(s => s.ID == ID);
        if (Transaction != null)
            StarTranPIsGrid.DataSource = Transaction.StarTranPIs.ToList();
    }

    protected void StarTranPIsGrid_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
    {
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
        int ID = (int)dataItem.GetDataKeyValue("ID");

        List<StarTranPIPart> children = context.StarTranPIs.First(t => t.ID == ID).StarTranPIParts.ToList();
        e.DetailTableView.DataSource = children; //children contains at least one item!
    }


I've been following the demos and documentation:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/programmatic-hierarchy/defaultcs.aspx
http://www.telerik.com/help/aspnet-ajax/grid-binding-hierarchical-grids.html
http://www.telerik.com/help/aspnet-ajax/grid-hierarchical-data-binding-using-detailtabledatabind.html


Can anyone provide any insight into what I am missing to get my details table to populate?
Viktor Tachev
Telerik team
 answered on 25 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?