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

Scenario:

Grid with a GridDropDown column. The source for the drop down is a simple table of name/id pairs. If doing an update in batch mode, and the drop down's ListTextField has trailing spaces, the ListValueField won't be passed back during an update.

See sample below. At line 20 is the code to create the sample SQL data.

When running this sample, if you attempt to update a row and use any of the drop downs that end in spaces, the update will not assign the correct id value. If you change the edit mode from batch to popup, it will work fine. If you change line 42 to read:

ListTextField="name_trimmed" or ListTextField="name_appended"

both of which change the field to NOT end in trailing spaces, it will work as well.

I was able to work around this, but it's definitely a bug in the control. Trailing spaces should not throw of the ListValueField. I'm currently using version 2016.2.607.45

 

01.<%@ Page Language="C#" %>
02. 
03.<!DOCTYPE html>
04. 
05.<script runat="server">
06. 
07.</script>
08. 
10.<head runat="server">
11.    <title></title>
12.</head>
13.<body>
14.    <form id="form1" runat="server">
15.    <div>
16.     
17.        <asp:ScriptManager runat="server" ID="scriptmgr" />
18. 
19.        <%--
20./* SQL code to create tables and test data */
21.create table dropdownvalues (id int identity(1,1), name varchar(200))
22.create table datalist (id int identity(1,1), dropdown_id int)
23.insert into dropdownvalues  (name) values('no spaces'), ('spaces                                             ')
24. 
25.insert into datalist(dropdown_id)
26.select top 2 id from dropdownvalues
27. 
28.insert into dropdownvalues  (name) values('three spaces   ')
29.insert into dropdownvalues  (name) values('forty spaces                                        ')
30.insert into dropdownvalues  (name) values('zero spaces')
31.            --%>
32. 
33.        <telerik:GridDropDownListColumnEditor runat="server" ID="ddeditor" DropDownStyle-Width="200" />
34.             
35.        <telerik:RadGrid runat="server" DataSourceID="sql_source" AllowAutomaticUpdates="true" AutoGenerateColumns="false">
36.            <%--Works fine in PopUp edit mode--%>
37.            <MasterTableView EditMode="Batch" CommandItemDisplay="Top" DataKeyNames="id" >
38.                <Columns>
39.                    <telerik:GridEditCommandColumn/>
40.                    <telerik:GridBoundColumn DataField="id" HeaderText="id" ReadOnly="true" />
41.                    <telerik:GridDropDownColumn DataField="dropdown_id" HeaderText="dropdown_id" DataSourceID="sql_dropdown" 
42.                        ListValueField="id" ListTextField="name" HeaderStyle-Width="400" ColumnEditorID="ddeditor" />
43.                    <telerik:GridBoundColumn DataField="saved_dropdown_id" HeaderText="saved_dropdown_id" ReadOnly="true" />
44.                </Columns>
45.            </MasterTableView>
46.        </telerik:RadGrid>
47.         
48.        <asp:SqlDataSource ConnectionString="<%$ ConnectionStrings:MyDB%>" ID="sql_source" runat="server"
49.            SelectCommand="select *, dropdown_id as saved_dropdown_id from datalist"
50.            UpdateCommand="update datalist set dropdown_id=@dropdown_id where id=@id"
51.             />
52. 
53.        <asp:SqlDataSource ConnectionString="<%$ ConnectionStrings:MyDB%>" ID="sql_dropdown" runat="server"
54.            SelectCommand="select id,name, rtrim(name) name_trimmed, name + '-' name_appended from dropdownvalues order by name" />
55.    </div>
56.    </form>
57.</body>
58.</html>
Kostadin
Telerik team
 answered on 10 Sep 2016
4 answers
355 views
Hi,
I would like to show a progress indicator like in your demos (see picture attached) in the middle of the visible area when the user has to wait for some operation to be completed. I know that such indicator is shown in the bottom left corner of the radgrid but if the user is not at the bottom of the grid it is not visible.
How can I do something like that?
muskan
Top achievements
Rank 1
 answered on 10 Sep 2016
3 answers
105 views

I have a pie chart with many slices and want to set the legend on the bottom of the chart with Vertical orientation of all the items.

If I set the legend position to right or left, the vertical orientation of the items works fine, but will not work on top or bottom of the chart. Is there a work around for this or will I have to manually create my own legend in a table below the chart?

Jen
Top achievements
Rank 1
 answered on 09 Sep 2016
6 answers
3.0K+ views
Hi 

I want to change radgrid default pageSize programmatically.  Basically I want to give different radgrid PageSizes to different users. 
after reloading the page it goes back to original default pageSize. 

