Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
70 views

Currently we are in the process of securing our web sites. we are experiencing issue on Xhtml Validator in RadEditor where it is not properly loading due to mixed content issue. Is there way can redirect to HTTPS instead of HTTP site.

We can reproduce this on Rad Editor demo site by making site as HTTPS and click on XHTML Validator icon.

https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

Ianko
Telerik team
 answered on 07 Jan 2016
4 answers
760 views

Hi

I have a context menu on a RadGrid, with 3 options, 2 of these are functions for the server, and I'm able to send back the index and get the ID serverside.

For the 3rd option I want to open a pop up window, and pass in the primary key of the row that was selected.

Is there an example of how this can be done?

Andy

Veselin Tsvetanov
Telerik team
 answered on 07 Jan 2016
3 answers
141 views
I'm running into a line after closing the mobile menu before it's clicked you can find the arrow in random places on the page. One image shows after the menu being opened the other is before the menu is clicked on. This only happens on mobile
Dimitar
Telerik team
 answered on 07 Jan 2016
3 answers
343 views

Hi,

   I am using a RadTreeView for displaying certain data in our application.Lets say I need to display 20 records (5 types and 4 records per type. Example: 20 cities where 4 cities each are grouped to a state). In my application I can have upto 200-300 such records real time.

My Approach:

I am populating all the tree view during page load. So in theory, I am creating 20 instances of a user control and adding them to the treeview which is causing a huge performance issue.

 

What I need:

I need to populate only the parent nodes (5 states from above) and when expanded on a parent node, dynamically add 4 user controls to that node.

Please suggest if there is an example you have (Request to not share examples that just populates text from a data source. You can hard code the number 4 if that makes it easy) or provide an approach for me to execute.

 

Thanks in advance.

Regards,

Krishna Chaduvula.

Ivan Danchev
Telerik team
 answered on 07 Jan 2016
1 answer
466 views

Hi,

 I am using radgrid version 2015 q2 template column and edit template column I want to implement duplicate record validation in insert and edit mode but I am not able to find controls in insert and edit mode of radgrid  below is my code.

If there is another easy method to validate dublicate record in radgrid plz share with me  thanks.

 

