Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
194 views
I have more then 15 appoint ment for one date , and i want to set that alphabatical order... how can i set..?


REgards
Samir
Allen
Top achievements
Rank 1
 answered on 18 May 2012
2 answers
175 views
I'm using a RadNotification in a UserControl, which is in a content page, which is in a master page.  The RadNotification the UserControl is referencing is in the Master page.  Here's the code I use to get it:
public RadNotification GetNotificationAlert(Control ctl)
{
    var master = (defaultMaster)ctl.Page.Master;
    if (master != null)
        return master.FindControl("RadNotification1") as RadNotification;
 
    return null;
}

This works, but if I try to change any of the properties of the notification, such as width, visibletitlebar, etc. nonw of them work.  Here's an example:
var notification = GetNotificationAlert(this);
notification.VisibleTitlebar = false;
notification.Width = 540;
notification.Height = 90;
notification.Opacity = 70;

Any idea what I might be doing wrong?

Thanks!

Software
Top achievements
Rank 1
 answered on 18 May 2012
2 answers
98 views


Hi,
I am using radcalender control in inside radgrid. Value stored in db is of format "7/4/2010 12:00:00 AM". can i assign this value to rad calendar.
Is this possible ?

  <telerik:GridTemplateColumn HeaderText="Start" UniqueName="fispersrt" DataField="fispersrt"
                                Visible="true">
                                <ItemTemplate>
                                <telerik:RadCalendar ID="rdCalendar" runat="server">
                                </ItemTemplate>
                                <HeaderStyle ForeColor="Red" />
                            </telerik:GridTemplateColumn>

Regards,
Akki
Akki
Top achievements
Rank 1
 answered on 18 May 2012
1 answer
91 views
Hello,

I have an ImageButton in a  RadGrid with a RadAjaxManager. When I click on the ImageButton in line 1 of the grid, controls are populated with the data from the radgrid. If I click on the same imagebutton in lines 2..n, nothing fires.

Code to bind the cotrols are as follows.

 

 

 

<telerik

:AjaxSetting AjaxControlID="imgRequest">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="rgRequests" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="rdpReqInfoReceivedDate" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="ddlRequestType" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="cbxIsRequired" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="ddlOutcomes" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="tbxOutcomeReason" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="rdpReqOutcomeDate" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 


Any help would be appreciated.

Thanks
Thomas
Eyup
Telerik team
 answered on 18 May 2012
1 answer
236 views
So I'm wanting to prevent nested styles for ease of interpretation by another system after the user has created the content in the RadEditor. I've been able to make some progress with this but run into problems when the user makes a selection and tries to apply a new css style to a block of text that contains more then one style already. For example one word is blue and the other red and the user has decided to make them both green and so has selected them together thinking they can change both at the same time. The style change is applied however my code currently fails to handle this situation and allows a nested style to be created. 

More concrete example is this one: This will be the end of it all because that's all I care to write. 
And I want to change the color of the words "the end" to both be blue. So I select both and I see the color change but I end up with this as my resulting text - nested spans: 
<span class="yellow_bold">This will be </span><span class="blue_bold">the </span><span class="yellow_bold"></span><span class="red_bold"><span class="blue_bold">end</span> of it all </span><span class="blue_bold">because</span>...

Where I think my problem is coming from is that when I ask for the selected element in the command event - I only get the first word and not the second. Is there someway for me to get each element (word) in turn and process them or is there an entirely different way I could be handling this to get the result I need?

If I step into the code I see the following:

var selectedHTML = "";
var selectedHtmlElement;
var selectionObject;

function OnClientCommandExecuting(editor, args) {
selectedHTML = editor.getSelectionHtml(); // becomes "<font class="yellow_bold">the </font><font class="red_bold">end</font>"
selectedHtmlElement = editor.getSelectedElement(); // becomes "This will be the end of..."
selectionObject = editor.getSelection(); // becomes an object I don't know how to use - maybe it is helpful and I don't know it
}

