Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
120 views
Hello,

Based on the demo 'Master/Detail Grids' I've made a .aspx page. Although the SQL-statements work properly when I test them, the rowclick in the mastergrid (gvTasksDataSteward) doesn't show any value in the detailsgrid (gvDetails). I've checked the demo thorougly but can't find whats missing/going wrong.

The aspx:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">  
    <%--master--%> 
    <telerik:RadGrid ID="gvTasksDataSteward" runat="server" AutoGenerateColumns="False" 
        DataSourceID="dsTasks" GridLines="None" Skin="Office2007">  
        <ClientSettings EnablePostBackOnRowClick="true" AllowKeyboardNavigation="True">  
            <Selecting AllowRowSelect="true" /> 
        </ClientSettings> 
        <MasterTableView DataSourceID="dsTasks" Name="DatastewardTasks" DataKeyNames="TaskId" 
            AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
            EditMode="PopUp">  
            <RowIndicatorColumn Visible="False">  
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn Visible="False" Resizable="False">  
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandProject">  
                    <HeaderStyle Width="20px" /> 
                </telerik:GridEditCommandColumn> 
                <telerik:GridBoundColumn DataField="TaskId" HeaderText="TaskId" UniqueName="TaskId" 
                    Visible="false" ReadOnly="true">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company" SortExpression="Company" 
                    UniqueName="Company">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="ProjectName" HeaderText="Project" SortExpression="ProjectName" 
                    UniqueName="ProjectName">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="TaskDescription" HeaderText="TaskDescription" 
                    SortExpression="TaskDescription" UniqueName="TaskDescription">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Remarks" HeaderText="Remarks" SortExpression="Remarks" 
                    UniqueName="Remarks">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="StartDate" DataType="System.DateTime" HeaderText="StartDate" 
                    SortExpression="StartDate" UniqueName="StartDate" DataFormatString="{0:d}">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="SoortBewerking" HeaderText="SoortBewerking" SortExpression="SoortBewerking" 
                    UniqueName="SoortBewerking">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="RealHours" DataType="System.Decimal" HeaderText="RealHours" 
                    SortExpression="RealHours" UniqueName="RealHours" Visible="false">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="StatusId" UniqueName="StatusId" Visible="false" 
                    ReadOnly="true">  
                </telerik:GridBoundColumn> 
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="Accept" Text="Accept" 
                    ImageUrl="~/Images/OK.png" ShowInEditForm="false" CommandName="Accepted">  
                </telerik:GridButtonColumn> 
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="NotAccept" Text="Not Accept" 
                    ImageUrl="~/Images/OK.png" ShowInEditForm="false" CommandName="NotAccepted">  
                </telerik:GridButtonColumn> 
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="Executed" Text="Executed" 
                    ImageUrl="~/images/11new.gif" ShowInEditForm="false" CommandName="Executed" ConfirmText="Executed?">  
                </telerik:GridButtonColumn> 
            </Columns> 
            <EditFormSettings CaptionFormatString="Edit: {0}" CaptionDataField="ProjectName">  
                <PopUpSettings ScrollBars="Auto"></PopUpSettings> 
                <EditColumn ButtonType="ImageButton" CancelText="Cancel Edit" UpdateText="Update Task" 
                    InsertText="Insert User" UniqueName="EditCommandColumn">  
                </EditColumn> 
                <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> 
            </EditFormSettings> 
        </MasterTableView> 
    </telerik:RadGrid> 
    <%--Details--%> 
    <telerik:RadGrid ID="gvDetails" runat="server" AutoGenerateColumns="False" DataSourceID="dsFiles" 
        GridLines="None" Skin="Office2007">  
        <MasterTableView Name="Details" DataSourceID="dsFiles" DataKeyNames="FileId">  
            <RowIndicatorColumn Visible="False">  
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn Visible="False" Resizable="False">  
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="FileName" HeaderText="FileName" SortExpression="FileName" 
                    UniqueName="FileName">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="ProjectId" DataType="System.Int32" HeaderText="ProjectId" 
                    SortExpression="ProjectId" UniqueName="ProjectId">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="FileId" HeaderText="FileId" SortExpression="FileId" 
                    UniqueName="FileId" Visible="false">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="FileSaveAs" HeaderText="FileSaveAs" SortExpression="FileSaveAs" 
                    UniqueName="FileSaveAs" Visible="false">  
                </telerik:GridBoundColumn> 
            </Columns> 
            <EditFormSettings> 
                <PopUpSettings ScrollBars="None"></PopUpSettings> 
            </EditFormSettings> 
        </MasterTableView> 
        <ClientSettings AllowKeyboardNavigation="True" EnablePostBackOnRowClick="True">  
        <Selecting AllowRowSelect="true" /> 
        </ClientSettings> 
    </telerik:RadGrid> 
      
      
    <asp:SqlDataSource ID="dsTasks" runat="server" ConnectionString="<%$ ConnectionStrings:dsBewerkingenConnectionString %>" 
        SelectCommand="SELECT tblTasks.ReadyDate, tblTasks.TaskDescription, tblTasks.Remarks, tblTasks.TaskId, tblTasks.StartDate, tblTasks.StatusId, tblTasks.RealHours, tblBewerkingen.SoortBewerking, tblStatusTasks.StatusNam, tblProjects.ProjectName, tblCompany.CompanyName FROM tblTasks INNER JOIN tblStatusTasks ON tblTasks.StatusId = tblStatusTasks.StatusId LEFT OUTER JOIN tblProjects ON tblTasks.ProjectId = tblProjects.ProjectId LEFT OUTER JOIN tblBewerkingen ON tblTasks.BewerkingId = tblBewerkingen.BewerkingId LEFT OUTER JOIN tblCompany ON tblProjects.CompanyId = tblCompany.CompanyId WHERE (tblTasks.StatusId IN (7, 4)) AND (tblTasks.UserId = @UserId)" 
        DeleteCommand="DELETE FROM [tblTasks] WHERE [TaskId] = @TaskId" InsertCommand="INSERT INTO [tblTasks] ([ProjectId], [BewerkingId], [UserId], [ReadyDate], [TaskDescription], [Remarks], [Date], [StartDate], [EstimatedHours], [RealHours], [NumberArticles], [EstimatedReadyDate], [Status_actief], [StatusId], [DateSendDataSteward]) VALUES (@ProjectId, @BewerkingId, @UserId, @ReadyDate, @TaskDescription, @Remarks, @Date, @StartDate, @EstimatedHours, @RealHours, @NumberArticles, @EstimatedReadyDate, @Status_actief, @StatusId, @DateSendDataSteward)" 
        UpdateCommand="UPDATE [tblTasks] SET [ReadyDate] = @ReadyDate,  [RealHours] = @RealHours, [StatusId] = @StatusId WHERE [TaskId] = @TaskId">  
        <SelectParameters> 