<telerik:RadGrid ID="grdLanguage" runat="server" AllowSorting="True" AllowPaging="True"
                            AllowCustomPaging="True" PagerStyle-Mode="NextPrev" Skin="Bootstrap"
                            ShowGroupPanel="false">
                            <GroupingSettings CaseSensitive="false" />
 
                            <MasterTableView AutoGenerateColumns="False" EditMode="PopUp" DataKeyNames="Language_ID" CommandItemDisplay="Top">
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
                                    </EditColumn>
                                    <PopUpSettings Modal="true" />
                                </EditFormSettings>
                                <CommandItemTemplate>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !grdLanguage.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.png"/>Add new</asp:LinkButton>  
                                </CommandItemTemplate>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridTemplateColumn HeaderText="Language Name">
                                        <ItemTemplate>
                                            <asp:Label ID="lblCertName" runat="server" Text='<%# Bind("Language_Type.Language_Type_Name") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Reading">
                                        <ItemTemplate>
                                            <telerik:RadRating ID="ratReading" runat="server" DbValue='<%# Bind("Read_Skill") %>' ItemCount="5" ReadOnly="true"></telerik:RadRating>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Writing">
                                        <ItemTemplate>
                                            <telerik:RadRating ID="ratWriting" runat="server" DbValue='<%# Bind("Writing_Skill") %>' ItemCount="5" ReadOnly="true"></telerik:RadRating>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
 
                                    <telerik:GridTemplateColumn HeaderText="Speaking">
                                        <ItemTemplate>
                                            <telerik:RadRating ID="ratSpeaking" runat="server" DbValue='<%# Bind("Speaking_Skill") %>' ItemCount="5" ReadOnly="true"></telerik:RadRating>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
 
                                    <telerik:GridEditCommandColumn HeaderText="Edit" ButtonType="ImageButton"></telerik:GridEditCommandColumn>
                                </Columns>
                                <EditFormSettings EditFormType="Template" PopUpSettings-Height="350px" PopUpSettings-Width="600px">
                                    <FormTemplate>
 
                                        <div class="form-horizontal panel panel-primary">
                                            <div class="panel-heading">Previous Experience</div>
                                            <div class="panel-body">
                                                <div>
                                                    <asp:CustomValidator ID="CustValLanguage" OnServerValidate="CustValLanguage_ServerValidate1" ValidationGroup="valLanguage" runat="server" Display="Dynamic"> </asp:CustomValidator>
                                                </div>
                                                <div class="form-group required">
                                                    <asp:Label ID="Label1" CssClass="col-sm-2 control-label" runat="server" Text="Degree"></asp:Label>
 
                                                    <div class="col-sm-10">
                                                        <telerik:RadComboBox ID="ddlLanguage_Type_ID" SelectedValue='<%# Bind("Language_Type_ID") %>' runat="server" Skin="Bootstrap">
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="[Select Item]" Value="0" runat="server" />
                                                                <telerik:RadComboBoxItem Text="Arabic" Value="1" runat="server" />
                                                                <telerik:RadComboBoxItem Text="English" Value="2" runat="server" />
                                                                <telerik:RadComboBoxItem Text="Farsi" Value="5" runat="server" />
                                                                <telerik:RadComboBoxItem Text="French" Value="3" runat="server" />
                                                                <telerik:RadComboBoxItem Text="German" Value="4" runat="server" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                        <br />
                                                        <span>
                                                            <asp:RequiredFieldValidator ControlToValidate="ddlLanguage_Type_ID" InitialValue="[Select Item]" Display="Dynamic" SetFocusOnError="true" CssClass="text-danger" runat="server" ID="RequiredFieldValidator5" ErrorMessage="Language is Required!"
                                                                ValidationGroup="valLanguage"></asp:RequiredFieldValidator></span>
                                                    </div>
                                                </div>
 
                                                <div class="form-group ">
                                                    <asp:Label ID="lblCertName" CssClass="col-sm-2 control-label" runat="server" Text="Reading"></asp:Label>
 
                                                    <div class="col-sm-10">
                                                        <telerik:RadRating ID="ratReading" runat="server" Precision="Item" DbValue='<%# Bind("Read_Skill") %>' ItemCount="5"></telerik:RadRating>
                                                        <span></span>
                                                    </div>
                                                </div>
                                                <div class="form-group ">
                                                    <asp:Label ID="lblCertAuthority" CssClass="col-sm-2 control-label" runat="server" Text="Writing"></asp:Label>
 
                                                    <div class="col-sm-10">
                                                        <telerik:RadRating ID="ratWriting" runat="server" Precision="Item" DbValue='<%# Bind("Writing_Skill") %>' ItemCount="5"></telerik:RadRating>
 
                                                        <span></span>
                                                    </div>
                                                </div>
                                                <div class="form-group ">
                                                    <asp:Label ID="Label2" CssClass="col-sm-2 control-label" runat="server" Text="Speacking"></asp:Label>
 
                                                    <div class="col-sm-10">
                                                        <telerik:RadRating ID="ratSpeaking" Precision="Item" runat="server" DbValue='<%# Bind("Speaking_Skill") %>' ItemCount="5"></telerik:RadRating>
                                                        <span></span>
                                                    </div>
                                                </div>
 
                                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                    runat="server" ValidationGroup="valLanguage" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button
                                                <asp:Button ID="btnCancel" formnovalidate name="cancel" class="cancel" Text="Cancel" runat="server" CausesValidation="False"
                                                    CommandName="Cancel"></asp:Button>
                                            </div>
                                        </div>
 
                                    </FormTemplate>
                                </EditFormSettings>
                            </MasterTableView>
                            <ClientSettings>
                                <ClientEvents OnPopUpShowing="PopUpShowing" />
                            </ClientSettings>
                            <PagerStyle Mode="NextPrev" />
                        </telerik:RadGrid>

 

 

 ServerSide Code

 

  protected void CustValLanguage_ServerValidate1(object source, ServerValidateEventArgs args)
        {
           // Need here to validate code
 
 if (lstLanguage != null || lstLanguage.Count > 0)
            {             
                if (grdLanguage.MasterTableView.IsItemInserted)
                {
                    {
                        RadComboBox ddlLanguage_Type_ID = (RadComboBox)grdLanguage.MasterTableView.GetInsertItem().FindControl("ddlLanguage_Type_ID");
                        for (int i = 0; i < lstLanguage.Count; i++)
                        {
                            if (lstLanguage[i].Language_Type_ID == Convert.ToInt32(ddlLanguage_Type_ID.SelectedValue))
                            {
                                args.IsValid = false;
                                CustomValidator CustValLanguage = (CustomValidator)grdLanguage.MasterTableView.GetInsertItem().FindControl("CustValLanguage");
                                CustValLanguage.ErrorMessage = "Already Exists";
                            }
                        }
 
 
                    }
                }
                else
                {
                   
//                 I want code here to check update record already exist or not in the current list collection
                }
            }
        }

 

 

