Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
1.6K+ views
Hi,

i got a grid in a radwindow and i want to return the id of the selected row dataitem.
The id is in the MAsterView DataKeyvalue and i also tried to put it in a invisible column with unique name id..
I want to do it client side with java script as i already have used JS by opening the Radwindow.

After i read the references in the online documentary i got following code:

<telerik:RadCodeBlock ID="radCodeBlock" runat="server"
            <script type="text/javascript"
                function GetRadWindow() 
                { 
                   var oWindow = null
                   if (window.radWindow) oWindow = window.radWindow; 
                   else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; 
                   return oWindow; 
                } 
                 
                function returnToParent() 
                {                   
                    //create the argument that will be returned to the parent page 
                    var oArg = new Object(); 
                                     
                    //get the selected id from RadGrid 
                    var grid = $find("<%=radGrid.ClientID %>"); 
                    var MasterTable = grid.get_masterTableView(); 
 
                    var selectedRows = MasterTable.get_selectedItems(); 
                    for (var i = 0; i < selectedRows.length; i++) 
                    { 
                      alert(i); // got 0 for 1 selectec row 
                      var row = selectedRows[i]; 
                      var cell = MasterTable.getCellByColumnUniqueName(row, "id"
                    } 
                     
                    var id = cell.innerHtml(); 
                     
                    //var id = $find("<%=radGrid.ClientID %>").get_masterTableView().get_selectedItems()[0].getDataKeyValue("id"); 
                                                               
                    //get a reference to the current RadWindow 
                    var oWnd = GetRadWindow(); 
                     
                    //Close the RadWindow and send the argument to the parent page 
                    if(id) 
                    { 
                        //oWnd.close(oArg); 
                        alert("docid = " + id); 
                    } 
                    else 
                    { 
                        alert("Please select a document."); 
                    } 
                } 
            </script> 
        </telerik:RadCodeBlock> 

With this i get an page error that "null is Null, or not an object". Its also not working with sell.innerHtml  without ().
i also used this inline outcommented way/line, but then i come to the false alert.

Here the grid:

<telerik:RadGrid ID="radGrid" runat="server" 
                                            AllowPaging="True"  
                                            PageSize="20" 
                                            AutoGenerateColumns="False" 
                                            GridLines="Both" 
                                            AllowMultiRowSelection = "false" 
                                            ClientSettings-Selecting-AllowRowSelect = "true" 
                                            OnNeedDataSource="Radgrid_NeedDatasource"
                             
                            <MasterTableView DataKeyNames="id" 
                                        CommandItemDisplay="Top"
                                         
                                <CommandItemTemplate> 
                                    <div style="padding: 5px 5px;"
                                        <img onclick="returnToParent()" style="border:0px;vertical-align:middle;" alt="" src="../App_Themes/Default/Images/file_icon.gif"/> 
                                        <asp:Label ID="lblChooseDocument" runat="server" Text="choosedocument" OnLoad="OnLabelLoad"></asp:Label> 
                                    </div> 
                                </CommandItemTemplate> 
                                                                                     
                                <Columns> 
                                 
                                    <telerik:GridBoundColumn DataField="id" Visible="false"></telerik:GridBoundColumn> 
                                        <telerik:GridTemplateColumn> 
                                            <ItemTemplate> 
                                                <asp:Image runat="server" ID="imgNew" 
                                                    OnLoad="OnImageLoad" /> 
                                                <asp:TextBox ID="txbCreatedDate" runat="server" 
                                                    Visible ="false" 
                                                    Text='<%# DataBinder.Eval(Container.DataItem,"created_date").ToString() %>' /> 
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridHyperLinkColumn DataTextField="Metainformation.name" HeaderText="Profile" DataTextFormatString="{0}"></telerik:GridHyperLinkColumn> 
                                        <telerik:GridBoundColumn DataField="Category.name" HeaderText="Kategorie"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="User.lastname" HeaderText="Ersteller"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="created_date" HeaderText="Erstellungsdatum"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="User1.lastname" HeaderText="letzter Bearbeiter"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="checkout_date" DataType="System.DateTime" HeaderText="in Verwendung seit"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Folder.name" HeaderText="Ordner"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="id" UniqueName="id" Visible="false"></telerik:GridBoundColumn> 
                                         
                                    </Columns> 
                                       
                                    <RowIndicatorColumn> 
                                        <HeaderStyle Width="20px"></HeaderStyle> 
                                    </RowIndicatorColumn> 
 
                                    <ExpandCollapseColumn> 
                                        <HeaderStyle Width="20px"></HeaderStyle> 
                                    </ExpandCollapseColumn> 
                                </MasterTableView>           
                        </telerik:RadGrid> 


The radwindow works fine and the grid has mutli select disabled and row select allowed

Any ideas why im not able to retrieve the id of the selected row?

cheers mario
Jack
Top achievements
Rank 1
 answered on 09 Mar 2016
3 answers
137 views

Hello All,

I am trying to give titles to Telerik Tile list --> Tilegroup using the sample code provided on this page  

http://demos.telerik.com/aspnet-ajax/tilelist/examples/data-binding/server-side-binding/declarative-data-source/defaultcs.aspx.

But when I run the code I get the following error: 

Type 'Telerik.Web.UI.TileGroup' does not have a public property named 'Title'.

here is my code:

  <telerik:RadTileList RenderMode="Lightweight" runat="server" DataSourceID="SqlDataSource1" ID="RadTileList1" AppendDataBoundItems="True"
            TileRows="4" OnTileDataBound="RadTileList1_OnTileDataBound" OnTileCreated="RadTileList1_OnTileCreated">
            <DataBindings>
                <CommonTileBinding TileType="RadImageAndTextTile" Shape="Square" DataGroupNameField="Division" />
                <ImageAndTextTileBinding DataTextField="Employee" DataImageUrlField="BLOB" />
                <TilePeekTemplate>
                    <div class="peekTemplateClass">
                        <strong>Location</strong>
                        <%#DataBinder.Eval(Container.DataItem, "Location")%>
                        <br />
                        <strong>Division</strong>
                        <%#DataBinder.Eval(Container.DataItem, "Division")%>
                        <br />
                        <strong>Email</strong>
                        <%#DataBinder.Eval(Container.DataItem, "EmailID")%>
                        <br />
                        <strong>Name</strong>
                        <%#DataBinder.Eval(Container.DataItem, "Employee")%>
                    </div>
                </TilePeekTemplate>
            </DataBindings>
            <Groups>
                <telerik:TileGroup Name="Health Services" Title=""> ---> I m getting error here while trying to add title as per the telerik demo.
                </telerik:TileGroup>
                <telerik:TileGroup Name="Home Health">
                </telerik:TileGroup>
                <telerik:TileGroup Name="Hospice">
                </telerik:TileGroup>
                <telerik:TileGroup Name="DME">
                </telerik:TileGroup>
            </Groups>
        </telerik:RadTileList>

 

Can any one please suggest me why this is happening? 

Dipali
Top achievements
Rank 1
 answered on 09 Mar 2016
4 answers
114 views

Hello,

Could you please check the following behavior and suggest how to fix it?

Scenario:

  1. Add Japanese IME to have a possibility to enter EM (full-width) space;
  2. Open the design tab, start a new line from EM space, add a few symbols;
  3. Switch to the HTML tab.

Expected behavior:

EM space is converted to &emsp;

Actual behavior:

EM space is removed

Please take a look at the reproducing scenario on the demo page: http://screencast.com/t/o8JwCGrj

vkucherov
Top achievements
Rank 1
 answered on 08 Mar 2016
2 answers
81 views

Hello,

I am currently using version 2016.1.225.35 and I'm having issues with the server side AcceptTrackChanges() method. When the method is used it seems that formatting changes that have been made to the content (i.e., Bold) are not accepted. Other changes, like insert and delete, are accepted. I believe this use to work properly in the 2015 version. If we enable the command using the editor toolbar button (<telerik:EditorTool Name="AcceptAllTrackChanges" />), all changes are accepted (including the formatting changes).

To reproduce this problem, include the editor in the page markup. Also, add a Button with the associated OnClick event. Within the code behind OnClick event, utilize the AcceptTrackChanges method to accept changes. Example is shown:

 

protected void ButtonAcceptChanges_Click(object sender, EventArgs e)
{
    RadEditorDesc.AcceptTrackChanges();               
}

 

Make changes within the editor content. Include formatting changes (i.e., bold) and then click on the Accept Changes button. You should notice that all changes are accepted other than formatting type changes.

 

Any help in resolving this issue would be appreciated.

Thank-you.

 

 

 

 

tlp
Top achievements
Rank 1
 answered on 08 Mar 2016
3 answers
150 views

Hi Friends,
I have a requiremt to populate two Treeviews , such that the second Treeview is populated based on clicking on the first . Am using XMLDatasource to populate both . For the first time, the second Treeview is perfectly loaded, but after that it is still showing the same data ,i.e; not refreshing .
How can i make the treeview to get the changes reflected correctly .

Thanks in advance

Regards

Sree

Happy
Top achievements
Rank 1
 answered on 08 Mar 2016
1 answer
89 views

I noticed that on one of the asp.net webform demos you had a option to tick and show the apointments of users in one schedulre kinda like outlook shared claenders however i dont see  any documenation on how to repoduce this at all?.

 

Regards

David

Ivan Danchev
Telerik team
 answered on 08 Mar 2016
2 answers
115 views
Hi,

At our company we created and maintain a large ASP.NET application which makes extensive use of the Telerik Rad controls. We use version 2013.3.1015.40.

Currently we run into an issue with the RadEditor. It occurs in Internet Explorer 11 which is mainly used by one of our customers. If a line starts or ends with zeros (0) and the user presses enter, then those zeros are trimmed. It is very easy to reproduce in an empty web application project.

Steps to reproduce:
 Step 1: Type first line starting with a zero or/and ending with a zero.
 Step 2: Press ENTER to move to the second line
 Step 3: See the zeros disappear in the first line.

We also tried it with the latest version of the Rad controls and there the problem does not occur.

We are aware that we are using an older version, but for our product it suits fine. We are afraid that replacing the Rad controls with the latest version will introduce new bugs or styling issues in our product. It would require a huge amount of QA work and probably a lot of rework.

Can you please help us out? It seems like such a minor issue in the JavaScript code. Maybe you can provide us with a work around or a hotfix. We would greatly appreciate that.

Thanks,
Ronald
Ronald
Top achievements
Rank 1
 answered on 08 Mar 2016
1 answer
112 views

Hi,

I'm having problems getting the OlympicGames-Demo to work.
I'm using Visual Studio Express Web 2013,Microsoft SQL Server Express 2008 R2, Telerik.DataAccess 2015.3.1221.1. and UI for ASP.NET AJAX Q1 2016 SP1.
When i run the .master - File i get the exceptions shown in exception1.png and excpetiondetails.png.

i also tryied to reinstall the dataacess-packages and got the exceptions in fluentpackageinstalllog1.png and fluentpackageinstalllog2.png. when reinstalling the fluent-package.

Any help appreciated!
Regards


Pavlina
Telerik team
 answered on 08 Mar 2016
6 answers
219 views
Hi

The RadSlidingPane Tab Text currently displays text vertically one character after another. For example:

T
e
x
t

Is there any other way to orientate the text at all? For example, as if I took the text "Text" and then rotated it 90 degrees anti clockwise??

I have just been demoing these controls to our users and the tet orientation seemed to be quite a big issue for them.

Thanks.

Vessy
Telerik team
 answered on 08 Mar 2016
15 answers
914 views
Hi,

I'm not sure if the RadImageEditor is the right tool for my requirements, but I thought I would ask our community for their opinion.  Also, I'm sure many of us have needed to deal with Profile pictures, and I would love to avoid reinventing the wheel.

High level, I need to allow my users to (1) select a picture as a profile picture, (2) crop it, (3) lock the aspect ratio, and (4) return it to the DB.  It is critical that this is as simple as Facebook, for example.

More specifically, here are my requirements:

  1. User navigates to a page with an "upload button," maybe using RadUpload.
  2. After selecting the file, it must upload to the page, hopefully to the editor. 
  3. (I would like to avoid the users needing to click the select button, then to click another button to upload, as with the default configuration of the RadUpload module.  As soon as they select, it needs to be displayed.)
  4. When displayed in the editor, it needs to immediately go into "crop" mode.
  5. I do not want the "crop" dialoge displayed, with will protect form them changes the aspect ratio.
  6. I do not mind them changing the "size" of the crop area, as long as the aspect ratio does not change.
  7. I do want them to be able to move the crop area around the picture.
  8. After they are satisfied, I want them to hit a button, which returns the picture to the database, and then displays it.  Maybe in a RadBinary image.  (Thus, I don't want it to appear "stuck" in the RadEditor.

Any suggestions to handle these requirements would be really appreciated.  

Thanks,

Jim
Vessy
Telerik team
 answered on 08 Mar 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?