Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
97 views
Hello all

Any help appreciated with the issue I'm having.  
I have a basic ASP.NET page where I have a RadScheduler.  
From the same page, I am popping up a RadWindow to save an item to the database.  

From the RadWindow server side code I am closing the RadWindow and saving items to my database and setting the "SelectedDate" of the RadScheduler from a RadDateTimePicker on the popup window.  Unfortunately, the RadScheduler doesn't change the month.

Any help or suggestions would be appreciated.  Thank you.

Source
<telerik:RadScriptBlock runat="server" ID="scbEdit">
    <script type="text/javascript">
        var oWnd = null;
 
        function btnCancel_Click(button, args) {
            oWnd.Close();
        }
         
        function winAppt_ClientActivate(sender){
            oWnd = sender;
        }
 
        function CloseDialog() {
            oWnd.Close();
        }
    </script>
</telerik:RadScriptBlock>
<div style="border-top: 1px solid #4CA5FF; border-bottom: 1px solid #4CA5FF; background-color: #D6F4FF; width: 100%;">
    <span style="font-size: 2pt;">
        <br />
         </span>
    <asp:Label ID="lblCompanyName" runat="server" CssClass="orangelargebbold" />
    <span style="font-size: 2pt;">
        <br />
         </span>
</div>
<div style="margin: 5px 3px 3px 0px; float: left; height: 1000px;">
    <tel:RadButton ID="btnNew" runat="server" Text="New Appointment" Skin="Web20" onclick="btnNew_Click" />
    <br /><br />
    <tel:RadWindow ID="winAppt" runat="server" EnableShadow="true" Title="New Appointment"
            Width="830px" Height="500px" Behaviors="Move, Close" VisibleStatusbar="false"
            Modal="true" Skin="Telerik" OnClientActivate="winAppt_ClientActivate">
        <ContentTemplate>
            <tel:RadAjaxPanel ID="pnlAppt" runat="server">
                <table style="width: 780px; padding: 5px; margin: 5px;">
                    <tr>
                        <td valign="middle"><span class="blackmedbold">Category</span></td>
                        <td><tel:RadComboBox ID="cmbCategory" runat="server" DataValueField="CatID"
                                DataTextField="Description" AutoPostBack="true"
                                OnSelectedIndexChanged="cmbCategory_SelectedIndexChanged" /></td>
                    </tr>
                    <tr>
                        <td><span class="blackmedbold">Service</span></td>
                        <td>
                            <tel:RadComboBox ID="cmbService" runat="server" Height="200px" Width="200px"
                                DropDownWidth="298px" HighlightTemplatedItems="true" EnableLoadOnDemand="true"
                                EmptyMessage="Select a service..." DataValueField="Serv_Value"
                                DataTextField="Description"
                                onselectedindexchanged="cmbService_SelectedIndexChanged" AutoPostBack="true">
                                <HeaderTemplate>
                                    <table style="width: 300px; color:#0026FF;" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td style="width: 100px;">Description</td>
                                            <td style="width: 100px;">Duration</td>
                                            <td style="width: 100px;">Price</td>
                                        </tr>
                                    </table>
                                </HeaderTemplate
                                <ItemTemplate>
                                    <table style="width: 300px; color: Black; font-size: 8pt; font-weight: normal;" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td style="width: 100px;"><%# DataBinder.Eval(Container.DataItem, "Description") %></td>
                                            <td style="width: 100px;"><%# DataBinder.Eval(Container.DataItem, "Duration")%></td>
                                            <td style="width: 100px;"><%# DataBinder.Eval(Container.DataItem, "Unit_Price")%></td>
                                        </tr>
                                    </table>                                                       
                                </ItemTemplate>
                            </tel:RadComboBox>                                                                                   
                        </td>
                    </tr>
                    <tr>
                        <td><span class="blackmedbold">Appointment Date</span></td>
                        <td><tel:RadDateTimePicker ID="dtpStartsOn" runat="server" /></td>
                    </tr>
                    <tr>
                        <td><span class="blackmedbold">Duration</span></td>
                        <td><tel:RadTextBox ID="txtDuration" runat="server" /></td>
                    </tr>
                    <tr>
                        <td><span class="blackmedbold">Number of Guests</span></td>
                        <td>          
                            <tel:RadComboBox ID="cmbGuests" runat="server" AutoPostBack="true" onselectedindexchanged="cmbGuests_SelectedIndexChanged">
                                <Items>
                                    <tel:RadComboBoxItem Value="1" Text="1" />
                                    <tel:RadComboBoxItem Value="2" Text="2" />
                                    <tel:RadComboBoxItem Value="3" Text="3" />
                                    <tel:RadComboBoxItem Value="4" Text="4" />
                                </Items>
                            </tel:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <br />
                            <asp:PlaceHolder ID="pnlGuests" runat="server">
                                <spc:Guest ID="spcGuest1" runat="server" />
                                <spc:Guest ID="spcGuest2" runat="server" Visible="false" />
                                <spc:Guest ID="spcGuest3" runat="server" Visible="false" />
                                <spc:Guest ID="spcGuest4" runat="server" Visible="false" />
                            </asp:PlaceHolder>
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td><span class="blackmedbold">Notes</span></td>
                        <td><tel:RadTextBox ID="txtDescription" runat="server" TextMode="MultiLine" /></td>
                    </tr>
                    <tr>
                        <td><span class="blackmedbold">Reminder</span></td>
                        <td>
                            <tel:RadComboBox ID="cmbReminder" runat="server" EmptyMessage="Select Reminder">
                                <Items>
                                    <tel:RadComboBoxItem Value="1" Text="1 Day" />
                                    <tel:RadComboBoxItem Value="2" Text="2 Day" />
                                    <tel:RadComboBoxItem Value="3" Text="3 Day" />
                                    <tel:RadComboBoxItem Value="4" Text="4 Day" />
                                    <tel:RadComboBoxItem Value="5" Text="5 Day" />
                                    <tel:RadComboBoxItem Value="6" Text="6 Day" />
                                    <tel:RadComboBoxItem Value="7" Text="1 Week" />
                                    <tel:RadComboBoxItem Value="14" Text="2 Weeks" />
                                </Items>
                            </tel:RadComboBox>                   
                        </td>
                    </tr>
                </table>       
                <div style="text-align: right; padding: 5px; clear: both">               
                    <tel:RadButton ID="btnSubmit" runat="server" Text="Submit" Skin="Web20" OnClick="btnSubmit_Click" ></tel:RadButton>
                    <tel:RadButton ID="btnCancel" runat="server" Text="Cancel" Skin="Web20" OnClientClicked="btnCancel_Click"></tel:RadButton>
                </div>                           
            </tel:RadAjaxPanel>                     
        </ContentTemplate>
    </tel:RadWindow>        
    <tel:RadScheduler ID="schAppointments" runat="server" Width="1000px" Height="100%"
        SelectedView="MonthView" ShowFooter="false" DayStartTime="08:00:00"
        DayEndTime="21:00:00" WeekView-DayStartTime="08:00:00" WeekView-DayEndTime="21:00:00"
        FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableDescriptionField="true"
        AppointmentStyleMode="Default" DataKeyField="ApptID" DataSubjectField="Subject"
        DataStartField="Starts_On" DataEndField="Ends_On" DataDescriptionField="Description"
        AdvancedForm-Modal="true" StartInsertingInAdvancedForm="false" StartEditingInAdvancedForm="false"
        Reminders-Enabled="true" OnFormCreating="schAppointments_FormCreating" OverflowBehavior="Expand"
        >
         
        <AdvancedForm Modal="true" />
        <Reminders Enabled="true" />
        <TimeSlotContextMenuSettings EnableDefault="true" />
        <AppointmentContextMenuSettings EnableDefault="true" />           
    </tel:RadScheduler>
