Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
2.9K+ views
my radgrid sample is;

<telerik:RadGrid ID="GridView1"    OnDataBound="GridView1_DataBound"  
                    runat="server" DataSourceID="SqlDataSourceKategori"
                    AutoGenerateColumns="False" Skin="Windows7">
                    <MasterTableView DataSourceID="SqlDataSourceKategori" DataKeyNames="ID">
                        <Columns>
                          
                            <telerik:GridTemplateColumn HeaderText="Kategori">
                                <EditItemTemplate>

but i couldnt get datakeyname value at codebehind
i tried beloow

Label16.Text = GridView1.MasterTableView.DataKeyValues[0].ToString();
but response

"System.Collections.Hashtable+ValueCollection"

please help me


Doncho
Telerik team
 answered on 19 Jan 2021
5 answers
178 views

New user to Telerik, here. Main question is, I have a radgrid that is about 20 columns wide w/ the ability to hide columns. In mobile render, if you attempt to hide columns using the context menu, the buttons are really wide. If you want to hide a column, you have to scroll way over uncheck it. Then you can't see what the other column names are without scrolling way back over and viewing the names.

Is there any way to set the width of the context menu so it automatically adjusts to the screen size? I did do a lot of searching on this and came up empty handed.

2) Also, in grouping, everything groups and works exactly like I would think it would, but if you ungroup anything, it throws an "Object reference not set to an instance of an object." error. It's kind of cryptic and searching for this error didn't lead me anywhere.

3) Mobile render seems a little buggy on my phone using FireFox or Chrome. Sometimes hitting the context menu icons, it will open up, group the column, and then close without me ever touching anything.

I finally got so fed up with grouping issues that I turned it off.

Outside of that, the hiding the column feature seems to work well and is at least something for a mobile user to cut down on the size of a big table.

Thanks,

Jay

 

 

 

Attila Antal
Telerik team
 answered on 19 Jan 2021
1 answer
218 views
Hi, I need to retrieve the text contents of AutoCompleteBox in Javascript (client side).
I tried this but it just alerts me nothing (blank result):
<script>
function CheckOE() {
            alert(document.getElementById('RadAutoCompleteBox1').value);
        }
</script>
<telerik:RadAutoCompleteBox RenderMode="Lightweight" runat="server" ID="RadAutoCompleteBox1" ClientID="RadAutoCompleteBox1" 
            autopostback="true"
            DataSourceID="blah" DataTextField="blah" DataValueField="blah" InputType="blah" Width="100%"
            AllowCustomEntry = "false"
            DropDownWidth="150px"
            onfocusout="CheckOE()"
            >
Any idea?
Thanks!
Yan Moura
Top achievements
Rank 1
Veteran
Iron
 answered on 18 Jan 2021
1 answer
537 views

We upgraded the Telerik control to 2020.3.915.45 after we were hit by the Blue Mockingbird Vulnerability.

However, last weekend, we were hit again by the Blue Mockingbird Vulnerability. An ASPX file that contained this mark up was uploaded.

<asp:FileUpload ID="uplDosya" runat="server" />
<br />
<asp:Button ID="bntGonder" runat="server" Text="Submit" OnClick="btnGonder_Click" />

I've double-checked, we do have the latest version and we don only allow JPG as file extension.

Has anyone else been hit by Blue Mockingbird Vulnerability lately?

Vessy
Telerik team
 answered on 18 Jan 2021
1 answer
276 views

I have added my rad grid inside radwindow and radwindow is place inside asp:UpdatePanel. whenever i click on the page link or change the page size or do filter or sorting, it will cause a full postback and radwindow will be closed. Opening the radwindow again, will reflect the change, like grid will reflect the filter result, etc.

how do i prevent this from happening. 

my code

