Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
90 views
Hi, i tried this snipet 

function getItemIndexHierarchical() {
var grid = $find("<%=RadGrid1.ClientID %>");
var masterTableView = grid.get_masterTableView();
var dataItems = masterTableView.get_dataItems();
alert(dataItems[0].get_itemIndexHierarchical());
}

And it throws javascript exception ; 

Jayesh Goyani
Top achievements
Rank 2
 answered on 03 Apr 2014
6 answers
681 views
Hi,

Why is it not possible to hide the label during edit mode?
For instance, in the following code, "lblInvoiceDetailID" is not hidden even when visible property is set to false in edit mode....



<telerik:GridTemplateColumn DataField="InvoiceDetailID" HeaderText="InvoiceDetailID" UniqueName="InvoiceDetailID" Display="False">
                        <ItemTemplate>
                            <asp:Label ID="lblInvoiceDetailID" runat="server" Text='<%# Bind("InvoiceDetailID") %>'  Visible="false"> </asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtInvoiceDetailID" Text='<%# Bind("InvoiceDetailID") %>'  runat="server" ReadOnly="true" Visible="false"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

Any help is highly appreciated.

Many thanks.

Milan G
Princy
Top achievements
Rank 2
 answered on 03 Apr 2014
2 answers
156 views
Hi,

We are using telerik grid where we display data entered by our users. We  have set fixed column widths and enabled  wrap.

What  happens is if there is a word w/o space it does not wrap,  rather it gets cut while being displayed.

What  is the solution  for this - e.g. any grid tools wraps data automatically 


Thanks 

Anand
Fabio
Top achievements
Rank 1
 answered on 02 Apr 2014
12 answers
282 views
Hi,

i am facing a really trival problem but i am not able to sort this out. I am sure, anyone of you guys can give me a clue!
I have a dock zone that contains 4 docks.
On the initial load all dock are collapsed.
There are some other controls on that page that expand one of the described docks for showing information.

My issue is really simple. At one time, i want to have just one dock expanded. So if another controls expands i.e. dock2, all other docks shall be collpased.

At the moment i am trying the figure this out by using the OnClientComment event to do the necessary stuff, but with no avail.

Thanks a lot..
Marc
Slav
Telerik team
 answered on 02 Apr 2014
9 answers
169 views
I have a set of columns which are not editable in 'Edit Mode'. But when on 'Insert Mode' I want the same columns to have dropdowns and I should be able to select values. In EditMode to disable these columns this is what I have done:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
       {
           if (e.Item is GridEditableItem && e.Item.IsInEditMode && !(e.Item is GridEditFormInsertItem))
           {
 
               GridEditableItem item = e.Item as GridEditableItem;
               GridEditManager manager = item.EditManager;
               //Adding columns that are not editable
               GridTextBoxColumnEditor editor = manager.GetColumnEditor("Description") as GridTextBoxColumnEditor;
               editor.TextBoxControl.Enabled = false;
               editor.TextBoxControl.BackColor = System.Drawing.Color.Gray;
               editor.TextBoxControl.ForeColor = System.Drawing.Color.Black;
               editor = manager.GetColumnEditor("SameRegion") as GridTextBoxColumnEditor;
               editor.TextBoxControl.Enabled = false;
               editor.TextBoxControl.BackColor = System.Drawing.Color.Gray;
               editor.TextBoxControl.ForeColor = System.Drawing.Color.Black;
               editor = manager.GetColumnEditor("AVRMName") as GridTextBoxColumnEditor;
               editor.TextBoxControl.Enabled = false;
               editor.TextBoxControl.BackColor = System.Drawing.Color.Gray;
               editor.TextBoxControl.ForeColor = System.Drawing.Color.Black;
               editor = manager.GetColumnEditor("AVRMZName") as GridTextBoxColumnEditor;
               editor.TextBoxControl.Enabled = false;
               editor.TextBoxControl.BackColor = System.Drawing.Color.Gray;
               editor.TextBoxControl.ForeColor = System.Drawing.Color.Black;
           }
                 
       }
The description and SameRegion columns should have a dropdown in 'InsertMode' so that I can pass the selected values. How can I achieve this?
RB
Top achievements
Rank 1
 answered on 02 Apr 2014
1 answer
383 views
Hi,

My requirement is to auto populate the textboxes(bound columns) in the insert form on selecting items from a radcombobox which is in the same insert form. My RadGrid is using Batch edit mode. I tried to attach the OnClientSelectedIndexChanged event for the RadCombobox. But after selecting the item and auto populating the TextBoxes(bound columns), the textboxes wont appear, it looks like labels.. The major issue is the OnClientSelectedIndexChanged is firing on the save button click. Please provide a solution for this.