</div>
<div style="float: right; padding: 5px 3px;">
    <spc:VNav ID="spcNav" runat="server" />
</div>


Code Behind:
if (Appt.Save(Appointment.Xerialize()))
{
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Close", "CloseDialog();", true);                   
    dSet = Appt.ByMonth(Convert.ToInt64(Session["locid"].ToString()), dtpStartsOn.SelectedDate.Value.Month);
    schAppointments.DataSource = dSet;
    schAppointments.DataBind();
    schAppointments.SelectedDate = dtpStartsOn.SelectedDate.Value;
}
Peter
Telerik team
 answered on 14 Aug 2012
1 answer
135 views
How to localize RadDatePicker button (Today, Ok, Cancel) ?
Pls see the red circle in the attached file.
Eyup
Telerik team
 answered on 14 Aug 2012
9 answers
639 views

I must be doing something wrong.  I have a RadComboBox and it is showing the first item in the list bound to it vs. EmptyMessage.  Any help would be appreciated.  In the below example, I want the drop down to first display "Choose an Organization"  Instead, it is displaying the DataTextField (first item in data set).   Thanks in advance.

.ASCX Control

<strong>Organization:</strong><br />
<telerik:RadComboBox runat="server" ID="OrganizationList" 
EmptyMessage="Choose an Organization" EnableLoadOnDemand="true"
HighlightTemplatedItems="true" Width="600px" BackColor="#FFFFCC" 
DataTextField="Name" DataValueField="ContactId" OnItemsRequested="RadComboBox_LoadOrganizations">
        <ItemTemplate>
            <table style="width: 550px;">
                <tr>
                    <td><%# DataBinder.Eval(Container.DataItem, "Name") %></td>
                </tr>
              
            </table>
        </ItemTemplate>   
