Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
1.3K+ views

I have a grid that allows inserting and updating.  I would like to set the default value of three fields in the grid and not allow the user to change those values.  It would be even better if these fields weren't even visible.  The "ScoreGroupId" should get it's value from a hidden field titled "hdnScoreGroupId".  "ScoreCrtdBy" should be the current user - "HttpContext.Current.User.Identity.Name".  And "ScoreCrtdDt" is the current date and time and should use "DateTime.Now.ToString()".  How can I do this for the following grid:

<telerik:RadGrid ID="rgScores" runat="server" Skin="Office2010Black" DataSourceID="sdsRgScores" AutoGenerateColumns="False">
     <MasterTableView DataKeyNames="Id" DataSourceID="sdsRgScores" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">
          <Columns>
               <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
               <telerik:GridBoundColumn DataField="Id" ReadOnly="True" HeaderText="Id" SortExpression="Id" UniqueName="Id" DataType="System.Int32" FilterControlAltText="Filter Id column"></telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="ScoreGroupId" HeaderText="ScoreGroupId" SortExpression="ScoreGroupId" UniqueName="ScoreGroupId" DataType="System.Int32" FilterControlAltText="Filter ScoreGroupId column"></telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="ScoreCrtdBy" HeaderText="ScoreCrtdBy" SortExpression="ScoreCrtdBy" UniqueName="ScoreCrtdBy" FilterControlAltText="Filter ScoreCrtdBy column"></telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="ScoreCrtdDt" HeaderText="ScoreCrtdDt" SortExpression="ScoreCrtdDt" UniqueName="ScoreCrtdDt" DataType="System.DateTime" FilterControlAltText="Filter ScoreCrtdDt column"></telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="Score" HeaderText="Score" SortExpression="Score" UniqueName="Score" DataType="System.Int32" FilterControlAltText="Filter Score column"></telerik:GridBoundColumn>             
          </Columns>
     </MasterTableView>
</telerik:RadGrid>
Tsvetomir
Telerik team
 answered on 20 Sep 2018
4 answers
556 views

I am trying to add a Table of Contents to a RadFlowDocument.  I then export it to PDF.  However, there is never anything in the TOC.  If I replace the second parameter in the InsertField statement with "results", I see the word results on top of the document.  The below snippet has what I think are the important parts of the code.

I am hoping that this is something obvious that I am missing, but either way, any help would be appreciated.

public static IFormatProvider < RadFlowDocument > GetFormatProvider ( string extension )
{
    if ( !extension.StartsWith ( "." ) ) extension = "." + extension;
    switch ( extension.ToLower() )
    {
        case ".docx": return new DocxFormatProvider();
        case ".html": return new HtmlFormatProvider();
        case ".pdf"return new PdfFormatProvider();
        case ".rtf"return new RtfFormatProvider();
        case ".txt"return new TxtFormatProvider();
        default:      return null;
    }
}
...
var editor = new RadFlowDocumentEditor(doc);
var tocField = editor.InsertField("TOC \\o \"1-3\" \\h \\z \\u", "");
tocField.IsDirty = true;
tocField.UpdateField();
using(var ms = new MemoryStream())
[
    requestedDocType.Provider?.Export ( doc, ms );
    return ms.ToArray();
}
...
Boby
Telerik team
 answered on 20 Sep 2018
1 answer
148 views
I am using the RadPersistenceManager and I want to save user preferences when they change the screen layout.How can I trigger my save logic when a column is Hidden (I am using Excel-like filtering)? Is there any server-side events that fire when a column is hidden?
Marin Bratanov
Telerik team
 answered on 20 Sep 2018
1 answer
1.3K+ views

If I change the Height (i.e. 10px) of a RadLinkButton, no matter what I do, I can't get the Text to vertical align.  Is this a bug or can someone provide me an example on how to get the Text to correctly align vertically?

<tr>
    <td style="width:8px"></td>
    <td style="text-align:center; vertical-align:middle">
        <telerik:RadLinkButton ID="rlbn_ResetPassword" runat="server" Text="Reset Password" RenderMode="Lightweight" Height="10px" Font-Size="Small" Style="vertical-align:middle"></telerik:RadLinkButton>
    </td>
    <td style="width:8px"></td>
</tr>

 

Cheers, Rob.

Rumen
Telerik team
 answered on 20 Sep 2018
3 answers
129 views

Could someone help me understand the differences between these two controls and why one would be used over the other?

After reading the documentation they seem VERY VERY similar so I'm not sure why both exists.

Cheers, Rob.

Rumen
Telerik team
 answered on 20 Sep 2018
1 answer
92 views
Hi,
Am able to enter comments using Rich Text editor for my project [at Design and HTML modes] using Firefox version prior to 62.0 but unable to enter comments  in Version - 62.0 only [Especially at design mode]. Attaching screenshots for reference.
Please help me on this
Rumen
Telerik team
 answered on 19 Sep 2018
5 answers
565 views

Hi,
When I try to copy-paste contents from word to rad editor, the contents are getting copied without any formatting in IE 11 while there is no issue with other browsers like Firefox or Chrome. In other browsers the formatting is proper for the copied text. Please provide a fix for this issue.