01.<asp:UpdatePanel ID="uPResponder" runat="server" UpdateMode="Conditional">
02.    <ContentTemplate>
03.        <asp:Button ID="btnOpenModal" runat="server" Text="Select user" />
04.        <asp:Label ID="lblUserCount" runat="server"></asp:Label>
05.        <telerik:RadWindow RenderMode="Lightweight" ID="modalPopup" runat="server" CenterIfModal="true" Width="1400px" Height="650px"  Modal="true"
06.        OffsetElementID="main" Style="z-index: 100001;" OnClientClose="countSelected">
07.            <ContentTemplate>
08.                <telerik:RadGrid RenderMode="Lightweight" ClientIDMode="AutoID" CssClass="table" AutoGenerateColumns="false" ID="gvUsers" AllowFilteringByColumn="True" AllowSorting="True" Width="100%"
09.                AllowPaging="True" runat="server" AllowMultiRowSelection="true" OnPreRender="gvUsers_PreRender" OnItemCommand="gvUsers_ItemCommand" OnNeedDataSource="gvUsers_NeedDataSource">
10.                    <PagerStyle Position="TopAndBottom" Mode="NextPrevAndNumeric" PageSizeControlType="RadDropDownList" />
11.                    <MasterTableView DataKeyNames="LoginName" ShowHeader="true" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true" NoMasterRecordsText="No user found">
12.                    <Columns>
13.                        <telerik:GridTemplateColumn HeaderStyle-Width="10px" AllowFiltering="false" AllowSorting="false" UniqueName="UserCheckbox">
14.                            <HeaderTemplate>
15.                                <asp:CheckBox ID="chbCheckAll"  AutoPostBack="true" runat="server" OnCheckedChanged="chbAll_CheckedChanged" ClientIDMode="AutoID" />
16.                            </HeaderTemplate>
17.                            <ItemTemplate>
18.                                <asp:CheckBox ID="chbUser" runat="server" AutoPostBack="True" CausesValidation="false" Checked='<%# bool.Parse(Eval("isChecked").ToString()) %>'
19.                                OnCheckedChanged="chbUser_CheckedChanged" ClientIDMode="AutoID" />
20.                            </ItemTemplate>
21.                        </telerik:GridTemplateColumn>
22.                        <telerik:GridBoundColumn DataField="Name" HeaderText="Name" ShowSortIcon="true"
23.                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
24.                        ShowFilterIcon="true">
25.                        </telerik:GridBoundColumn>
26.                    </Columns>
27.                    </MasterTableView>
28.                </telerik:RadGrid>
29.            </ContentTemplate>
30.        </telerik:RadWindow>                          
31.    </ContentTemplate>
32.</asp:UpdatePanel>
Doncho
Telerik team
 answered on 18 Jan 2021
8 answers
307 views
Hi !

I have to set a javascript function on a radcombobox server-side. I tried that (on the load of the page) :

cmb_Pager.Attributes.Add("onchange""Pager_ChangePageSize('" + cmb_Pager.ClientID + "', '" + Grid.ClientID + "')"); 

but it does'nt work in IE because the input of the combobox does'nt get the "onchange" attribute (it works perfectly in FireFox ...).

After a little search, I also tried that (on the load of the combobox) :

this.Page.ClientScript.RegisterStartupScript(cmb_Pager.GetType(), 
                                    "blabla"
                                    ";$get('" + cmb_Pager.ClientID + "_Input').onchange=function CallMethod(){Pager_ChangePageSize('" + cmb_Pager.ClientID + "', '" + Grid.ClientID + "');};",  
                                    true); 

this time, it works on FF3 and IE7, but the "onchange" event is only fired one time for both browser.

Is there a way to set correctly in FF3 and IE7 the "onchange" of the input of the combobox ??

Thanks a lot !


Doncho
Telerik team
 answered on 18 Jan 2021
1 answer
77 views

HI,

 

I am having Telerik Radgrid which load 250 people monthly roster data i.e 31 columns.

After loading the 250 records on Radgrid it slowdown in Internet Explorer Version 11.

its slow down the complete page and page become unresponsive and due to which other

functionality of the page get block. 

any suggestions to overcome this issue.

Vessy
Telerik team
 answered on 18 Jan 2021
1 answer
150 views

Hi, I hope you can help me solve this question. How can I filter in RadSearchBox to find the data in the grid and later the data that is relevant in the search will be displayed? I have looked for examples but I do not understand well how they work, I hope you can explain me.

This is my code

<telerik:RadToolBar ID="rtlbMenuPrincipal" runat="server" Height="32" Width="100%" OnClientButtonClicking="validarrtlbMenuPrincipal" AutoPostBack="true">
            <Items>
                <telerik:RadToolBarButton Enabled="true" Value="1" ImageUrl="Imagenes/Botoneras/New.png" ToolTip="Nuevo" />
                <telerik:RadToolBarButton Enabled="true" Value="2" ImageUrl="Imagenes/Botoneras/Edit.png" ToolTip="Editar" />
                <telerik:RadToolBarButton Enabled="true" Value="3" ImageUrl="Imagenes/Desarrollador/Print - 01.png" ToolTip="Imprimir" />
                <telerik:RadToolBarButton Enabled="true" Value="4" ImageUrl="Imagenes/Desarrollador/Mail.png" ToolTip="Enviar a Prueba" />
                <telerik:RadToolBarButton Enabled="true" Value="5" ImageUrl="Imagenes/Desarrollador/Lock.png" ToolTip="Cerrar prueba" />
                 
                <telerik:RadToolBarButton runat="server" Enabled="true">
                    <ItemTemplate>                   
                        <telerik:RadSearchBox runat="server" ID="RadSearch" Filter="Contains" Width="20%" EmptyMessage="Search" CssClass="Caja"
                            DataValueField="IdPrueba"
                            DataTextField="PruebaTitulo"
                            DataSourceID="SqlDataSource1"   >                                               
                            <DropDownSettings Height="400" Width="300" />
                        </telerik:RadSearchBox>
                    </ItemTemplate>
                </telerik:RadToolBarButton>
            </Items>
        </telerik:RadToolBar>
 
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:dbProcesoDesarrolloConnectionString %>"
    SelectCommand="SELECT * FROM [P_Pruebas]">