</telerik:RadComboBox>

.ASCX.CS Code Behind
protected void RadComboBox_LoadOrganizations(object sender, RadComboBoxItemsRequestedEventArgs e)
{
    int userID;
    userID = Convert.ToInt32(Server.HtmlEncode(Request.QueryString["UID"]));
    OrgView.ContactLookup[] orglist = orgData.GetAssociatedContactsLookupList(userID);
    OrganizationList.DataSource = orglist;
    OrganizationList.DataBind();
}

Ivana
Telerik team
 answered on 14 Aug 2012
1 answer
119 views
Hi all,


My web page has got a asp:TextBox and a listview, initially the listview is not visisble.When user type a text inside the TextBox I want a listview bound with the database. Exactly my requirment is to bind list view depanding upon the value typed in the textbox.
My sqlquery to extarct the value fron the db is."SELECT patientOrg, surgeryDate FROM DetailsChart WHERE patientName ="text from textbox"

Reply as soon as possible.

Thanks,
Mkm. 
Princy
Top achievements
Rank 2
 answered on 14 Aug 2012
3 answers
88 views
I am trying to change the default HTML output of the table tool so that whenever it is used the HTML inserted has the width automatically set to 100% and the margin and padding set to 0. I've tried using "OnClientCommandExecuting" but I'm not sure I'm going down the right path. Can this be achieved?
William Hurst
Top achievements
Rank 1
 answered on 14 Aug 2012
1 answer
77 views
I have a large dataset that I would like to be able to group in order to show a "summary" view.  Because the dataset is very large, I have paging enabled.  

I'm having trouble showing multiple collapsed groups on one page.  Here is an example of one page: <groupbyproject.jpg >

I would like to see something like this: <groupbyproject_all.jpg>

Thank you

Eyup
Telerik team
 answered on 14 Aug 2012
1 answer
790 views
hello ... i'm using radtreeView and it's a wonderful control i have a small problem and i hope you can help me with it i've created a Next button and a search textbox the user enter the preferred search criteria in the textbox and hit Next. when he click on Next i search the treeView and find the first occurrence in the treeView nodes and make it selected and when he click Next again i want to find the next occurrence of the same node and make it selected how can i achieve this thank you :) i want it 2 be client side if possible
Peter
Telerik team
 answered on 14 Aug 2012
