Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
129 views
I currently have a situation where i need to insert some meta information into my HTML content, that isn't valid HTML syntax.  Ultimately this information gets removed before the final product is visible to public users and the HTML will be valid, but internal users creating the document need to be able to enter this information and not have the RadEditor rewrite it when switching between design and html view.

An example would be something like this:

<table>
[BeginRepeater]
<tr>
<td> something here</td>
</tr>
[EndRepeater]
</table>

When i switch to design mode this HTML gets re-written to look like this:

[BeginRepeater]
[EndRepeater]
<table>
<tr>
<td> something here</td>
</tr>
</table>

So my question is this, is there  a way to disable or turn off this html rewrite?

my Editor tag looks like this:

 <telerik:RadEditor ID="EMailContentEditor" runat="server" Skin="Web20"  Width="95%" ContentFilters="RemoveScripts,IndentHTMLContent" ConvertToXhtml="false" ConvertFontToSpan="false" ExternalDialogsPath="/EditorDialogs" EditModes="Design,Html" Height="600px" OnClientCommandExecuting="OnClientCommandExecuting" OnClientLoad="OnClientLoad">

Regards,
-Mark
Ianko
Telerik team
 answered on 15 Oct 2013
10 answers
140 views
Hello ...
I have a combobox outside a RadGrid and I have to take the selected value and insert it in record.

I tried to use insertcommand but I don't know how to refer to the value.

With the normal asp.net controls it was quite easy ...

I wrote a code for Iteminserting event:
e.values("fieldName") = myValue ...


Now, I am disoriented ...


Thanks
Konstantin Dikov
Telerik team
 answered on 15 Oct 2013
1 answer
47 views
Is it possible to enter a soft hyphen (&shy;) in design mode?
Ianko
Telerik team
 answered on 15 Oct 2013
2 answers
257 views

the problem is this, I added update panel to my page and even tried the RadAjax panel as well and both had the same trouble.  The site works fine without the ajax, but as soon as I ajaxify and then click on one of my link buttons on the radgrid it pulls up all the modalpopup windows on the page and I do mean all of them.  I went back and checked the modal opoups to make sure its calling the correct panels and buttons and each have there own, and like I said it calls only 1 when the page has no update panels.  The following is the code of the radgrid.

The first one is a command item button that I am calling and the second sits on the datarow to add notes.  I check all code behind and the only places I am calling the show is in this ItemCommand event.  It makes no sense that the page works perfectly fine without ajax panels but when I put them in no matter which item command I call i shows both modal pop-ups.  I would switch to Radwindow  but there is data being saved via the pop-ups.

Protected Sub myradgrid_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles myradgrid.ItemCommand
       If (e.CommandName = "Tran") Then     (this is a command item template button)
           Dim IssueIDs As String = ""
           For Each item As GridDataItem In myradgrid.Items
               Dim cb As CheckBox = item.FindControl("cbTransfer")
               Dim IssueId As String = item.GetDataKeyValue("intIssuedID").ToString
               If cb.Checked = True Then
                   IssueIDs += IssueId & ","
               End If
           Next
 
           'Check to see if they checked anything
           If IssueIDs = Nothing Then
               ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "noCheckbox();", True)
           Else
               'Get the Issued Ids remove end comma to put in variable
               IssueIDs = IssueIDs.Remove(IssueIDs.Length - 1, 1)
               HFIssuedId.Value = IssueIDs
               FindEquip(IssueIDs)
           End If
       End If
 
       If (e.CommandName = "EditNotes") Then  ( this is a row link button  in radgrid)
           Dim Id As Integer = e.CommandArgument
 
           HFNotesID.Value = Id
 
           If CheckAdmin() = True Then
               GetNotes()
           End If
           pnlNotes_MPE.Show()
       End If
 
       If e.CommandName = "ExportToExcel" Then
           IsExport = True
           myradgrid.Columns(0).Visible = False
           myradgrid.Columns(3).Visible = False
           myradgrid.MasterTableView.GetColumn("NOTES").Visible = True
           myradgrid.ExportSettings.FileName = Replace(HFDigSig.Value, "'", "''") & "-iPBRHR"
       End If
   End Sub

This is the fillEquip of the 1st Item command that calls the popup.

'get the items that where transferred to another user.
   Private Sub FindEquip(ByVal EquipId As String)
       
       sql = "statement"
     
       myRadItems.DataSource = getReader(sql)
       myRadItems.DataBind()
 
       pnlpop_MPE.Show()
   End Sub





































Kevin
Top achievements
Rank 1
 answered on 15 Oct 2013
1 answer
60 views
i have this code