</asp:SqlDataSource>
 
        <telerik:RadGrid ID="rgrdPruebaDesarrolladores" runat="server" AutoGenerateColumns="false" AllowPaging="true" PageSize="10" data-grupovalidar="gPruebaDesarrollador" data-tipovalidador="rgrdselmult" datgridDataSourcea-msgvalidar="Seleccione un Sistema" data-nombrecampo="Seleccione un Sistema" data-placement="left">
            <MasterTableView DataKeyNames="IdPrueba">
                <Columns>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True"  DataField="Nombre_Sistema" HeaderStyle-HorizontalAlign="Center" HeaderText="Sistema"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="PruebaTitulo" HeaderStyle-HorizontalAlign="Center" HeaderText="Titulo"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True"  DataField="Nombre" HeaderStyle-HorizontalAlign="Center" HeaderText="Responsable"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="FechaPrueba" HeaderStyle-HorizontalAlign="Center" HeaderText="Fecha"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True"  DataField="PruebaModalidad" HeaderStyle-HorizontalAlign="Center" HeaderText="Tipo Modalidad"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="PruebaStatus" HeaderStyle-HorizontalAlign="Center" HeaderText="Status"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="True"></Selecting>
                <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="345px" />
            </ClientSettings>
            <PagerStyle AlwaysVisible="true" Mode="Slider" />
        </telerik:RadGrid>
 
        <asp:SqlDataSource ID="gridDataSource" runat="server" connectionString="Data Source=JJVICTORIO;Initial Catalog=dbProcesoDesarrollo;Integrated Security=True"
           SelectCommand="SELECT TOP 10 [IdPrueba], [PruebaTitulo] FROM [P_Pruebas]"></asp:SqlDataSource>

 

Protected Sub RadSearch_Search(sender As Object, e As SearchBoxEventArgs)
        Dim searchBox As RadSearchBox = DirectCast(sender, RadSearchBox)
        Dim IdPrueba As String = String.Empty
 
        If e.DataItem IsNot Nothing Then
            IdPrueba = DirectCast(e.DataItem, Dictionary(Of String, Object))("IdPrueba").ToString()
 
            If Not String.IsNullOrEmpty(IdPrueba) Then
                'rgrdPruebaDesarrolladores.MasterTableView.Rebind()
                Dim likeCondition As String = If(searchBox.Filter = SearchBoxFilter.Contains, "'%'", "")
                gridDataSource.SelectParameters.Clear()
                gridDataSource.SelectParameters.Add("IdPrueba", (CType(e.DataItem, Dictionary(Of String, Object)))("IdPrueba").ToString())
                gridDataSource.SelectCommand = "SELECT TOP 1 [Nombre_Sistema], [PruebaTitulo], [Nombre], [FechaPrueba], [PruebaModalidad], [PruebaStatus]  FROM [P_Pruebas] WHERE [IdPrueba] LIKE " & likeCondition & " + @IdPrueba"
            End If
        End If
    End Sub
 

I wanted to do something similar to this example but I don't know if it can be done with Telerik

https://datatables.net/

Attila Antal
Telerik team
 answered on 15 Jan 2021
27 answers
919 views

Hi..

I used the ThemeBuilder, but when I apply the new Theme the Calendar icon is missing from the input text.

The same happens with other controls when a custom theme is applied.

Where is the Calendar Icon ?  How do I apply it?

thx

M Kumar
Top achievements
Rank 1
Iron
Veteran
 answered on 15 Jan 2021
4 answers
3.2K+ views

This is my data on datasource-

COMPANYID CATEGORYID COMPANYNAME CATEGORYNAME
687d6bf7 103b9297 a123 abc
687d6bf7 6903d527 a123 xyz

This is my code-

<

 

telerik:RadTreeView ID="RadTreeView1" runat="server" DataSourceID="ObjectDataSourceCompany"

 

 

DataTextField="COMPANYNAME" DataFieldID="CATEGORYID" DataFieldParentID="COMPANYID"

 

 

DataValueField="CATEGORYID">

 

 

</telerik:RadTreeView>

This is the Error-

 

This constraint cannot be enabled as not all values have corresponding parent values.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: This constraint cannot be enabled as not all values have corresponding parent values.

Did I miss anything...How do i fix this??

Peter Milchev
Telerik team
 answered on 14 Jan 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?