Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
91 views
When you select a document in the document manager, the preview panel populates and the Insert button enables.  If you then delete the selected document, the data in the preview panel remains, and the Insert button is still enabled.  If the user clicks Insert, then a link is created to the document that was just deleted.

Is there a way to reset the preview panel, after the document is deleted?

Thanks!
Dave
Vessy
Telerik team
 answered on 22 Apr 2013
4 answers
149 views
I have the following Setup

TabStrip 1
TabStrip 2

TabStrip A
TabStrip B

If I click on a Tab in TabStrip 1 I populete TabStrip A + B
If I click on a Tab in TabStrip 2 I populate TabStrip A + B 

Now when I click on a Tab off TabStrip A or B I need to know if TabStrip 1 or TabStrip 2 populated the Tabstrips A + B

---------------

Kind of  hard to explain.

Look here to understand: http://uebersetzung.gebetsanliegen.ch/en/verse/default.aspx

Left side bible books of Old Testament. If I click a book 1. Mose (Genesis) I populate TabStrip A with the available chapters and TabStrip B with the available verses in that chapter.

Right side bible books of the New Testament. If i click on book Matthäus (Mathew)  I populate TabStrip A with the available chapters and TabStrip B with the available verses in that chapter.

Now the problem is that when I click on a verse from TabStrip B - I need to know which TabStrip was used to populate (Old or New Testament)

I could have TabStrips C + D and show hide when either TabStrip 1 or 2 is clicked but would like to have simple.

Any idea how to have this done (all Ajax)

Markus
Kate
Telerik team
 answered on 22 Apr 2013
1 answer
143 views
hey Guys - i've got a bit of a head scratcher here. i've got a combobox on a grid. i bind it on item databind. if the box comes up empty - no problem - you just click and it'll go get the list and fires the server method: OnItemsRequested.

the weird part is - if the combobox has data in it - it doesn't fire the OnItemsRequested event, but i can clear out the contents and it fires just fine.
is there something i'm missing here? it's got to be something simple. i've included partial markup for the grid - the databind method & the combobox method.
any help is totally appreciated.
thanks
rik

RAD GRID MARKUP:::

 

<telerik:RadGrid ID="WorkOrderItemsRadGrid" runat="server" AllowPaging="true" AutoGenerateColumns="false"

                        Skin="WebBlue" PageSize="8" EnableTheming="false" AllowFilteringByColumn="false" AllowCustomPaging="false"

                        OnItemDataBound="WorkOrderItemsRadGrid_ItemDataBound" OnNeedDataSource="WorkOrderItemsRadGrid_NeedDataSource"

                        Width="100%" OnItemCreated="WorkOrderItemsRadGrid_ItemCreated" AllowMultiRowSelection="true">

                        <GroupingSettings CaseSensitive="false" />

                        <PagerStyle Mode="NextPrevAndNumeric" />

                        <MasterTableView DataKeyNames="WORKORDERNUMBER,LOCATIONID,WORKORDERID,WORKORDERDETAILID,WOTYPENAME,LASTUPDATED,RACKNUMBER,LASTUPDATEDBY,MATERIALTYPE,MATERIALTYPEID,MATERIALDESCRIPTION"

                         CommandItemSettings-ShowAddNewRecordButton="false" EditMode="PopUp" CommandItemDisplay="Top"

                        AllowSorting="true" CommandItemSettings-RefreshText="Refresh" CommandItemSettings-RefreshImageUrl="~/App_Themes/GOLD Main/ToolBar/refresh_16x16.gif" >

                            <HeaderStyle HorizontalAlign="Left" />

                            <Columns>

                                <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="100px" UniqueName="RackNumberColumn"

                                    ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="Rack">

                                    <ItemTemplate>

                                        <telerik:RadComboBox ID="RackNumberGridComboBox" runat="server" Width="90px" Height="160px"

                                            Skin="WebBlue" EnableLoadOnDemand="true" AutoPostBack="true" OnItemsRequested="RackNumberGridComboBox_ItemsRequested"

                                            AllowCustomText="false" HighlightTemplatedItems="true" DataValueField="RACKID"

                                            DataTextField="RACKNUMBER" DropDownWidth="210px">

                                            <HeaderTemplate>

                                                <ul class="woCustomerDropDown" style="width: 180px;">

                                                    <li class="woCustomerCol" style="width: 120px;">Rack Number</li>

                                                    <li class="woCustomerCol" style="width: 60px;">Utilization</li>

                                                </ul>

                                            </HeaderTemplate>

                                            <ItemTemplate>

                                                <ul class="woCustomerDropDown" style="width: 180px;">

                                                    <li class="woCustomerCol" style="width: 120px;">

                                                        <%# DataBinder.Eval(Container.DataItem, "RACKNUMBER") %></li>

                                                    <li class="woCustomerCol" style="width: 60px;">

                                                        <%# DataBinder.Eval(Container.DataItem, "UTILIZATION") %></li>

                                                </ul>

                                            </ItemTemplate>

                                        </telerik:RadComboBox>

                                    </ItemTemplate>

                                </telerik:GridTemplateColumn>

                                <telerik:GridBoundColumn DataField="WORKORDERITEMDISPLAY" HeaderText="Work Order"

                                    HeaderStyle-Width="80px" FilterControlWidth="60px" />

                               

                            </Columns>

                        </MasterTableView>

                    </telerik:RadGrid>