<asp:SessionParameter DefaultValue="0" Name="UserId" SessionField="UserId"   
                Type="Int32" /> 
                        </SelectParameters> 
        <DeleteParameters> 
            <asp:Parameter Name="TaskId" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="ReadyDate" Type="DateTime" /> 
            <asp:Parameter Name="RealHours" Type="Decimal" /> 
            <asp:Parameter Name="StatusId" /> 
            <asp:Parameter Name="TaskId" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:SessionParameter Name="ProjectId" SessionField="ProjectId" Type="Int32" /> 
            <asp:Parameter Name="BewerkingId" Type="Int32" /> 
            <asp:Parameter Name="UserId" Type="Int32" /> 
            <asp:Parameter Name="ReadyDate" Type="DateTime" /> 
            <asp:Parameter Name="TaskDescription" Type="String" /> 
            <asp:Parameter Name="Remarks" Type="String" /> 
            <asp:Parameter Name="Date" Type="DateTime" /> 
            <asp:Parameter Name="StartDate" Type="DateTime" /> 
            <asp:Parameter Name="EstimatedHours" Type="Int32" /> 
            <asp:Parameter Name="RealHours" Type="Int32" /> 
            <asp:Parameter Name="NumberArticles" Type="Int64" /> 
            <asp:Parameter Name="EstimatedReadyDate" Type="DateTime" /> 
            <asp:Parameter Name="Status_actief" Type="String" /> 
            <asp:Parameter Name="StatusId" /> 
            <asp:Parameter Name="DateSendDataSteward" Type="DateTime" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="dsStatus" runat="server" ConnectionString="<%$ ConnectionStrings:dsBewerkingenConnectionString %>" 
        SelectCommand="SELECT [StatusId], [StatusNam] FROM [tblStatusTasks]">  
        <SelectParameters> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="dsFiles" runat="server" ConnectionString="<%$ ConnectionStrings:dsBewerkingenConnectionString %>" 
        SelectCommand="SELECT tblFiles.FileName, tblFiles.ProjectId, tblFiles.FileSaveAs, tblTasks.TaskId, tblFiles.FileId FROM tblFiles LEFT OUTER JOIN FilesPerTask ON tblFiles.FileId = FilesPerTask.FileId LEFT OUTER JOIN tblTasks ON FilesPerTask.TaskId = tblTasks.TaskId AND tblFiles.ProjectId = tblTasks.ProjectId WHERE (tblTasks.TaskId = @TaskId)">  
        <SelectParameters> 
            <asp:ControlParameter ControlID="gvTasksDataSteward" DefaultValue="0" Name="TaskId" 
                PropertyName="Selectedvalue" Type="Int32" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