3 answers
87 views
Hi

I dont know If this has been asked before. Did not see the same occurance.

I have a RadGrid that is populated with the NeedDataSource property which gets a list of Items from the Database. These records are all Identical at first except for there ID.

The Grid works with Item GridTemplateColumns and GridBoundColumns.
Most of the Columns have Dropdownboxes for editing.
One of the dropdownboxes calls a Method from Serverside to determine if Input validation on another control must take place.

Here is the problem All the records work perfectly eccept for the 2nd record.
When ever I change the value I can no longer Change the field that is being validated and no postbacks can be preformed because of the validator.

Any Advice wood be great or a posible cause for why only the 2nd record has this problem.

Below is the Grid
<telerik:RadGrid Visible="false" ID="rgBusValidators" runat="server" AutoGenerateEditColumn="True" 
          AlternatingItemStyle-BackColor="white" GridLines="None" 
          GroupingEnabled="False" Width="100%" Height="500px"
          AutoGenerateColumns="False" 
          onneeddatasource="rgBusValidators_NeedDataSource" 
          onupdatecommand="rgBusValidators_UpdateCommand" 
    oneditcommand="rgBusValidators_EditCommand" 
    onitemcreated="rgBusValidators_ItemCreated" >
          <AlternatingItemStyle BackColor="White" />
          <MasterTableView Caption="Bus Daily Report" 
              DataKeyNames="BusNumber,Depot,Operations,ValNum,ValOp,ValFault,AllocNow,AllocDay1,AllocDay2,ValStat,ServiceNumber" 
              ShowFooter="true">
              <Columns>
                      <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" 
                      DataField="BusDailyReportID" HeaderText="BusDailyReportID" 
                      ReadOnly="true" UniqueName="BusDailyReportID" Visible="True">                      
                  </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" 
                      DataField="BusNumber" HeaderText="Bus Number" 
                      ReadOnly="true" UniqueName="BusNumber" Visible="true">                      
                  </telerik:GridBoundColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Depot reporting to" UniqueName="Depot" >
                      <ItemTemplate>
                          <asp:Label ID="lblDepot" runat="server" Text='<%# Eval("Depot") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                        <telerik:RadComboBox ID="Depot" runat="server"
                                AppendDataBoundItems="False"
                                SelectedValue='<%# Bind("Depot") %>'
                                DataTextField="Depot" 
                                DataValueField="Depot"
                                Width="160pt">  
                                                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Midrand Depot" Value="Midrand Depot" />
                                <telerik:RadComboBoxItem Text="Pretoria Depot" Value="Pretoria Depot" />
                                </Items>
                          </telerik:RadComboBox>
                            
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
                    
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="In Operations" UniqueName="Operations" >
                      <ItemTemplate>
                          <asp:Label ID="lblOperations" runat="server" Text='<%# Eval("Operations") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="Operations" runat="server"
                                AppendDataBoundItems="false"
                                SelectedValue='<%# Bind("Operations") %>'
                                DataTextField="Operations" 
                                DataValueField="Operations"
                                Width="160pt"
                                OnSelectedIndexChanged="Operations_SelectedIndexChanged"
                                AutoPostBack="True">                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Operations" Value="Operations" />
                                <telerik:RadComboBoxItem Text="Repairs" Value="Repairs" />
                                <telerik:RadComboBoxItem Text="Service" Value="Service" />
                                </Items>
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Validator Number" UniqueName="ValNum" >
                      <ItemTemplate>
                          <asp:Label ID="lblValNum" runat="server" Text='<%# Eval("ValNum") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="ValNum" runat="server"
                                AppendDataBoundItems="true"
                                SelectedValue='<%# Bind("ValNum") %>'
                                DataSourceID="ValidatorNumbers"
                                DataTextField="ValNum" 
                                DataValueField="ValNum"
                                Width="160pt">
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Validator Operational" UniqueName="ValOp" >
                      <ItemTemplate>
                          <asp:Label ID="lblValOp" runat="server" Text='<%# Eval("ValOP") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="ValOp" runat="server"
                                AppendDataBoundItems="False"
                                SelectedValue='<%# Bind("ValOp") %>'
                                DataTextField="ValOp" 
                                DataValueField="ValOp"
                                AutoPostBack="true"
                                OnSelectedIndexChanged="ValOp_SelectedIndexChanged"
                                Width="160pt">                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Operational" Value="Operational" />
                                <telerik:RadComboBoxItem Text="Faulty" Value="Faulty" />
                                <telerik:RadComboBoxItem Text="Not in Operations" Value="Not in Operations" />
                                </Items>
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Validator Fault Type" UniqueName="ValFault" >
                      <ItemTemplate>
                          <asp:Label ID="lblValFault" runat="server" Text='<%# Eval("ValFault") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="ValFault" runat="server"
                                AppendDataBoundItems="False"
                                SelectedValue='<%# Bind("ValFault") %>'
                                DataTextField="ValFault" 
                                DataValueField="ValFault"
                                Width="160pt">                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Not Applicable" Value="Not Applicable" />
                                <telerik:RadComboBoxItem Text="Validator freeze and can not scan CSC" Value="Validator freeze and can not scan CSC" />
                                <telerik:RadComboBoxItem Text="Validator reading ‘out of service’ on display screen" Value="Validator reading ‘out of service’ on display screen" />
                                <telerik:RadComboBoxItem Text="Validator Completely Off(not switching on)" Value="Validator Completely Off(not switching on)" />
                                <telerik:RadComboBoxItem Text="Validator reset lock broken" Value="Validator reset lock broken" />
                                <telerik:RadComboBoxItem Text="Validator screen not working (but still able to scan CSC)" Value="Validator screen not working (but still able to scan CSC)" />
                                </Items>
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Allocation for the day" UniqueName="AllocNow" >
                      <ItemTemplate>
                          <asp:Label ID="lblAllocNow" runat="server" Text='<%# Eval("AllocNow") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="AllocNow" runat="server"
                                AppendDataBoundItems="true"
                                SelectedValue='<%# Bind("AllocNow") %>'
                                DataSourceID="dsStations"
                                DataTextField="Description" DataValueField="Description"
                                Width="160pt"> 
                                <Items>
                                <telerik:RadComboBoxItem Text="Midrand Depot" Value="Midrand Depot" />
                                <telerik:RadComboBoxItem Text="Pretoria Depot" Value="Pretoria Depot" />
                                </Items>
                          </telerik:RadComboBox>
  
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Allocation Day -1" UniqueName="AllocDay1" >
                      <ItemTemplate>
                          <asp:Label ID="lblAllocDay1" runat="server" Text='<%# Eval("AllocDay1") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:Label ID="AllocDay1" runat="server" Text='<%# Eval("AllocDay1") %>'></asp:Label>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Allocation Day -2" UniqueName="AllocDay2" >
                      <ItemTemplate>
                          <asp:Label ID="lblAllocDay2" runat="server" Text='<%# Eval("AllocDay2") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:Label ID="AllocDay2" runat="server" Text='<%# Eval("AllocDay2") %>'></asp:Label>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Validator Equipment Status" UniqueName="ValStat" >
                      <ItemTemplate>
                          <asp:Label ID="lblValStat" runat="server" Text='<%# Eval("ValStat") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="ValStat" runat="server"
                                AppendDataBoundItems="False"
                                SelectedValue='<%# Bind("ValStat") %>'
                                DataTextField="ValStat" 
                                DataValueField="ValStat"
                                Width="160pt">                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Green" Value="Green" />
                                <telerik:RadComboBoxItem Text="Orange" Value="Orange" />
                                <telerik:RadComboBoxItem Text="Red" Value="Red" />
                                <telerik:RadComboBoxItem Text="Black" Value="Black" />
                                </Items>
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Service Request Number" UniqueName="ServiceNumber" >
                      <ItemTemplate>
                          <asp:Label ID="lblServiceNumber" runat="server" Text='<%# Eval("ServiceNumber") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadTextBox ID="ServiceNumber" Text='<%# Eval("ServiceNumber") %>' Runat="server" MaxLength="10"  >
                          </telerik:RadTextBox>   
                              <asp:RequiredFieldValidator ID="SerNumValidator" runat="server"
                              ErrorMessage="*" ControlToValidate="ValOp"></asp:RequiredFieldValidator>
                          <asp:RegularExpressionValidator ID="exValidator" runat="server" ErrorMessage="* Service Number Is Not Complete"
                           ControlToValidate="ServiceNumber" ValidationExpression=".{10}.*"></asp:RegularExpressionValidator
                            
                          </EditItemTemplate>
                            
                      </telerik:GridTemplateColumn>
              </Columns>
          </MasterTableView>
      </telerik:RadGrid>