RAD GRID DATABIND:

protected void WorkOrderItemsRadGrid_ItemDataBound(object sender, GridItemEventArgs e)

        {

            GridCommandItem cmndItem = (GridCommandItem)WorkOrderItemsRadGrid.MasterTableView.GetItems(GridItemType.CommandItem)[0];

            LinkButton btn = (LinkButton)cmndItem.FindControl("RebindGridButton");

            ((System.Web.UI.WebControls.TableCell)(btn.Parent)).HorizontalAlign = HorizontalAlign.Left;

 

            if (e.Item is GridDataItem)

            {

                GridDataItem boundItem = (GridDataItem)e.Item;

                string wonumber = Convert.ToString(boundItem.OwnerTableView.DataKeyValues[boundItem.ItemIndex]["WORKORDERNUMBER"]);

                string woid = Convert.ToString(boundItem.OwnerTableView.DataKeyValues[boundItem.ItemIndex]["WORKORDERID"]);

                string locationid = Convert.ToString(boundItem.OwnerTableView.DataKeyValues[boundItem.ItemIndex]["LOCATIONID"]);

                string wodetailid = Convert.ToString(boundItem.OwnerTableView.DataKeyValues[boundItem.ItemIndex]["WORKORDERDETAILID"]);

                string lastracknumber = Convert.ToString(boundItem.OwnerTableView.DataKeyValues[boundItem.ItemIndex]["RACKNUMBER"]);

                string lastrackid = Convert.ToString(boundItem.OwnerTableView.DataKeyValues[boundItem.ItemIndex]["RACKID"]);

                string lastupdate = Convert.ToString(boundItem.OwnerTableView.DataKeyValues[boundItem.ItemIndex]["LASTUPDATED"]);

                string lastupdateby = Convert.ToString(boundItem.OwnerTableView.DataKeyValues[boundItem.ItemIndex]["LASTUPDATEDBY"]);

                int materialtypeid = Convert.ToInt32(boundItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["MATERIALTYPEID"]);

                string materialdesc = boundItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["MATERIALDESCRIPTION"].ToString();

 

                if (lastracknumber != "")

                {

             RadComboBox rackBox = boundItem.FindControl("RackNumberGridComboBox") as RadComboBox;

 

                    using (TruckingBC tbc = new TruckingBC())

                    {

rackBox.DataSource = tbc.GetRackNumbers(DivisionID,lastracknumber);

                          rackBox.DataBind();

                                            }

                }

 

        }

 

 

 

COMBO BOX ON GRID EVENTS:

 

 

protected void RackNumberGridComboBox_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)

        {

            RadComboBox comboBox = (RadComboBox)sender;

            using (TruckingBC tbc = new TruckingBC())

            {

                comboBox.DataSource = tbc.GetRackNumbers(DivisionID);

                comboBox.DataBind();

            }

        }

 

 