I'm using  < PagerStyle Mode="NextPrevNumericAndAdvanced"  . 
I don't want to use RadComboBox dropdown for pageSize. 

Cheers
Has
Top achievements
Rank 1
 answered on 09 Sep 2016
2 answers
119 views

I've been trying to implement a RegularExpressionValidator for a textbox in my RadGrid. Edits and Inserts happen using the InPlace editor. They are not automatic, I deal with them via code. If I go into Edit Mode I cannot exit Edit Mode or do anything until I fill in the empty fields in the InPlace Editor and either use the Insert or Cancel command. Using the debugger I've determined that no postbacks happen while the grid is in edit mode and there are empty fields in the inplace editor. Not quite sure what to do, cannot find similar issues in the forums.

 

This is my OnDataBound event that implements the RegularExpressionValidator:

 

            'if the grid is currently being edited
            If e.Item.IsInEditMode Then
                ToggleControlVisability(e)
                SetDefaultRateValue(e)

                Dim eItem = TryCast(e.Item, GridEditableItem)
                Dim editor = TryCast(eItem.EditManager.GetColumnEditor("rate"), GridTextBoxColumnEditor)
                Dim cell = TryCast(editor.TextBoxControl.Parent, TableCell)
                Dim rev = New RegularExpressionValidator()
                rev.ControlToValidate = editor.TextBoxControl.ID
                rev.ValidationExpression = "[0-9]*\.?[0-9]*"
                rev.CssClass = "text-danger"
                rev.ErrorMessage = " Please provide a valid number."
                cell.Controls.Add(rev)
            End If

 

 

My Cancel command (which does not get executed):

 

        ToggleCommandColumns()
        rgJobItems.MasterTableView.ClearEditItems()
        rgJobItems.Rebind()

 

 

ToggleCommandColumns is a custom function that swaps button visibility so it should not be affecting anything. Same goes for ToggleControlVisability, it just makes some controls visible on the page. 

I only started encountering this issue when I put in a RegularExpressionValidator. If I take it out, it works fine (I can cancel the editor at any time).

Any support would be appreciated. 

Raulis
Top achievements
Rank 1
 answered on 09 Sep 2016
1 answer
54 views
Hi,
I have faced with the issue when using the link manager.
I have entered a few text lines to the editor, select this text and click Hyperlink manager button, Rad editor shows the dialog. Usually, hyperlink tab of this dialog contains such fields as URL, Text, ID etc. However,  in the described scenario the Text field was hidden. 

I have attached the screenshot of the Hyperlink manager dialog

Best regards,
Rita
Marin Bratanov
Telerik team
 answered on 09 Sep 2016
6 answers
129 views
I have a project with master pages. On the pages using master page the rad checkbox renders "double", see attached file. On the pages not using master pages the checkbox renders properly. How do you suggest fixing this issue?
Danail Vasilev
Telerik team
 answered on 09 Sep 2016
1 answer
113 views

Is there any way to have children items keep the same with (100%) of its parent root item?

Have an issue with a multi-language site where the children needs to match in width, please see image where you can see the root a.rmExpanded item has a blue border on the sides and it needs to match the width of its children at all times.

 

 

Anton
Telerik team
 answered on 09 Sep 2016
3 answers
224 views

Hello. I have this code where I'm trying to pop-up a small window with javascript from my dynamic list. My code is below, I get two pop-up windows, one (resim.aspx) and another one that has "javascript:my_window=window.open('Resim.aspx?ID=12345678','my_window','width=300,height=300');my_window.focus()" on the address bar. How can I make this sure that only one pop-up window comes up. Thank you.


foreach (String strC in ServiceList)

{

TreeNode newNode = new TreeNode(strC.ToString());

newNode.NavigateUrl = "javascript:my_window=window.open('Resim.aspx?ID=12345678','my_window','width=300,height=300');my_window.focus()"

            newNode.Target = "_blank";

            newNode.SelectAction = TreeNodeSelectAction.Select;

            newNode.PopulateOnDemand = false;

            node.ChildNodes.Add(newNode);

)

Ivan Danchev
Telerik team
 answered on 09 Sep 2016
2 answers
42 views

I'm trying to display both percentage and amount with a break point in between.  This is what i tried and a couple more, but they are not working.  Please help.

ClickSeries = New PieSeries

ClickSeries.TooltipsAppearance.ClientTemplate = "#= kendo.format(\'{0:P0}\', percentage)#<br />#={0:N0}#"

Joseph
Top achievements
Rank 1
 answered on 08 Sep 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?