<div style="width:100%; height:100%;">
<table style="height:100%; width:100%;" border="0" cellspacing="0" cellpadding="0">
    <tr style="height:100%; width:100%;">
        <td style="height:100%; width:100%;">
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" Height="100%" DataSourceID="SqlDataSource1" GridLines="None" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True">
    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="true" ></Scrolling>
    </ClientSettings>
 
    <MasterTableView AutoGenerateColumns="True" DataKeyNames="ID" DataSourceID="SqlDataSource1" >
        <Columns>
            
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
            </td>
        </tr>
</table>  
    </div>

what i want is that the rad grid can get a horital and vertical scroll bar and static header and footer nasd the columns dont get on each other i tried many thing but nothing worked. Can anybody help.

Best Regards.
Carlos Sequeira
Konstantin Dikov
Telerik team
 answered on 15 Oct 2013
2 answers
70 views

I've emails saved in database like this : XXXXXX <XXXX@main.com>
The RadGrid does not load the email between <>.

onlye show XXXXX.

How I can resolve this issue?

regards
July
Top achievements
Rank 2
 answered on 15 Oct 2013
3 answers
93 views
I would like to store different RadGrids' settings in one storage provider key file per user. i.e. all settings throughout the application for a user would be in one file. I am using the custom grid settings provider as per your demo and using the loadcustomsettings and savecustomsettings events to manage the custom settings. However when I add a setting for a grid it overwrites the entire file deleting any other settings that are added from other pages. I was hoping that using customsettings.add would just add/update that setting and leave the others alone. i.e. it would only affect the controlsetting with the provided name.

Here is the code I have for the persistence events. The same code exists on all the pages that have grids except the name when adding the settings is different (e.g. clinics, users, patients etc).

void PersistManager_LoadCustomSettings(object sender, PersistenceManagerLoadStateEventArgs e)
        {
            GridSettingsPersister loadPersister = new GridSettingsPersister(RadGrid1);
            string settings = (string)e.CustomSettings.ControlSettings[0].Value;
            loadPersister.LoadSettings(settings);
            RadGrid1.Rebind();
        }
 
        void PersistManager_SaveCustomSettings(object sender, PersistenceManagerSaveStateEventArgs e)
        {
            GridSettingsPersister savePersister = new GridSettingsPersister(RadGrid1);
            e.CustomSettings.Add(new Telerik.Web.UI.ControlSetting() { Name = "clinics", Value = savePersister.SaveSettings() });
        }
Daniel
Telerik team
 answered on 15 Oct 2013
1 answer
94 views

Hi,
How to set confirmation on delete. I want to show a window asking for delete confirmation when user clicks delete button.

Thanks,
Dawson. 
Princy
Top achievements
Rank 2
 answered on 15 Oct 2013
4 answers
217 views

Trying to use a RadSearchBox in a FilterTemplate while using OpenAccess (I believe using simple binding?)  -  not sure how to get the filtering to work/in code behind - looked at several samples/demos - but none seem to show how or if it will work when using OpenAccess (trying to stick with simple binding if possible)

Test code below

 

 

<telerik:RadGrid ID="RadGridResults" runat="server" AutoGenerateColumns="False"
 
 CellSpacing="0" DataSourceID="OpenAccessLinqDataSource"
 
 GridLines="None" AllowPaging="True"
 
 AllowSorting="True" EnableLinqExpressions="False"
 
 AllowFilteringByColumn="True">
 
 <ClientSettings>
 
 <Scrolling AllowScroll="True" UseStaticHeaders="True" />
 
 </ClientSettings>
 
 <MasterTableView DataKeyNames="ProductID"
 
 DataSourceID="OpenAccessLinqDataSource1">
 
 <Columns>
 
 <telerik:GridBoundColumn DataField="ProductRef" FilterControlAltText="Filter Product Ref column"
 
 HeaderText="ProductRef" SortExpression="ProductRef" UniqueName="ProductRef">
 
 </telerik:GridBoundColumn>
 
 <telerik:GridDropDownColumn FilterControlAltText="Filter Brand Name column" UniqueName="ProductBrandName"
 
 DataSourceID="OpenAccessLinqDataSourceBrandName" DataField="ProductBrandNameID"
 
 HeaderText="Brand Name" SortExpression="CompanyName" ListValueField="CompanyID"
 
 AllowSorting="true" ListTextField="CompanyName" DropDownControlType="DropDownList">
 
 <FilterTemplate>
 
 <telerik:RadSearchBox ID="RadSearchBox1" runat="server" DataSourceID="OpenAccessLinqDataSourceBrandName"
 
 DataTextField="CompanyName" DataValueField="CompanyID" ShowSearchButton="False" OnSearch="RadSearchBox1_Search">
 
 </telerik:RadSearchBox>
 
 </FilterTemplate>
 
 </telerik:GridDropDownColumn>

Tried using code below but DataBind() causes error 'Expression Expected' - have set 'EnableLinqExpressions=False' - as per other threads/samples

 

 

 