private List<Language> lstLanguage
        {
            get
            {
                object obj = this.Session["lstLanguage"];
                if ((!(obj == null)))
                {
                    return ((List<Language>)(obj));
                }
                List<Language> lst_Lang = new List<Language>();
                this.Session["lstLanguage"] = lst_Lang;
                return lst_Lang;
            }
            set
            {
                // Adds value to session variable
                this.Session["lstLanguage"] = value;
            }
        }

private void GrdLanguage_ItemCommand(object sender, GridCommandEventArgs e)
       {
 
           switch (e.CommandName)
           {
               case "PerformInsert":
                   if (Page.IsValid)
                   {
                       GridEditFormInsertItem insertedItem = (GridEditFormInsertItem)e.Item.OwnerTableView.GetInsertItem();
 
                       Language obj = new Language();
                       obj.Language_ID = (int)this.lstLanguage.Count + 1;
                       obj.Language_Type_ID = Convert.ToInt32(((RadComboBox)insertedItem.FindControl("ddlLanguage_Type_ID")).SelectedValue);
                       obj.Language_Type.Language_Type_Name = ((RadComboBox)insertedItem.FindControl("ddlLanguage_Type_ID")).SelectedItem.Text;
                       obj.Read_Skill = Convert.ToInt32(((RadRating)insertedItem.FindControl("ratReading")).Value);
                       obj.Writing_Skill = Convert.ToInt32(((RadRating)insertedItem.FindControl("ratWriting")).Value);
                       obj.Speaking_Skill = Convert.ToInt32(((RadRating)insertedItem.FindControl("ratSpeaking")).Value);
 
                       lstLanguage.Add(obj);
                       grdLanguage.Rebind();
 
                   }
                   break;
               case "Update":
                   if (Page.IsValid)
                   {
                       //  GridEditFormInsertItem insertedItem = (GridEditFormInsertItem)e.Item.OwnerTableView.GetInsertItem();
                       GridEditableItem editform = e.Item as GridEditableItem;
 
                       var index = lstLanguage.FindIndex(p => p.Language_ID == (int)editform.OwnerTableView.DataKeyValues[editform.ItemIndex]["Language_ID"]);
 
                       Language obj = new Language();
                       obj.Language_Type_ID = Convert.ToInt32(((RadComboBox)editform.FindControl("ddlLanguage_Type_ID")).SelectedValue);
                       obj.Language_Type.Language_Type_Name = ((RadComboBox)editform.FindControl("ddlLanguage_Type_ID")).SelectedItem.Text;
                       obj.Read_Skill = Convert.ToInt32(((RadRating)editform.FindControl("ratReading")).Value);
                       obj.Writing_Skill = Convert.ToInt32(((RadRating)editform.FindControl("ratWriting")).Value);
                       obj.Speaking_Skill = Convert.ToInt32(((RadRating)editform.FindControl("ratSpeaking")).Value);
 
 
                       lstLanguage[index] = obj;
                       grdLanguage.Rebind();
 
                   }
                   break;
               default:
                   break;
           }
       }
 
       private void GrdLanguage_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
       {
           grdLanguage.DataSource = lstLanguage;
       }

 

 

Kostadin
Telerik team
 answered on 07 Jan 2016
3 answers
172 views
We are trying to create a provider hosted app with a telerik radgrid which will then be hosted from a SP 2013 site.

It is known that Telerik for ASP.Net AJAX is supported in Provider Hosted App. We have include the Telerik.Web.UI dll in the bin folder of the web application. The DLL has also been added to the GAC.

The moment we try to run the app, we get no definitive details other than a generic message "An error has occurred while processing the request".