function OnClientCommandExecuted(editor, args) {
var commandName = args.get_commandName();

if (commandName == "ApplyClass") {

var className = args.get_value();
if (className == "") return;

// alert("executing on " + selectedHTML);


var selectedElement = editor.getSelectedElement(); // becomes an element with innerHtml = "the "
var parentElement = getParentSpan(selectedElement.parentNode);
if (parentElement) {
var newNode1 = parentElemen


The OnClientCommandExecuted is only fired once and I only get the one word/element when I request getSelectedElement. Is there some way to access the other word/element in this event as well so I can process it. And note how the element returned by getSelectedElement is different between the CommandExecuted and CommandExecuting events. The latter returns the top parent element that contains all the words/elements and not just the 2 that are affected by the style change.

<telerik:RadEditor ID="RadEditor1" runat="server" Height="400px" EditModes="Design" StripFormattingOnPaste="AllExceptNewLines"
                    StripFormattingOptions="AllExceptNewLines" OnClientCommandExecuted="OnClientCommandExecuted"
                     OnClientCommandExecuting="OnClientCommandExecuting">
                    <Content></Content>
</telerik:RadEditor>

<telerik:RadScriptBlock ID="voteScript" runat="server" >
    <script type="text/javascript" >
 
        var selectedHTML = "";
        var selectedHtmlElement;
        var selectionObject;
 
        function OnClientCommandExecuting(editor, args) {
            selectedHTML = editor.getSelectionHtml();
            selectedHtmlElement = editor.getSelectedElement();
            selectionObject = editor.getSelection();
        }
 
        function OnClientCommandExecuted(editor, args) {
            var commandName = args.get_commandName();
 
            if (commandName == "ApplyClass") {
 
                var className = args.get_value();
                if (className == "") return;
 
                // alert("executing on " + selectedHTML);
 
 
                var selectedElement = editor.getSelectedElement();
                var parentElement = getParentSpan(selectedElement.parentNode);
                if (parentElement) {
                    // break the content into 3 pieces - before selected text, the selected text, and after selected text and apply span styles to each
                    var newNode1 = parentElement.cloneNode(false);
                    var newNode2 = selectedElement.cloneNode(true);
                    newNode2.innerHTML = newNode2.innerText;
                    // alert(newNode2.innerHTML);
                    newNode1.innerHTML = parentElement.firstChild.nodeValue;
                    parentElement.innerHTML = parentElement.lastChild.nodeValue;
 
                    parentElement.parentNode.insertBefore(newNode1, parentElement);
                    parentElement.parentNode.insertBefore(newNode2, parentElement);
                }
                else {
                    var justText = selectedElement.innerText;
                    var newNode = document.createElement("FONT");
                    newNode.setAttribute("class", className);
                    newNode.innerHTML = justText;
 
                    selectedElement.parentNode.replaceChild(newNode, selectedElement);
                }
            }
        }
 
        function getParentSpan(el) {
            if (!el || el == null) return false;
 
            while (el && el.tagName && el.tagName.toLowerCase() != "font" && el.tagName.toLowerCase() != "body") {
                el = el.parentNode;
            }
 
            if (el == null || !el.tagName || el.tagName.toLowerCase() == "body") return false
            else return el;
        }
 
    </script>
</telerik:RadScriptBlock>

Rumen
Telerik team
 answered on 18 May 2012
2 answers
148 views
I have a user setup form that contains several RadButtons for the individual permissions (checkboxes).  The RadButtons are created at runtime on page init then added to a fieldset:
var availablePermissions = Permissions.AllPermissions(PermissionCategory.Client);
foreach (var permission in availablePermissions)
{
    //create the permission checkbox
    var checkbox = new RadButton
                    {
                        AutoPostBack = false,
                        ToggleType = ButtonToggleType.CheckBox,
                        ButtonType = RadButtonType.ToggleButton,
                        ID = "Permission_" + permission.Name,
                        Value = permission.Name,
                        ToolTip = permission.Description,
                        Text = permission.DisplayName,
                        Checked = workUser.HasPermission(permission)
                    };
        PermissionFieldSet.Controls.Add(checkbox);
}

This part of the code works great.  The permissions are added and displayed appropriately.  The problem is now accessing the controls on postback.  Since they were added at runtime and can be varied in number I need to iterate all possible permissions checked.  The original plan was to get any Request.Form elements that matched the ID pattern of "Permission_" like so:
public bool SaveOrUpdateUser()
{
    /* Various other user setup fields */
 
    //get all form fields that contain the "Permission_" identifier
    var permissions = Request.Form.AllKeys.Where(key => key.Contains("Permission_")).Select(key => Request.Form[key]).ToList();
}

While this call does successfully retrieve the permissions, the information returned is a serialized version of the RadButton control:
{\"text\":\"ButtonText\",\"value\":\"ButtonValue\",\"checked\":true,\"target\":\"\",\"navigateUrl\":\"\",\"commandName\":\"\",\"commandArgument\":\"\",\"autoPostBack\":false,\"selectedToggleStateIndex\":0,\"readOnly\":false}

So, how can I deserialize this back into a RadButton to be able to interpret the checked status of each of my permissions?  I know I could manually breakdown the string, but that seems like a workaround at best.

Thanks.

Tom
Tom Rasmussen
Top achievements
Rank 1
 answered on 18 May 2012
4 answers
409 views
Hi,

I have a RadTreeView, binded from database of 5 Levels.
Handling the Node click from client side, now I'm facing an issue, if the Node level is 2 I have to block the node click no post back should happend when user clicks on that node.

Regards
Krishna
Avinash Tauro
Top achievements
Rank 1
 answered on 18 May 2012
14 answers
436 views
Hi,
I'm using the Telerik RadEditor on our website.  When I browse to it on an iPad and I try to enter text  but does not allow the entry of text the onscreen keyboard doesn't pop up.

The iPad uses Safari which is listed as supported for RadEditor...

Anyone solved this problem?



Rumen
Telerik team
 answered on 18 May 2012
7 answers
236 views
I have a RadGrid that is Ajaxified by the Ajax Manager. I have 2 tooltip managers pointing to different controls. One is linked to a hyperlink in the header of the grid. The other is linked to an image in the item template of the same column as the header with tooltip. I am adding the target controls in the itemdatabound of the grid. For some reason, only the header tooltip is working at this point. The ajaxupdate event is not firing for the second tooltip. If i disable ajax, they both work correctly. Is there some trick to multiple tool tip managers with an ajaxed grid.
Here is my code:

<asp:Panel id="pnlContent" runat="server"> 
 
<telerik:RadGrid id="grdProspects" runat="server" AutoGenerateColumns="false" AllowSorting="true" AllowPaging="true" PageSize="20" ShowHeader="true" ShowFooter="false" Width="760" GroupingEnabled="false"  > 
                                    <ClientSettings EnablePostBackOnRowClick="true" EnableRowHoverStyle="true" AllowColumnsReorder="true"> 
                                        <ClientEvents OnRowContextMenu="Prospects_RowContextMenu" OnColumnContextMenu="Prospects_ColumnContextMenu" /> 
                                        <Selecting AllowRowSelect="true" />  
                                        <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" /> 
                                        <Scrolling AllowScroll="true" ScrollHeight="500" UseStaticHeaders="true"/> 
                                    </ClientSettings> 
                                     
                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="Bottom" /> 
                                    <MasterTableView TableLayout="Fixed"  AllowMultiColumnSorting="true" NoMasterRecordsText="No Prospects" DataKeyNames="BACID" Width="760"> 
                                        <CommandItemSettings ShowExportToCsvButton="true" /> 
                                        <Columns> 
                                            <telerik:GridTemplateColumn ItemStyle-Width="60px" HeaderStyle-Width="60px" Reorderable="false"> 
                                                <HeaderTemplate> 
                                                    <asp:HyperLink ID="lnkLegend" runat="server" NavigateUrl="" Text="Legend"></asp:HyperLink> 
                                                </HeaderTemplate> 
                                                <ItemTemplate> 
                                                    <asp:Image ID="imgCalled" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/called_on.gif"  AlternateText="Called"></asp:Image> 
                                                    <asp:Image ID="imgRegistered" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/register_on.gif" AlternateText="Registered"></asp:Image> 
                                                    <asp:Image ID="imgConfirmed" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/confirm_on.gif" AlternateText="Confirmed"></asp:Image> 
                                                    <asp:Image ID="imgFinalized" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/final_on.gif" AlternateText="Finalized"></asp:Image> 
                                                    <asp:Image ID="imgHasComment" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/feedback.gif" ></asp:Image> 
                                                </ItemTemplate> 
                                            </telerik:GridTemplateColumn> 
                                            <telerik:GridBoundColumn HeaderText="Name" DataField="Name" SortExpression="SortName"></telerik:GridBoundColumn>                                                                                         
                                        </Columns> 
                                    </MasterTableView> 
                                     
                                </telerik:RadGrid>   
</asp:panel> 
 
<telerik:RadToolTipManager runat="server" ID="rttmRecruiterComments" Position="Center" Text="Loading..." 
            RelativeTo="Element" Width="350px" Height="300px" Animation="Fade" HideEvent="LeaveToolTip" ToolTipControl="controls/RecruiterComments.ascx">             
          </telerik:RadToolTipManager>  
           
 <telerik:RadToolTipManager runat="server" ID="rttmLegend" Position="Center" Text="Loading..." 
            RelativeTo="Element" Width="250px" Height="200px" Animation="Fade" HideEvent="LeaveToolTip" ToolTipControl="controls/RecruiterLegend.ascx"> 
          </telerik:RadToolTipManager>  
           
<telerik:RadAjaxManager ID="AjaxManager" runat="server" EnableAJAX="true" DefaultLoadingPanelID="LoadingPanel6"> 
    <ClientEvents/> 
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="pnlContent"> 
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="pnlContent" /> 
                <telerik:AjaxUpdatedControl ControlID="AjaxManager" /> 
       
            </UpdatedControls> 
        </telerik:AjaxSetting> 
         <telerik:AjaxSetting AjaxControlID="AjaxManager"> 
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="pnlContent" /> 
                <telerik:AjaxUpdatedControl ControlID="AjaxManager" /> 
             
            </UpdatedControls> 
        </telerik:AjaxSetting> 
          
    </AjaxSettings> 
     
</telerik:RadAjaxManager> 


Private Sub grdProspects_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdProspects.ItemDataBound 
            Select Case e.Item.ItemType 
 
                Case GridItemType.Header 
                    Dim lnkLegend As HyperLink = DirectCast(e.Item.FindControl("lnkLegend"), HyperLink) 
                    rttmLegend.TargetControls.Add(lnkLegend.ClientID, True) 
 
                Case GridItemType.Item, GridItemType.AlternatingItem 
 
                    With DirectCast(e.Item.DataItem, Prospect) 
                        DirectCast(e.Item.FindControl("imgCalled"), Image).Visible = .IsCalled 
                        DirectCast(e.Item.FindControl("imgRegistered"), Image).Visible = .IsRegistered 
                        DirectCast(e.Item.FindControl("imgConfirmed"), Image).Visible = .IsConfirmed 
                        DirectCast(e.Item.FindControl("imgFinalized"), Image).Visible = .IsFinalized 
 
                        Dim imgHasComment As Image = DirectCast(e.Item.FindControl("imgHasComment"), Image) 
                        imgHasComment.Visible = .HasRecruiterComment 
                        If imgHasComment.Visible Then 
                            rttmRecruiterComments.TargetControls.Add(imgHasComment.ClientID, .BACID, True) 
                        End If 
 
                       
 
            End Select 
        End Sub 


Thanks!
Robert Helm
Top achievements
Rank 1
 answered on 18 May 2012
3 answers
407 views
I am working on a grid that puts all the rows (about 8 usually) into edit mode for batch updates. 
I have a command button in the command header of the grid to save all the data. 

I was trying to use the ExtractValuesFromItem and SavedOldValues collections to perform the update and neither collection has any data. All the entries are there but are all NULL. I don't understand why.  I have used this method before in a slightly different situation.
The one thing I can see that is different is in the current grid that this isn't working for I have defined an ItemTemplate and an EditItemTemplate. I am using InPlace edit mode.

I have found that I can get the current values by using editedItem.FindControl("...")... but this is a little more work and it doesn't give me the previous values either.

Should I be able to use the ExtractValues and SavedOldvalues methods in this instance or is there some reason why it cannot be used? If it should be working - any thought on why both collections are coming up with nulls for everying?

The codebehind for updates:
protected void UpdateAll_Clicked(object sender, EventArgs e)
 {
     try
     {
 
         WeatherForecast w = new WeatherForecast();
         WeatherForecast orig_w = new WeatherForecast();
 
         foreach (GridDataItem item in RadGrid1.EditItems)
         {
             GridEditableItem editedItem = (item.OwnerTableView.EditMode == GridEditMode.InPlace) ? item : (GridEditableItem)item.EditFormItem;
 
             Hashtable newValues = new Hashtable();
             //The GridTableView will fill the values from all editable columns in the hash 
             RadGrid1.MasterTableView.ExtractValuesFromItem(newValues, editedItem);
 
             newValues["Temp"] = (editedItem.FindControl("txtTemp") as TextBox).Text;
             newValues["Temp2"] = (editedItem.FindControl("txtTemp2") as TextBox).Text;
             newValues["ShortText"] = (editedItem.FindControl("txtShortText") as TextBox).Text;
             newValues["Pop"] = (editedItem.FindControl("txtPop") as TextBox).Text;
             newValues["Manual"] = (editedItem.FindControl("radioManualEdit") as RadioButton).Checked;
             newValues["ConditionId"] = (editedItem.FindControl("listWeather") as RadComboBox).SelectedItem.Value;
             newValues["UvIndex"] = (editedItem.FindControl("listUvIndex") as DropDownList).SelectedItem.Value;
 
              
             w.Id = Convert.ToInt32(editedItem.GetDataKeyValue("Id"));
             w.Temp = Convert.ToInt32(newValues["Temp"]);
             w.Temp2 = Convert.ToInt32(newValues["Temp2"]);
             w.ConditionId = Convert.ToInt32(newValues["ConditionId"]);
             w.ShortText = Convert.ToString(newValues["ShortText"]);
             if (string.IsNullOrEmpty(Convert.ToString(newValues["Pop"])))
             {
                 w.Pop = null;
             }
             else
             {
                 w.Pop = Convert.ToInt32(newValues["Pop"]);
             }
             w.Manual = Convert.ToBoolean(newValues["Manual"]);
             w.UvIndex = Convert.ToInt32(newValues["UvIndex"]);
             w.UvText = WeatherForecast.GetUvText(w.UvIndex);
 
             // TODO: implement day of week editing
             // w.DayOfWeek = Convert.ToString(newValues["DayOfWeek"]);
 
             orig_w.Id = w.Id;
             orig_w.Temp = Convert.ToInt32(editedItem.SavedOldValues["Temp"]);
             orig_w.Temp2 = Convert.ToInt32(editedItem.SavedOldValues["Temp2"]);
             orig_w.ConditionId = Convert.ToInt32(editedItem.SavedOldValues["ConditionId"]);
             orig_w.ShortText = Convert.ToString(editedItem.SavedOldValues["ShortText"]);
             if (string.IsNullOrEmpty(Convert.ToString(editedItem.SavedOldValues["Pop"])))
             {
                 orig_w.Pop = null;
             }
             else
             {
                 orig_w.Pop = Convert.ToInt32(editedItem.SavedOldValues["Pop"]);
             }
             orig_w.Manual = Convert.ToBoolean(editedItem.SavedOldValues["Manual"]);
             orig_w.UvIndex = Convert.ToInt32(editedItem.SavedOldValues["UvIndex"]);
             orig_w.UvText = WeatherForecast.GetUvText(orig_w.UvIndex);
 
            // wDAO.UpdateWeather(w, orig_w);
 
             editedItem.Edit = false;
         }
     }
     catch (Exception ex)
     {
         Common.FlowFunctions.ShowErrorMessage(RadAjaxManager1, "Error updating weather: " + ex.Message, true);
     }
 
     setSelection = true;
 
     RadGridCity.Rebind();
     RadGrid1.Rebind();
 }


The markup: 
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0"
     GridLines="None" AllowSorting="false" AutoGenerateColumns="False" AllowPaging="true"  PageSize="20"
      AllowAutomaticDeletes="false"
      AllowAutomaticUpdates="false"
      OnPreRender="RadGrid1_PreRender"
      OnSortCommand="RadGrid1_SortCommand"
      OnNeedDataSource="RadGrid1_NeedDataSource"
      OnItemCommand="RadGrid1_ItemCommand"
      OnItemDataBound="RadGrid1_ItemDataBound" >
     <ClientSettings  >
          <ClientEvents OnKeyPress="keyPressedStopEnter" />
     </ClientSettings>
     <PagerStyle AlwaysVisible="false" />
     <ItemStyle CssClass="report_col_B" />
     <AlternatingItemStyle CssClass="report_col_A" />
     <MasterTableView DataKeyNames="Id" EditMode="InPlace" TableLayout="Fixed"  CommandItemDisplay="Top">
         <Columns>
             <telerik:GridCheckBoxColumn DataField="Manual" DataType="System.Boolean"
                 HeaderText="Source" SortExpression="Manual" UniqueName="Manual" Display="false">
             </telerik:GridCheckBoxColumn>
 
             <telerik:GridBoundColumn DataField="LocationCode" UniqueName="LocationCode" HeaderText="Location Code" Visible="false" ></telerik:GridBoundColumn>
 
             <telerik:GridBoundColumn DataField="LocationName" DataType="System.String" UniqueName="LocationName" Visible="false" HeaderText="Location" ></telerik:GridBoundColumn>
 
             <telerik:GridBoundColumn DataField="ConditionId" UniqueName="ConditionId" HeaderText="Icon" AllowSorting="false" Visible="false" ></telerik:GridBoundColumn>
 
             <telerik:GridBoundColumn DataField="TempLabel" UniqueName="TempLabel" Visible="false" AllowSorting="false" ></telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="Temp2Label" UniqueName="Temp2Label" Visible="false" AllowSorting="false" ></telerik:GridBoundColumn>
 
             <telerik:GridBoundColumn DataField="Temp" UniqueName="Temp" HeaderText="Temp" AllowSorting="false" Visible="false" HeaderTooltip="The high for daily forecasts." ></telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="Temp2" UniqueName="Temp2" HeaderText="Temp 2" AllowSorting="false" Visible="false" HeaderTooltip="The low for daily forecasts and 'Feels Like' for current and hourly." ></telerik:GridBoundColumn>
                  
             <telerik:GridBoundColumn DataField="ShortText" UniqueName="ShortText" HeaderText="Short Text" Visible="false" AllowSorting="false" ></telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="Pop" UniqueName="Pop" HeaderText="P.O.P." AllowSorting="false" Visible="false" HeaderTooltip="Probability of Precipitation" ></telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="UvIndex" UniqueName="UvIndex" HeaderText="UV Index" Visible="false" AllowSorting="false" ></telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="UvText" UniqueName="UvText" HeaderText="UV Text" Visible="false" AllowSorting="false" ></telerik:GridBoundColumn>
 
 
             <telerik:GridBoundColumn DataField="ModifiedDate" UniqueName="ModifiedDate" HeaderText="Last Updated" SortExpression="ModifiedDate" ReadOnly="true">
                 <ItemStyle CssClass="smc_form" />
             </telerik:GridBoundColumn>
              
              
         </Columns>
 
         <ItemTemplate>
             <table cellpadding="0" cellspacing="0" >
                 <col width="140px" />
                 <col width="30px" />
                 <col width="190px" />
                 <col width="80px" />
                 <col width="80px" />
                 <col width="50px" />
                 <col width="120px" />
                 <col width="80px" />
                 <col width="80px" />
                 <tr>
                     <td rowspan="2">
                         <h2><%# ForecastDayDisplay(Eval("ForecastName"), Eval("DayOfWeek"))%></h2>
                         <%#Eval("ModifiedDate", "{0:g}")%>
                     </td>
                     <td rowspan="2"><asp:ImageButton ID="ManualToggleButton" Height="24px" runat="server"  CausesValidation="false" /></td>
                     <td rowspan="2"><%# Eval("ConditionText")%></td>
                     <td align="right" ><%# Eval("TempLabel")%></td>
                     <td><%# Eval("Temp")%> <span class="smc_bodybold">°C</span></td>
                     <td>Text:</td>
                     <td><%# Eval("ShortText")%></td>
                     <td align="right" >UV Index:</td>
                     <td><%# NullIntDisplay(Eval("UvIndex"), "")%></td>
                 </tr>
                 <tr>
                     <td align="right" ><%# Eval("Temp2Label")%></td>
                     <td ><%# Eval("Temp2")%> <span class="smc_bodybold">°C</span></td>
                     <td><span title="Probability of precipitation" style="cursor: help" >P.O.P.:</span></td>
                     <td><%# NullIntDisplay(Eval("Pop"), "%")%></td>
                     <td align="right" >UV Text::</td>
                     <td><%# Eval("UvText")%></td>
                 </tr>
             </table>
              
         </ItemTemplate>
 
         <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
         <CommandItemTemplate>
             <table>
                 <tr>
                     <td style="font-size: 13px; padding: 10px 10px; text-align: left; white-space: nowrap; font-weight: bold">
                         <asp:Label ID="labelCityName" runat="server" Text="Select" ></asp:Label>
                         <br /> City Weather Details
                     </td>
                     <td><br />
                         <asp:Button ID="btnUpdateAll" CssClass="smc_form" runat="server" Text="Save Now >" CommandName="UpdateAll"
                             Visible="true" OnClick="UpdateAll_Clicked" />
                     </td>
                     <td style="width: 50px;"> </td>
                     <td style="font-size: 11px; padding: 10px 10px; text-align: left; white-space: nowrap; font-weight: bold">
                         <asp:Panel ID="panelDataSources" runat="server">
                             <asp:Label runat="server" ID="Label1" Text="Data Source:"></asp:Label>
                             <br />
                             <asp:ImageButton Height="32" ID="btnAllManual" CommandName="SetAllAutoOff" ImageUrl="~/images/icons/auto_off.png" runat="server" ToolTip="Set all forecasts to Manual" AlternateText="All Manual" OnClientClick="return confirm('Are you sure you want to set all forecasts to Manual?');" /> 
                             <asp:ImageButton Height="32" ID="btnAllAutomated" CommandName="SetAllAutoOn" ImageUrl="~/images/icons/auto_on.png"  runat="server" ToolTip="Set all forecasts to Data Feed"  AlternateText="All Auto" OnClientClick="return confirm('Are you sure you want to set all forecasts to Data Feed?');" /> 
                         </asp:Panel>
                     </td>
                 </tr>
             </table>
         </CommandItemTemplate>
         <EditItemTemplate>
             <table cellpadding="0" cellspacing="0" >
                 <col width="140px" />
                 <col width="100px" />
                 <col width="190px" />
                 <col width="80px" />
                 <col width="80px" />
                 <col width="60px" />
                 <col width="140px" />
                 <col width="120px" />
                 <tr>
                     <td rowspan="2">
                         <h2><%# ForecastDayDisplay(Eval("ForecastName"), Eval("DayOfWeek"))%></h2>
                         <span class="smc_body"><%#Eval("ModifiedDate", "{0:g}")%></span>
                     </td>
                     <td rowspan="2">
                         <asp:RadioButton ID="radioManualEdit" runat="server" Text="Manual" Checked='<%# Bind("Manual") %>' GroupName="manualAuto" />
                         <br />
                         <asp:RadioButton ID="radioDataFeedEdit" runat="server" Text="Data Feed" Checked='<%# (!(Convert.ToBoolean(Eval("Manual")))) %>' GroupName="manualAuto" />
                     </td>
                     <td rowspan="2">
                         <telerik:RadComboBox ID="listWeather"  CssClass="smc_form" AppendDataBoundItems="true" DataSourceID="weatherListDataSource"
                                 DataTextField="weatherName" DataValueField="weatherId" Width="190px" runat="server" DropDownWidth="250px" Height="200px"
                                 SelectedValue='<%# Bind("ConditionId")%>' >
                             <Items>
                                 <telerik:RadComboBoxItem Text="-" Value="0" />
                             </Items>
                         </telerik:RadComboBox>
                     </td>
                     <td align="right"><%# Eval("TempLabel")%></td>
                     <td>
                         <asp:TextBox ID="txtTemp" runat="server" Width="25px" Text='<%# Bind("Temp")%>' CssClass="smc_form flow_right" MaxLength="5" AutoCompleteType="None" >
                         </asp:TextBox> <span class="smc_bodybold">°C</span>
                     </td>
                     <td align="right">Text:</td>
                     <td>
                         <asp:TextBox ID="txtShortText" runat="server" Width="100px" Text='<%# Bind("ShortText")%>' CssClass="smc_form" MaxLength="128" >
                         </asp:TextBox>
                     </td>
                     <td rowspan="2">UV Index:
                         <br />
                         <asp:DropDownList ID="listUvIndex" runat="server" CssClass="smc_form" Width="120px" SelectedValue='<%# Bind("UvIndex")%>' >
                             <asp:ListItem Text="-" Value="-1"></asp:ListItem>
                             <asp:ListItem Text="0 - Low" Value="0"></asp:ListItem>
                             <asp:ListItem Text="1 - Low" Value="1"></asp:ListItem>
                             <asp:ListItem Text="2 - Low" Value="2"></asp:ListItem>
                             <asp:ListItem Text="3 - Moderate" Value="3"></asp:ListItem>
                             <asp:ListItem Text="4 - Moderate" Value="4"></asp:ListItem>
                             <asp:ListItem Text="5 - Moderate" Value="5"></asp:ListItem>
                             <asp:ListItem Text="6 - High" Value="6"></asp:ListItem>
                             <asp:ListItem Text="7 - High" Value="7"></asp:ListItem>
                             <asp:ListItem Text="8 - Very High" Value="8"></asp:ListItem>
                             <asp:ListItem Text="9 - Veru High" Value="9"></asp:ListItem>
                             <asp:ListItem Text="10 - Very High" Value="10"></asp:ListItem>
                             <asp:ListItem Text="11+ - Extreme" Value="11"></asp:ListItem>
                         </asp:DropDownList>
                      
                     </td>
                 </tr>
                 <tr>
                     <td align="right"><%# Eval("Temp2Label")%></td>
                     <td>
                         <asp:TextBox ID="txtTemp2" runat="server" Width="25px" Text='<%# Bind("Temp2")%>' CssClass="smc_form flow_right" MaxLength="5" AutoCompleteType="None" >
                         </asp:TextBox> <span class="smc_bodybold">°C</span>
                     </td>
                     <td align="right">P.O.P.:</td>
                     <td>
                         <asp:TextBox ID="txtPop" runat="server" Width="25px" Text='<%# Bind("Pop")%>' CssClass="smc_form flow_right" MaxLength="5" AutoCompleteType="None">
                         </asp:TextBox> <span class="smc_bodybold">%</span>
                     </td>
                     <td></td>
                 </tr>
             </table>
               
 
         </EditItemTemplate>
     </MasterTableView>
 </telerik:RadGrid>
Jonathan
Top achievements
Rank 1
 answered on 18 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?