Protected Sub RadSearchBox1_Search(sender As Object, e As SearchBoxEventArgs)
 
 RadGridResults.MasterTableView.FilterExpression = "([ProductBrandName] = " + e.Text + ")"
 
 Dim column As GridColumn = RadGridResults.MasterTableView.GetColumnSafe("ProductBrandName")
 
 column.CurrentFilterFunction = GridKnownFunction.EqualTo
 
 column.CurrentFilterValue = e.Text
  
 RadGridResults.DataBind()
  
 End Sub

 

 

 

 


Calsh
Top achievements
Rank 1
 answered on 15 Oct 2013
2 answers
374 views
hi,

I am using telerik radgrid in my application  hierarchical model. in detailtables i have one  GridTableView. in the GridTableView i have a GridTemplateColumn in which i have two radio buttons and one textbox. when user enters a value in the textbox and click radio button it should fill all the other textboxes  of the row edited or inserted based on some calculation.

The design as follows.
Please advice me how to work ?
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" Skin="Black" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated"
    AllowSorting="True" AllowMultiRowSelection="False" OnItemCommand="RadGrid1_ItemCommand" AutoGenerateEditColumn="false"
    OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand"
    OnPreRender="RadGrid1_PreRender" >
 
    <MasterTableView DataKeyNames="TempAccountsId" ShowFooter="true" TableLayout="Fixed" AllowMultiColumnSorting="True"  EditMode="InPlace" >
        <DetailTables>
            <telerik:GridTableView DataKeyNames="CleaningId" CommandItemDisplay="Top"  TableLayout="Fixed" Name="Cleaning" ShowFooter="true" EditMode="InPlace" AllowAutomaticUpdates="false">
                <Columns>
                    <telerik:GridTemplateColumn Visible="false">
                        <ItemTemplate>
                            <asp:Label ID="lblCleaningId" runat="server" Text='<%#Eval("CleaningId") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit" UniqueName="Edit" ItemStyle-Width="25px" HeaderStyle-HorizontalAlign="Center"
                        EditImageUrl="../Images/edit.gif" ItemStyle-HorizontalAlign="Center">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridTemplateColumn HeaderText="Delete" UniqueName="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:ImageButton runat="server" ID="imgdelete" OnClientClick="return confirm('Are you sure that you want to Delete?');"
                                ImageUrl="../Images/delete.gif" CommandName="Delete" CommandArgument="" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                 
                     
 
                    <telerik:GridTemplateColumn HeaderStyle-Width="180" UniqueName="Rate" HeaderText="Rate" ItemStyle-HorizontalAlign="Left"
                            HeaderStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Right">
                            <ItemTemplate>
                                <asp:RadioButton ID="rdbtnPerSqft" runat="server" Text="PerSqft" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>' />
                                <asp:RadioButton ID="rdbtnFlat" runat="server" Text="Flat" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>' />
                            </ItemTemplate>
                        <EditItemTemplate>
                             <asp:RadioButton ID="rdbtnPerSqftEdit" runat="server" Text="PerSqft" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>'   />
                                <asp:RadioButton ID="rdbtnFlatEdit" runat="server"  CommandName="Flatrate" Text="Flat" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>' />
                                <asp:TextBox ID="txtRateEdit" runat="server"  Width="55" CssClass="AlgRgh" Visible="true"  Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'
                                    onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px" ></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:RadioButton ID="rdbtnPerSqftinsert"  runat="server" Text="PerSqft" GroupName="Rate"    />
                                <asp:RadioButton ID="rdbtnFlatinsert" runat="server" Text="Flat" GroupName="Rate"   />
                                <asp:TextBox ID="txtRateinsert" runat="server"  Width="55"  CssClass="AlgRgh"
                                    onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px" ></asp:TextBox>
                        </InsertItemTemplate>
                        </telerik:GridTemplateColumn>
 
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="AccountId" UniqueName="TempAccountsId" Visible="false">
                <ItemTemplate>
                    <asp:Label ID="lblTempAccountsId" runat="server" Text='<%#Eval("TempAccountsId") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Account Number" UniqueName="AccountNumber" ItemStyle-Width="120px" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                <ItemTemplate>
                    <asp:Label ID="lblAccountNumber" runat="server" Text='<%#Eval("AccountNumber") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Account Name" UniqueName="AccountName" ItemStyle-Width="140px" HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                <ItemTemplate>
                    <asp:Label ID="lblAccountName" runat="server" Text='<%#Eval("AccountName") %>'></asp:Label>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Label ID="lbltotalFooter" runat="server" Text="Total:"></asp:Label>
                </FooterTemplate>
            </telerik:GridTemplateColumn>
             
        </Columns>
    </MasterTableView>
    <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true">
        
    </ClientSettings>
</telerik:RadGrid>
courtney shoell
Top achievements
Rank 1
 answered on 15 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?