ASPX:
01.<telerik:RadGrid ID="ad" runat="server" OnNeedDataSource="ad_NeedDataSource" AutoGenerateColumns="false">
02.    <MasterTableView EditMode="Batch" CommandItemDisplay="Top">
03.        <BatchEditingSettings EditType="Row" OpenEditingEvent="Click" />
04.        <Columns>
05.            <telerik:GridBoundColumn DataField="testProperty" UniqueName="testProperty" HeaderText="testProperty">
06.            </telerik:GridBoundColumn>
07.            <telerik:GridBoundColumn DataField="test" UniqueName="test" HeaderText="test">
08.            </telerik:GridBoundColumn>
09.            <telerik:GridBoundColumn DataField="description" UniqueName="description" HeaderText="description">
10.            </telerik:GridBoundColumn>
11.            <telerik:GridBoundColumn DataField="code" UniqueName="code" HeaderText="code">
12.            </telerik:GridBoundColumn>
13.            <telerik:GridTemplateColumn HeaderStyle-Width="300px" HeaderText="ShipCountry" UniqueName="ShipCountry"
14.                DataField="ShipCountry">
15.                <ItemTemplate>
16.                    <asp:Label ID="lb" runat="server" Text="jklm"></asp:Label>
17.                </ItemTemplate>
18.                <EditItemTemplate>
19.                    <telerik:RadComboBox runat="server" Skin="WebBlue" ID="RadComboBox1" Height="200px"
20.                        Width="270px" DropDownWidth="800px" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged"
21.                        ShowMoreResultsBox="true" EnableVirtualScrolling="true" ChangeTextOnKeyBoardNavigation="true">
22.                        <Items>
23.                            <telerik:RadComboBoxItem Text="gh1" Value="sdf1" />
24.                            <telerik:RadComboBoxItem Text="gh2" Value="sdf2" />
25.                            <telerik:RadComboBoxItem Text="gh3" Value="sdf34" />
26.                        </Items>
27.                    </telerik:RadComboBox>
28.                </EditItemTemplate>
29.            </telerik:GridTemplateColumn>
30.        </Columns>
31.    </MasterTableView>
32.</telerik:RadGrid>

Js:
1.<script type="text/javascript">
2.    function OnClientSelectedIndexChanged(sender, args) {
3.        alert("fired!!!!!!!!!");
4.    }
5.</script>

Thanks
Angel Petrov
Telerik team
 answered on 02 Apr 2014
4 answers
311 views
I have a RadGrid, with a RadFilter applied to it.   I am not using RadAjaxPanel or any Ajax controls.

When I execute a RadGrid.MasterTableView.ExportToCSV(),  I do not get any data returned when IgnorePaging = true.  

If I set IgnorePaging = false, I get exported data, but only the first page.

How do I get the full dataset of the grid when using RadFilter? 
Kostadin
Telerik team
 answered on 02 Apr 2014
2 answers
211 views
I have XML that is coming back from my database and I'm databinding it to my TreeView, but it shows:

System.Xml.XmlDeclaration
System.Xml.XmlElement

as part of my tree. 

Here is my XML:

<?xml version="1.0" encoding="utf-8" ?>
<tree>
  <node text="2014">
    <node text="Test 1">
      <node text="Test 2">
        <node text="Test 3" />
        <node text="Test 4" />
      </node>
    </node>
  </node>
  <node text="2013">
      <node text="Test 1">
        <node text="Test 2">
          <node text="Test 3" />
          <node text="Test 4" />
        </node>
      </node>
  </node>
</tree>

I need my tree to display it like this with checkboxes next to it.
2014
-Test 1
---Test 2
------Test 3
------Test 4
2013
-Test 1
---Test 2
------Test 3
------Test 4

Thank you for any help.
Boyan Dimitrov
Telerik team
 answered on 02 Apr 2014
1 answer
393 views
Hi,

this is my first post here so if I misplaced it then sorry.
I need advice in preventing errors caused by XSS (Cross-Site Scripting). Our client's security check discovered that RadGrid filters can be vulnerable to XSS. At least when you insert js into the value field of the filter control of the column and then chose a filter type it causes a unhandled exception. Is there some way to handle the exception? I know the filter controls are secured against sql injection but the error caused by XSS is irritating. Especially that on a client we only have js error and the "loading icon" of RadGrid is spinning. Is my assumption that if someone manages to circumvent the 500 error that a XSS attack could be succesful?
Is there any way to implement "Microsoft Anti-Cross Site Scripting Library" for this problem or some other solution?

Attempted js text in filter:
<script>alert(1)</script>
 
Error in VS2012:
Unhandled exception at line 6, column 84289 in http://localhost:52030/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:pl-PL:c9cbdec3-c810-4e87-846c-fb25a7c08002:ea597d4b:b25378d2;Telerik.Web.UI,+Version=2013.1.220.45,+Culture=neutral,+PublicKeyToken=121fae78165ba3d4:pl-PL:3e3b0da6-8c39-4d10-9111-25eaee1f7355:16e4e7cd:ed16cbdc:f7645509:86526ba7:874f8ea2:24ee1bba:e330518b:2003d0b8:1e771326:c8618e41:19620875:f46195d3:490a9d4e:bd8f85e4:58366029:8674cba1:7c926187:b7778d6c:c08e9f8a:aa288e2d:e4f8f289:59462f1:a51ee93e

0x800a139e - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$rgridPromotions$ctl00$ctl02$ctl03$FilterTextBox_colName="<script>alert(1)</sc...").


Error in IE:
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Mon, 31 Mar 2014 09:12:18 UTC


Message: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
Line: 6
Char: 84147
Code: 0
URI: http://crr-app1:10000/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3apl-PL%3a10a773fc-9022-49ec-acd6-8830962d8cbb%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2013.1.220.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3apl-PL%3a3e3b0da6-8c39-4d10-9111-25eaee1f7355%3a16e4e7cd%3aed16cbdc%3af7645509%3a86526ba7%3a874f8ea2%3a24ee1bba%3ae330518b%3a2003d0b8%3a1e771326%3ac8618e41%3a19620875%3af46195d3%3a490a9d4e%3abd8f85e4%3a58366029%3a8674cba1%3a7c926187%3ab7778d6c%3ac08e9f8a%3aaa288e2d%3ae4f8f289%3a59462f1%3aa51ee93e
Vasil
Telerik team
 answered on 02 Apr 2014
8 answers
340 views
Hi all!!
    Good Day!!!
    
    Am New Member for this community. Please help to me clarify my doubt in telerik controls.
    
    Now i need a graph report using rad chart control and export to excel and word or pdf.
    
    can anyone give a suggestion with example and explain....
Danail Vasilev
Telerik team
 answered on 02 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?