</asp:Content> 

the VB
 
Partial Class ovz_Datasteward  
    Inherits System.Web.UI.Page  
    Private Function getItemName(ByVal tableName As StringAs String 
        Select Case tableName  
            Case ("DatastewardTasks")  
                Return "DatastewardTasks" 
            Case ("Details")  
                Return "Details" 
            Case Else 
                Return "" 
        End Select 
    End Function 
 
    Protected Sub gvDetails_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gvDetails.ItemCommand  
        If (e.CommandName = "RowClick" AndAlso (e.Item.OwnerTableView.DataSourceID = "dsFiles")) Then 
            If (TypeOf e.Item Is GridDataItem) Then 
                e.Item.Selected = True 
 
                Dim text As String = "Selected File Id is: " & e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("FileId")  
                Dim file As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("FileSaveAs")  
                Dim filename As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("FileName")  
 
                Dim ObjSR As FileStream  
                Dim path As String = System.Configuration.ConfigurationManager.AppSettings("UploadFolder").ToString  
                Dim fileToDownload As String = path + file  
 
                ObjSR = New FileStream(fileToDownload, FileMode.Open, FileAccess.Read)  
                Dim loc_StreamBuffer(ObjSR.Length) As Byte 
                ObjSR.Read(loc_StreamBuffer, 0, ObjSR.Length)  
                ObjSR.Close()  
                Response.AddHeader("content-disposition""attachment; filename=" & filename)  
                Response.BinaryWrite(loc_StreamBuffer)  
                Response.AppendHeader("Content-Length", loc_StreamBuffer.Length.ToString())  
                Response.End()  
            End If 
        End If 
    End Sub 
 
 
 
 
    'Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
    '    If Page.IsPostBack = True Then  
    '    End If  
    'End Sub  
 
 
    Protected Sub gvTasksDataSteward_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gvTasksDataSteward.ItemCommand  
        Dim cmdName As String = e.CommandName  
 
        If cmdName = "Executed" Then 
            Dim Today As Date = Now  
            Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)  
            Dim TaskId As Integer = dataItem("TaskId").Text  
            Dim strSQL As String = _  
                "UPDATE tblTasks " & _  
                "SET " & _  
            "StatusId =  @StatusId, " & _  
            "ReadyDate = @ReadyDate " & _  
                "WHERE TaskId = @TaskId " 
 
            Dim Command As New SqlCommand(strSQL)  
            Command.Parameters.Add(New SqlParameter("@StatusId", SqlDbType.Int)).Value = "5" 
            Command.Parameters.Add(New SqlParameter("@TaskId", SqlDbType.Int)).Value = TaskId  
            Command.Parameters.Add(New SqlParameter("@ReadyDate", SqlDbType.DateTime)).Value = Today  
            DBPortal.Execute(Command)  
 
        Else 
            If cmdName = "NotAccepted" Then 
                Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)  
                Dim TaskId As Integer = dataItem("TaskId").Text  
                Dim strSQL As String = _  
                    "UPDATE tblTasks " & _  
                    "SET " & _  
                "StatusId =  @StatusId " & _  
                    "WHERE TaskId = @TaskId " 
 
                Dim Command As New SqlCommand(strSQL)  
                Command.Parameters.Add(New SqlParameter("@StatusId", SqlDbType.Int)).Value = "3" 
                Command.Parameters.Add(New SqlParameter("@TaskId", SqlDbType.Int)).Value = TaskId  
                DBPortal.Execute(Command)  
            Else 
                If cmdName = "Accepted" Then 
                    Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)  
                    Dim TaskId As Integer = dataItem("TaskId").Text  
                    Dim strSQL As String = _  
                        "UPDATE tblTasks " & _  
                        "SET " & _  
                    "StatusId =  @StatusId " & _  
                        "WHERE TaskId = @TaskId " 
 
                    Dim Command As New SqlCommand(strSQL)  
                    Command.Parameters.Add(New SqlParameter("@StatusId", SqlDbType.Int)).Value = "4" 
                    Command.Parameters.Add(New SqlParameter("@TaskId", SqlDbType.Int)).Value = TaskId  
                    DBPortal.Execute(Command)  
                End If 
            End If 
        End If 
 
        If cmdName = RadGrid.EditCommandName Then 
 
 
        End If 
 
 
        gvTasksDataSteward.Rebind()  
    End Sub 
 
 
 
    Protected Sub gvTasksDataSteward_PreRender(ByVal sender As ObjectByVal e As System.EventArgs) Handles gvTasksDataSteward.PreRender  
        For Each dataItem As GridDataItem In gvTasksDataSteward.Items  
            'toont 'accepted' en 'not accepted' en verbergt 'Executed' indien Status 'Scheduled' is  
            If dataItem("StatusId").Text = "7" Then 
                Dim Accept As Button = DirectCast(dataItem("Accept").Controls(0), Button)  
                Dim NotAccept As Button = DirectCast(dataItem("NotAccept").Controls(0), Button)  
                Dim Executed As Button = DirectCast(dataItem("Executed").Controls(0), Button)  
                Accept.Visible = True 
                NotAccept.Visible = True 
                Executed.Visible = False 
            End If 
 
            'toont 'Executed' en verbergt  'accepted' en 'not accepted' indien Status 'Scheduled' is  
            If dataItem("StatusId").Text = "4" Then 
                Dim Accept As Button = DirectCast(dataItem("Accept").Controls(0), Button)  
                Dim NotAccept As Button = DirectCast(dataItem("NotAccept").Controls(0), Button)  
                Dim Executed As Button = DirectCast(dataItem("Executed").Controls(0), Button)  
                Accept.Visible = False 
                NotAccept.Visible = False 
                Executed.Visible = True 
            End If 
 
        Next 
 
          
    End Sub 
 