Our observation is that when we include the following tag in the web.config of the web application, "<location path="Telerik.Web.UI.WebResource.axd" />, the application crashes. 

Are we missing any step ?

Thanks in advance
Girish

Marin
Telerik team
 answered on 07 Jan 2016
13 answers
551 views
Hi, I'm having a problem with my RadGrid control when trying to sort by column
I have a simple Radgrid control which retrieves the data from an ObjectdataSource and once I pick one of the column header the following error is arised ...

Destination array is not long enough to copy all the items in the collection. Check array index and length

However, this issue is appearing when I pick two of the six columns I have in the grid, I mean, the sorting is working fine when selecting the other four columns.

Here is my source code


<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting=True DataSourceID="ODSCompaniesDataSource"
        GridLines="None" Skin="Default2006" AutoGenerateColumns="False" OnEditCommand="EditCommand" OnSortCommand="RadGrid1_SortCommand" ShowGroupPanel="True" >
<ExportSettings>
<Pdf FontType="Subset" PaperSize="Letter"></Pdf>

<Excel Format="Html"></Excel>
</ExportSettings>

<MasterTableView CommandItemDisplay="None" Frame="Border" Dir="LTR" DataSourceID="ODSCompaniesDataSource" CurrentResetPageIndexAction="SetPageIndexToFirst" TableLayout="Auto">
<EditFormSettings>
<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"></EditColumn>
</EditFormSettings>


<ExpandCollapseColumn Visible="False" Resizable="False" CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

<RowIndicatorColumn Visible="False" CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
    <HeaderStyle BackColor="#5959EE" />

    <Columns>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" Visible=False DataField="company_id" HeaderText="Company Id"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" UniqueName="company_id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="company_name"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Company Name"
            UniqueName="company_name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Company_Account_Number"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Account Number"
            UniqueName="Company_Account_Number">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Country_Name"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Country"
            UniqueName="Country_Name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="user_preasigned_lasc_id"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Preassigned LASC"
            UniqueName="user_preasigned_lasc_id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="region_name"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Region"
            UniqueName="region_name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Status" FilterListOptions="VaryByDataType"
            ForceExtractValue="None" HeaderText="Status" UniqueName="Status">
        </telerik:GridBoundColumn>
        <telerik:GridEditCommandColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
            UniqueName="AutoGeneratedEditColumn" EditText="View" HeaderText="View Profile">
            <HeaderStyle Width="30px" />
        </telerik:GridEditCommandColumn>
       
       
    </Columns>
    <PagerStyle Mode="NumericPages" />
</MasterTableView>
        <GroupPanel ID="GroupPanel" Style="width: 100%;">
        </GroupPanel>
        <ClientSettings AllowDragToGroup="True">
        </ClientSettings>
</telerik:RadGrid>


Thanks in advance,

François
Kostadin
Telerik team
 answered on 07 Jan 2016
5 answers
185 views
I am using SelfHierarchySettings of master/detail grid to show parent child relation of data. The issue that I am facing is that I am not able to get the child grid if there is no child under a parent node. It just shows expanded icon and nothing else.

What I am looking for is that when I click on expand icon, it should show up a blank child grid.

Can you please provide me some code for this to achieve the above said functionality.


Thanks & Regards,
Sachin Vaid



Pavlina
Telerik team
 answered on 06 Jan 2016
1 answer
350 views

Hello.

I have gird and I add "Export to excel" to it.it Works fine.

but I want Add Summation of some Columns of it after the last row in Excel file which is not in Grid.

And second Question , Users can filter my grid and it Works fine But I want when he/she Click on "Export to Excel" button, it Exports All of Data to excel Not just Filtered. Is it Possible?

Kostadin
Telerik team
 answered on 06 Jan 2016
7 answers
343 views
Hi,

I want to add the following functionality in a RadGrid but I don't know if it can work. I have a hierarchical Grid with the following structure:

MasterTable
    Item1
           DetailTable1
    Item2
          DetailTable2
    Item3

I want to add Drag and drop row functionality only in the Detail Tables rows. I mean, reordering only rows of each Detail Table. Can I achieve this? I saw some examples only for master table. If yes can you provide me with a link example please.

Thanks
George
Jatin
Top achievements
Rank 1
 answered on 06 Jan 2016
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?