Hristo Valyavicharski
Telerik team
 answered on 22 Apr 2013
3 answers
271 views

Hello,

I am attempting to display the appointments created by a radscheduler on the radcalendar (simply by highlighting the day on the calendar and populating the tooltip). It appears that there is no clear way to integrate the scheduler with the calendar. The reason this is difficult is because of the recurring requests. The radscheduler receives a pattern and does all the work for you. To highlight the days on a radcalendar, I don't want to have to parse the pattern myself. My idea was...to create an invisible radscheduler, populate it, and in some appointment rendering event, create a list of appointments to display in the calendar. So far my problem is, I can't find the right event...radSched_AppointmentDataBound does not fire for every appointment in a recurrence, just the first run. Below is an example of what I was attempting in the AppointmentDataBound event.

protected void radSched_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            RadCalendarDay rcd = new RadCalendarDay();
            CalendarEventItems cei;
              
            rcd.Date = e.Appointment.Start;
            rcd.ToolTip = e.Appointment.Subject;
            rcd.ItemStyle.BackColor = System.Drawing.Color.Red;
  
            if (DateTime.Now < rcd.Date)
            {
                cei = new CalendarEventItems();
                cei.EventStartDateTime = e.Appointment.Start;
                cei.EventName = e.Appointment.Subject;
                cei.EventEndDateTime = e.Appointment.End;
                cei.EventDescription = e.Appointment.Description;
                lsUpcomingEvents.Add(cei);
            }
  
            radCal.SpecialDays.Add(rcd);
        }


Is there a different event or strategy I can use to grab each appointment for a given month? Is there some other way I can integrate the radscheduler into a radcalendar? Somebody else has had to have had this idea before...

Markus
Top achievements
Rank 2
 answered on 22 Apr 2013
2 answers
219 views
I am converting an app to RadGrid controls, and I would like advice on the best way to convert some code that I had running in a DataGrid's RowDataBound event:
Private Sub gvAvailableTasks_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvAvailableTasks.RowDataBound
 
        If Not gvAvailableTasks.SelectedRow Is Nothing Then
            If gvAvailableTasks.SelectedRow.ID = e.Row.ID Then
                Exit Sub
            End If
        End If
 
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim dd As DateTime
            dd = CType(e.Row.Cells(6).Text, DateTime)
 
            If dd < Date.Now Then
                e.Row.Cells(6).BackColor = Drawing.Color.Red
            Else
 
                If DateDiff(DateInterval.Hour, Date.Now, dd) < 5 Then
                    e.Row.Cells(6).BackColor = Drawing.Color.Orange
                ElseIf DateDiff(DateInterval.Hour, Date.Now, dd) < 9 Then
                    e.Row.Cells(6).BackColor = Drawing.Color.Yellow
                End If
            End If
 
            ' Alert message
 
            Dim s As String = e.Row.Cells(5).Text
 
            If s.Trim <> " " And s.Trim <> "" Then
                e.Row.Cells(5).BackColor = Drawing.Color.Yellow
            End If
 
        End If
    End Sub

Basically the code changes the color of the due date to let the user know what is late. The last bit changes the background color if an alert message exists.

Thanks for your help!
David
Top achievements
Rank 1
 answered on 22 Apr 2013
3 answers
242 views
Hello,
In my code in Radgrid_Init I am declaring detailTables by:

                    GridTableView tableViewLevel = new GridTableView(Radgrid);
                    tableViewLevel.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand;
                    tableViewLevel.AutoGenerateColumns = false;

                    Radgrid.MasterTableView.DetailTables.Add(tableViewLevel);

so I can open DetailTables (I have image in first column).

Then on Radgrid_DetailTableDataBind I'm clearing data by:

            Radgrid.MasterTableView.DetailTables.Clear();

and again declaring:

            GridTableView tableViewLevel = new GridTableView(Radgrid);
            tableViewLevel.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand;
            tableViewLevel.AutoGenerateColumns = false;