Below is the NeedDatasource and OnSelectedChange events
protected void rgBusValidators_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgBusValidators.DataSource = BusList;
        }
  
protected void ValOp_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            try
            {
                GridEditableItem gRow = ((sender as RadComboBox).NamingContainer as GridEditableItem);
                RequiredFieldValidator snreq = ((RequiredFieldValidator)gRow["ServiceNumber"].FindControl("SerNumValidator"));
                if (e.Text == "Faulty")
                {
                    RadTextBox sntxt = ((RadTextBox)gRow["ServiceNumber"].FindControl("ServiceNumber"));
                    snreq.ControlToValidate = sntxt.ID;
                    snreq.IsValid = false;
                }
                else
                {
                    RadComboBox item = (RadComboBox)(sender);
                    snreq.ControlToValidate = item.ID;
                    snreq.IsValid = true;
                }
                  
            }
            catch (Exception ex)
            {
                lblError.Text = string.Format("Error: {0}", ex.Message);
                Log.Write(string.Format("Error Loading Data : {0}", ex.ToString()), Log.Category.IncidentManagementWeb, System.Diagnostics.TraceEventType.Error);
            }
        }

Please I need this urgantly
Marin
Telerik team
 answered on 14 Aug 2012
1 answer
266 views
Hi all,