End Class 
 
Sebastian
Telerik team
 answered on 20 Jul 2009
4 answers
96 views
Hello,

I'm making the move from ComponentArt to Telerik and have a very novice question, but it's still something I can't seem to get worked out.

I'm trying to create a RadMenu that leaves the menu item for the page I'm currently on highlighted or selected.  I had assumed I could do this using SelectedImageUrl, but it doesn't seem to work.  Here's my code:

<

 

telerik:RadMenu ID="RadMenu1" runat="server" DefaultGroupSettings-OffsetY="-1" EnableEmbeddedSkins="False">

 

 

<DefaultGroupSettings OffsetY="-1"></DefaultGroupSettings>

 

 

<Items>

 

 

<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavCollections_Off.jpg" HoveredImageUrl="~/images/pnavCollections_On.jpg"

 

 

NavigateUrl="/Collections.aspx"

 

 

SelectedImageUrl="~/images/pnavCollections_On.jpg">

 

 

</telerik:RadMenuItem>

 

 

<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavYourSkin_Off.jpg" HoveredImageUrl="~/images/pnavYourSkin_On.jpg"

 

 

NavigateUrl="/Your-Skin.aspx"

 

 

SelectedImageUrl="~/images/pnavYourSkin_On.jpg">

 

 

</telerik:RadMenuItem>

 

 

<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavWhyShea_Off.jpg" HoveredImageUrl="~/images/pnavWhyShea_On.jpg"

 

 

NavigateUrl="/Why-Shea.aspx"

 

 

SelectedImageUrl="~/images/pnavWhyShea_On.jpg">

 

 

</telerik:RadMenuItem>

 

 

<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavFAQ_Off.jpg" HoveredImageUrl="~/images/pnavFAQ_On.jpg"

 

 

NavigateUrl="/FAQ.aspx" SelectedImageUrl="~/images/pnavFAQ_On.jpg">

 

 

</telerik:RadMenuItem>

 

 

<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavWheretoBuy_Off.jpg" HoveredImageUrl="~/images/pnavWheretoBuy_On.jpg"

 

 

NavigateUrl="/Where-to-Buy.aspx"

 

 

SelectedImageUrl="~/images/pnavWheretoBuy_On.jpg">

 

 

</telerik:RadMenuItem>

 

 

<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavNewsEvents_Off.jpg" HoveredImageUrl="~/images/pnavNewsEvents_On.jpg"

 

 

NavigateUrl="/News-Events.aspx"

 

 

SelectedImageUrl="~/images/pnavNewsEvents_On.jpg">

 

 

</telerik:RadMenuItem>

 

 