Thanks,

Anjo.

Rumen
Telerik team
 answered on 19 Sep 2018
3 answers
703 views
When using ASP.NET 4.5 and you have some ASP validation controls on the page together with a postback control from the RadControls for ASP.NET AJAX suite, the following exception will be thrown:

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).

This can be reproduced with the following simple markup:
<telerik:RadScriptManager runat="server" ID="ScriptManager1">
</telerik:RadScriptManager>
 
<telerik:RadComboBox runat="server" ID="ComboBox1"></telerik:RadComboBox>
 
<asp:Button ID="Button1" runat="server" Text="Submit" />
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ErrorMessage="Choose a destination first" ControlToValidate="ComboBox1" />

According to Microsoft, unobtrusive validation is the new way ASP.NET net validators work and it by default requires jQuery. We ship jQuery with our controls, but we did not register it the way Microsoft wants before Q3 2012 SP1. Proper resource mapping was added in the Q3 Service Pack 1 release. In the meantime the following steps will allow you to use this feature:

1. Add Global.asax file to the project
2. Put the following code in the Application_Start event:
var def = new ScriptResourceDefinition()
            {
                ResourceName = "Telerik.Web.UI.Common.jQuery.js",
                ResourceAssembly = System.Reflection.Assembly.GetAssembly(typeof(Telerik.Web.UI.RadWebControl))
            };
 
ScriptManager.ScriptResourceMapping.AddDefinition("jquery", def);


NOTE: There is currently a bug in the default ASP ScriptManager that requires jQuery to be the first script registered on the page in order for Unobtrusive Validation to work: http://connect.microsoft.com/VisualStudio/feedback/details/748064/unobtrusive-validation-breaks-with-a-script-manager-on-the-page.
Vessy
Telerik team
 answered on 19 Sep 2018
4 answers
178 views

It seems Map "remembers" file it was originally loaded with. Meaning if i change file content, Map still loads with an old one. I used to workaround this issue by changing file name every time i load.

Not sure if any new solutions to the issue were introduced recently.

Thank you

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 18 Sep 2018
2 answers
1.0K+ views

I have two filter columns in my grid; however, only one filter (Status) is working. The second filter (Classification) is not working ( alone or in combination with first). I followed Demo example from https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultvb.aspx

 

 <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" Width="100%"   AllowFilteringByColumn="True"
            AllowSorting="True" AllowPaging="True" PageSize="7" runat="server" AutoGenerateColumns="False"
            ShowStatusBar="true" EnableLinqExpressions="false">
            <MasterTableView DataKeyNames="InstitutionID" TableLayout="Fixed">
                <Columns>
                    <telerik:GridBoundColumn UniqueName="InstitutionID" DataField="InstitutionID" HeaderText="Institution ID"
                        AllowFiltering="false" HeaderStyle-Width="200px" />
                     
                   <telerik:GridBoundColumn UniqueName="PrgOffStatus" DataField="PrgOffStatus" HeaderText="Status" HeaderStyle-Width="200px">
                        <FilterTemplate>
                            <telerik:RadComboBox RenderMode="Lightweight" ID="RadComboBoxCity"   
                                  Width="100px" AppendDataBoundItems="true" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("PrgOffStatus").CurrentFilterValue %>'
                                runat="server" OnClientSelectedIndexChanged="CityIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="All" />
<telerik:RadComboBoxItem Text="Active" Value="Active" />
                                            <telerik:RadComboBoxItem Text="Discontinued" Value="Discontinued" />
                                            <telerik:RadComboBoxItem Text="Suspended" Value="Suspended" />   
                                </Items>
                            </telerik:RadComboBox>
                            <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                                <script type="text/javascript">
                                    function CityIndexChanged(sender, args) {
                                        var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
tableView.filter("PrgOffStatus", args.get_item().get_value(), "EqualTo");
                                }
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ProgramClass" HeaderText="Classification" UniqueName="ProgramClass"
                        HeaderStyle-Width="200px" >
                        <FilterTemplate>
                            <telerik:RadComboBox RenderMode="Lightweight" ID="RadComboBoxCountry"    
                                 Width="100px" AppendDataBoundItems="true" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("ProgramClass").CurrentFilterValue %>'
                                runat="server" OnClientSelectedIndexChanged="CountryIndexChanged">
                                <Items>
                                     <telerik:RadComboBoxItem Text="All" Value="" />
                                           <telerik:RadComboBoxItem Text="Program" Value="Program" />
                                            <telerik:RadComboBoxItem Text="Concentration" Value="Concentration" />
                                            <telerik:RadComboBoxItem Text="Certificate" Value="Certificate" /> 
            <telerik:RadComboBoxItem Text="NoAward" Value="NoAward" />
                                </Items>
                            </telerik:RadComboBox>
                            <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
                                <script type="text/javascript">
                                    function CountryIndexChanged(sender, args) {
                                        var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
tableView.filter("ProgramClass", args.get_item().get_value(), "EqualTo");
                                }
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                         
                    </telerik:GridBoundColumn>
                  
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

 

 

prasadsa01
Top achievements
Rank 1
 answered on 18 Sep 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?