I have got a RadButton in which i  want to change the color after the click event. After the first button click,  the button shoud be in a disabled state, so that it wont allow the another click.

<telerik:RadButton ID="RadButton1" runat="server"  onclick="RadButton1_Click">
</telerik:RadButton>

Please provide a solution as soon as possible.

Thanks,
Mkm.
Princy
Top achievements
Rank 2
 answered on 14 Aug 2012
2 answers
145 views
Hello,

I sucessfully added a radtooltip to a RadList control by using the ItemDataBound event using this code in the page:

    <telerik:RadToolTipManager ID="radToolTipManager1" runat="server" HideEvent="LeaveTargetAndToolTip"
    Width="250" Height="100" RelativeTo="Element" Position="MiddleRight" ShowDelay="500" >
    <WebServiceSettings Method="GetToolTipData" Path="~/Services/ToolTipWebService.asmx" />
    </telerik:RadToolTipManager>


And this in the code behind
 void RadListBoxSource_ItemDataBound(object sender, RadListBoxItemEventArgs e)
{
    if (e.Item is RadListBoxItem)
        {
            this.radToolTipManager1.TargetControls.Add(e.Item.ClientID, (e.Item as RadListBoxItem).Value, true);
        } 
}
The value is an ID that can be used to return a list from the webservice (in this case a list of Departments the hovered over person works for).

I tried to adapt this code for a RadComboBox on the same page, but no ToolTip is shown.

void ddPerson_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
{
   if (e.Item is RadComboBoxItem)
   {
      this.radToolTipManager1.TargetControls.Add(e.Item.ClientID, (e.Item as RadComboBoxItem).Value, true);
   }
}


Is there a step that I am missing? The ClientID for the item when I add a breakpoint is something like "i0" which doesn't seem long enough.

Thank you for your help

Paul Herzberg
Paul Herzberg
Top achievements
Rank 1
 answered on 14 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?