</Items>

 

</

 

telerik:RadMenu>

 


And here's a live example of this menu in the website I am currenly building: http://treehut.beyondigital.com/

So for example, if you visit http://treehut.beyondigital.com/Collections.aspx, I'd like for this image to be selected: pnavCollections_On.jpg

Any help would be greatly appreciated!
ManniAT
Top achievements
Rank 2
 answered on 20 Jul 2009
1 answer
237 views
Hello,
I have a problem with RadColorPicker in a RadGrid.

<telerik:Radgrid ID="RadGrid1" (...)> 
  (...) 
  <MasterTableView (...)> 
    <EditFormSettings EditformType="Template"
      <FormTemplate> 
        (...) 
        <tr> 
          <td> 
            <span>Couleur: </span> 
          </td> 
          <td> 
            <telerik:RadColorPicker ID="RadColorPicker1" runat="server" Preset="Standard" ShowIcon="true" Skin="Black" PaletteModes="All" SelectedColor='<%# HexStringToColor(myCStr(Bind("Couleur"))) %>'
            </telerik:RadColorPicker> 
          </td> 
        </tr> 
        (...) 
      </FormTemplate> 
    </EditFormSettings> 
  </MasterTableView> 
</RadGrid> 

In my code behind :

    Function HexStringToColor(ByVal hex As StringAs System.Drawing.Color 
        hex = hex.Replace("#"""
        If hex.Length <> 6 Then 
            Throw New Exception(hex & " n'est pas une valeur de couleur hexadecimale valide."
        End If 
        Dim r, g, b As String 
        r = hex.Substring(0, 2) 
        g = hex.Substring(2, 2) 
        b = hex.Substring(4, 2) 
        Return System.Drawing.Color.FromArgb(HexStringToBase10Int(r), HexStringToBase10Int(g), HexStringToBase10Int(b)) 
 
    End Function 
 
    Function HexStringToBase10Int(ByVal hex As StringAs Integer 
        Dim base10value As Integer = 0 
        Try 
            base10value = System.Convert.ToInt32(hex, 16) 
        Catch ex As Exception 
            base10value = 0 
        End Try 
 
        Return base10value 
    End Function 
 
    Function myCStr(ByVal test As ObjectAs String 
        If isdbnull(test) Then 
            Return ("#ffffff"
        Else 
            Return CStr(test) 
        End If 
    End Function 



When I do :
 SelectedColor='<%# HexStringToColor(myCStr(Eval("Couleur"))) %>'
It's works for the display but when i edit the value, the database is not updated.

How can I do?

Thanks in advance


Tsvetie
Telerik team
 answered on 20 Jul 2009
2 answers
168 views
Hi
I am having the div in master page

<

body>

 

 

<div class="pagediv">

 

</div></body>

Style.css

.pagediv

{

 

width: 950px;

 

 

top: 10px;

 

 

margin:0 auto 0;

 

}


Inside the div only i am having all the controls.If i use the rad combo the dropdown list of radcombo not align left of the Radcombox  instead of its aligning center of the radcombo.The same problem in Grid filter dropdownlist  If i click any column's filter image the dropdown always coming center of the page only.

If i remove the margin:0 auto 0; from div style its working fine.but i need to place this div center of the page.

what i need to do? 
How can i attach my style sheet or sample application  (if you need) ?

Regards
Vairam

 

 

Evgeny Zyuzin
Top achievements
Rank 1
 answered on 20 Jul 2009
1 answer
80 views
Would anyone know if it is possible to extend RecurrenceRule to create recurring appointments every two weeks?
Peter
Telerik team
 answered on 20 Jul 2009
5 answers
165 views
I've got a few problems with font/ default font.
in FireFox for the empty editor window, select any font and font size, click back on the editor and selection is GONE, there is a WorkAround to do select-all first and then change a font, but it's not an option.
Second. Default font in IE don't applied, let's say you have Times New Roman 12 as a default in editor, so you put some text, in generated text Default Font is not present. so if this HTML will be saved into db and then shown on another page, it won't respect default font....
Rumen
Telerik team
 answered on 20 Jul 2009
1 answer
58 views

Greetings,

Sorry about the question title.  It should read:

"Using 'pasteHtml' to capture the value of an external input button"

I found the following code here on site with the associated title:

The following example will show you how to paste content into the editor's content area from an external input button:
----------------------------------------------------------------------------------------------------------------------------- 
<telerik:radeditor runat="server" ID="RadEditor1"></telerik:radeditor>
<input type="button" value="Paste Content" onclick="InsertSpan();return false;" />

<script type="text/javascript">
function InsertSpan()
{                 
  var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to the editor
  editor.pasteHtml('<span style="width:100px;border: 1px solid red;background-color: blue;color: white;">sample content</span>');
}
</script>    
-----------------------------------------------------------------------------------------------------------------------------

Can anybody explain to me how this does _anything_ with a value outside the RadEditor.  Seems to me there is a very necessary piece left out of the example.  For instance, when using  'OnClientCommandExecuting(editor, args)' to do this kind of thing 'within' the editor, the args parameter is used to produce the value of 'val':

var val = args.get_value();

editor.pasteHtml("<div style='width:100px;background-color:#fafafa;border:1px dashed #aaaaaa;'>" + val + "</div>");

As we can see, the code provided for the external input doesn't come close to addressing how to handle the outside value.

Am I missing something here??

Thanks!

 

Rumen
Telerik team
 answered on 20 Jul 2009
1 answer
112 views
Hello,

When I run the code below, postback, the data binds disappears completely, what is the solution to keep the data and just change the radcombobox?

Protected Sub RadScheduler1_FormCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated 
 
   Dim CB_Groupe As RadComboBox = TryCast(e.Container.FindControl("CB_Groupe"), RadComboBox) 
   Dim CB_Forfait As RadComboBox = TryCast(e.Container.FindControl("CB_Forfait"), RadComboBox) 
   CB_Forfait.Items.Add(New Telerik.Web.UI.RadComboBoxItem(CB_Groupe.SelectedValue)) 
   CB_Groupe.AutoPostBack = True 
   AddHandler CB_Groupe.SelectedIndexChanged, AddressOf CB_Groupe_SelectedIndexChanged 
 
End Sub 
 
Protected Sub CB_Groupe_SelectedIndexChanged(ByVal o As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs) 
   Lbl_titre.Text = "j'ai changé" 
End Sub 

Peter
Telerik team
 answered on 20 Jul 2009
1 answer
119 views
Since I'm new to all Telerik controls, I might be missing something easy. Problem is I can't see the Custom Atttibutes value when I edit an appointment.
I have a field, ROOM varchar(30), in my SQL database and added a Custom Attribute ROOM. When adding new appointments, the ROOM attribute shows up nicely, and when I enter some text into this field, it is saved in the database. Thats good! 
But when I want to edit the appointment the ROOM textbox is empty - not as expected. So when I save the changes. the Room field is overwritten with a blank. All the standard fields works perfect.

Shouldn't I see the saved value for the attribute, or do I need to do something additional?
I have used the Datasource Wizzard in VS to create the SQLconnection. My Select command is "SELECT * from [Appointments]"

Atle


Peter
Telerik team
 answered on 20 Jul 2009
1 answer
101 views
Hello

I am loading in a treeview in a combo box for a user editing page...the combox box loads demographics, On first load if you have previously selected demographics i have got the combo to select the previous one you have chosen from the database but comparing the text and using the following

If

 

Me.RadComboBox1.Attributes.Item("TreeviewSelectedItem") Is Nothing Then

 

 

If objuser.DivisionTwo <> 0 Then

 

 

Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.DivisionTwoDesc)

 

 

ElseIf objuser.DivisionOne <> 0 Then

 

 

Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.DivisionOneDesc)

 

 

ElseIf objuser.PearsonBusiness <> 0 Then

 

 

Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.PearsonBusinessDesc)

 

 

Else

 

 

Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", "Please select a division")

 

 

End If

 

 

End If

this works and does preload the correct demographic in the combobox, but problem is when you press 'save' again and havent changed the combo box when it goes to save the demos if have this code to get the chosen id

 

 

Dim NewRadTreeDivisions As Telerik.Web.UI.RadTreeView

 

 

Dim DivisionValue As Integer

 

 

 

 

NewRadTreeDivisions = RadComboBox1.Items(0).FindControl(

"RadTreeView1")

 

 

If NewRadTreeDivisions.SelectedValue = "" Then

 

 

 

 

DivisionValue = 0

 

Else

 

 

 

 

DivisionValue = NewRadTreeDivisions.SelectedValue

 

End If

 

 

 

 

 



but now at this point NewRadTreeDivisions.SelectedValue  does equal "" therefore sets it back to 0.  even though the correct text is shown in the box the value isnt being passed through...how can i get this to keep the id???

thank you!

 

Yana
Telerik team
 answered on 20 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?