and then declaring some columns headers for my detailTable and adding them:

            Radgrid.MasterTableView.DetailTables.Add(tableViewLevel);

after that I have some operations to get table from SQL and I'm setting dataSource by:

                e.DetailTableView.DataSource = table;

I think this should work, however I'm getting empty DetailTables in the view. When I set property AutoGenerateColumns to true data appers.

Any idea what I'm doing wrong?

I should add that I want to dynamically set columns in Radgrid_DetailTableDataBind, because there are more than 1 Detailtable linked to 1 row in Mastertable. In Radgrid_DetailTableDataBind i'm checking which one was selected (in tooltip linked to expand/collapse imapge) and setting the right sql table. When every detailtable was declared in Radgrid_Init there was several request to Radgrid_DetailTableDataBind and Grid was working slow.
Elliott
Top achievements
Rank 2
 answered on 22 Apr 2013
0 answers
72 views
Hi,

I would like to have this:
One grid that shows search results. On clientClick it opens, under row, user control that will be filled with current data for selected row. User can make changes, save .... It should all be on a client and comunicate via web services.

Is there any example for that?
Petar
Top achievements
Rank 1
 asked on 22 Apr 2013
2 answers
87 views
Hi all,
          we have recently upgraded one of our product from version 2008 to version 2012 to use cdn feature of radscript manager and radstylesheetmanager. Its working fine except the layout of the page is quite different. What is the correct approach to make it look exactly the same ? Thanks.

Regards
Kris
Top achievements
Rank 1
 answered on 22 Apr 2013
1 answer
126 views
Dear Telerik Technical Team,

I'm using the OrgChart control to display organization chart. Furthermore, I used toolstip to mouse-over objects to view more information of each object. 

I would like to enquire if OrgChart control is able to display the relationship (i.e. boss of, brother of, sibling of) along the "line/arrrow" which links between the entities? Thank you. 

Best Regards
William 
Plamen
Telerik team
 answered on 22 Apr 2013
5 answers
259 views
I'm using a Rad Scheduler. Setting the datasource through programming. In the appointment template I've defined 5 labels. For each day the appointment template would carry these 5 labels. However there will be difference in the data it carries and the formatting of the labels too will be different for different criteria. I'm able to get/set the data, but not able to do the formatting.
Given below is the aspx syntax.

 


 

<telerik:RadScheduler ID="RadScheduler2" runat="server" DataEndField="DutyEnd"   
 
DataKeyField="Id" DataStartField="DutyStart" CustomAttributeNames="HoursPerDay" 
 
DataSubjectField="Date"   
 
onappointmentcommand="RadScheduler2_AppointmentCommand"   
 
onappointmentdatabound="RadScheduler2_AppointmentDataBound"   
 
onformcreated="RadScheduler2_FormCreated">  
 
<AppointmentTemplate> 
 
<asp:Label Text='<%# Bind("HoursPerDay") %>' runat="server" ID="lblTest"></asp:Label><br /> 
 
<asp:Label Text="This is a test2" runat="server" ID="Label8"></asp:Label><br /> 
 
<asp:Label Text="This is a test3" runat="server" ID="Label9"></asp:Label><br /> 
 
<asp:Label Text="This is a test4" runat="server" ID="Label10"></asp:Label><br /> 
 
<asp:Label Text="This is a test5" runat="server" ID="Label11"></asp:Label><br /> 
 
</AppointmentTemplate> 
 
</telerik:RadScheduler> 
 
 

On code behind I'm able to set the value as shown below. 

 

protected void RadScheduler2_AppointmentDataBound(object sender, SchedulerEventArgs e)  
        {  
e.Appointment.Attributes["HoursPerDay"] = "Value from DB";  
} 

However In addition to this I would like to do formatting on the labels based on certain criteria. For example for the label "lblTest" need to set the font color to Red, set the visible property of the label to "true/false", etc............. Basically I need a way to find out the control within the appointment template.

I'm unable to do this. Appreciate if some one could let me know how to achieve this (please provide with some code sample)

Thank you.

Plamen
Telerik team
 answered on 22 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?