Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
203 views
Hello,

I followed the example in this URL to obtain the values of selected rows in the client clientside:

http://www.telerik.com/help/aspnet-ajax/grdgettingcellvaluesforselectedrowsclientside.html

This is my code:

        var masterTableView = $find("RadGrid1").get_masterTableView(); 
        var selectedRows = masterTableView.get_selectedItems(); 
        var count = selectedRows.length; 
        for (var i = 0; i < count; i++) { 
            var row = selectedRows[i]; 
            var cell = masterTableView.getCellByColumnUniqueName(row, "Name"); 


getCellByColumnUniqueName gets me the values from cell.innerHTML, however the values contain the <span ..> element markup enclosing the value, which I don't want. Is there another way to get the values without having to parse out the <span> markup?  I tried the following but it doesn't work:

            // this doesn't work
            // var dataItem = selectedDataItems[i];
            // alert(dataItem.getDataKeyValue('Name'));

Thank you,
Alex



Shinu
Top achievements
Rank 2
 answered on 08 Dec 2008
2 answers
248 views
I ve added a delete button to my gridview but its not working. Please help!

thanks
Shinu
Top achievements
Rank 2
 answered on 08 Dec 2008
1 answer
109 views
Actually, guys the issue exists in FireFox as well and your workaround doesn't fix it.  I'm using release 2008.3.1125.35

Here's the scenario.

Scenario 1: I have a MasterPage with the splitter in it.  One panel has a RadGrid that is bound with "OnNeedDataSource". This page loads correctly.

Scenario 2: Again, I have a MasterPage with the splitter in it.  One panel has some textboxes.  With no data loaded in the Page_Load event, the page and textbozes load fine.

Scenario 3: Consider scenario 2, however, this time I'm passing a value in the querystring.  The page takes that value and retrieves data from a database and populates the fields accordingly.  However, the panel does NOT show in FireFox, but it DOES show in IE. And, OnClientLoaded is NOT fireing in FireFox 3.0.4, under this scenario.

Why is scenario three not working?  Could it be that its taking too long to retrieve data from the server and its timing out?
Joshua
Top achievements
Rank 1
 answered on 08 Dec 2008
4 answers
137 views
Hi

We are implemting grid filtering by giving filter expression in Need_DataSource event by setting following property -

Grid.MasterTableView.FilterExpression

which is set to something like the following

DataSourceProperty.ToString().ToUpper().StartsWith("Hi")  where DataSourceProperty is a property of object, collection of which is set as Data Source to the grid just after setting filter expressio.

Now my problem is that we wnat to give a user option to put % in the filter values and the filter should work like "Like" opertor in Oracle. So the input may be "punit%was%" .

Is it possible to do it?
 
We dont have filtre menu on grid but just filter.

Thanks

Punit
Top achievements
Rank 1
 answered on 06 Dec 2008
8 answers
286 views
Hi,

I’m creating docks dynamically and store them in a session.It’s based on your example “Dynamically Created Docks”.

I add many docks(more than 5) when I ckick button Add-Dock. But I only see 1 dock states in RadDockZone, the others state on the upper left corner of the page. When I drap a dock from the upper left corner of the page to a RadDockZone or some where, the left docks on the upper left corner of the page are disappear. After I refresh the page, I will see the left docks. Is there any thing I need to notice? So I can add many docks one time to the right RadDockZone and the docks will not disappear!!
Ulises
Top achievements
Rank 1
 answered on 06 Dec 2008
0 answers
202 views
This is very interesting.

I have created a system that allows users to edit site content using the RadEditor.  I recently created an image gallery system, and I wanted to be able to allow users to embed an image viewer in their content, but since the content they enter is simply rendered on the page, I couldn't see a way to do this.

My solution was to add a little code into the portion of the page that I control.  If the user were to create a control with a specific ID, I would create the image viewer on the server, and then put out some JavaScript that would move the viewer into that control.

If the user content includes a div with the id "ImageContainer" Then 
  Create the Image Viewer 
  Output some JavaScript that does something like 
    document.getElementById('ImageContainer').appendChild(document.getElementById('MyImageViewer')) 
End If 

This did the trick.  However, I just recently stumbled upon the ParseControl method of the Page object.  You can take the user-provided HTML, and create a control from it, and then add that control to an existing control on the page.

Dim UserContent as String 
 
[Load User Content from Database] 
 
Dim Ctrl as Control 
Ctrl = Page.ParseControl(UserContent) 
OutputDiv.Controls.Add(Ctrl) 

Of course, there are issues with this.

When the user is editing the content, they won't be able to see this control since it's not able to be parsed dynamically as it's being edited.

If the user is able to submit server-side code, which this effectively allows them to do, there is a real security concern, and some real precautions will need to be taken to make sure they don't cause problems.

I just stumbled across this and though I would share.,

--- A Little followup ---

I tested a little code that could be used to help lock this down some.  I was thinking that since a server-side control is created from the ParseControl method, that I could examine the control and its children.  You could traverse the control tree created by the ParseControl method and impose restrictions.  For example, I could allow only LiteralControls and my Image Viewer.  If anything else is discovered, I could disallow the input.
LeBear
Top achievements
Rank 1
 asked on 06 Dec 2008
3 answers
279 views
I have the following RadGrid and I am Inserting new records inline.

                                <telerik:RadGrid AllowAutomaticInserts="false"   
                                                 OnInsertCommand="RadGrid1_ItemInserted" 
                                                 OnRowDrop="RadGrid1_RowDrop"   
                                                 OnNeedDataSource="RadGrid1_NeedDataSource"   
                                                 ID="RadGrid1"   
                                                 runat="server"   
                                                 AutoGenerateColumns="False"   
                                                 Skin="Telerik"   
                                                 AllowPaging="False"   
                                                 GridLines="None">  
                                    <MasterTableView TableLayout="Auto"   
                                                 DataKeyNames="ID"   
                                                 CommandItemDisplay="TopAndBottom">  
                                        <Columns> 
                                            <telerik:GridBoundColumn   
                                                 DataField="Category"   
                                                 HeaderText="Category"   
                                                 UniqueName="Category" /> 
                                        </Columns> 
                                    </MasterTableView> 
                                    <ClientSettings AllowRowsDragDrop="True">  
                                        <Selecting AllowRowSelect="True" /> 
                                    </ClientSettings> 
                                </telerik:RadGrid> 

My problem is that once the grid is in Insert Mode,  I need to create a Confirmation Dialog on the Insert Button that is generated by Telerik.  How do I find that control and add the javascript?

Thanks in advance.
Chase
Chase Florell
Top achievements
Rank 1
 answered on 06 Dec 2008
6 answers
130 views
How do you nest an ul in a li ? Not in the html code view but in the wysiwyg mode view ?
Anders
Top achievements
Rank 1
 answered on 05 Dec 2008
1 answer
118 views
I have three grids on one page.  All three are in edit mode and only display one item.  There is only one "Save" button on the third grid at the bottom of the page in the CommandItemTemplate.  I would like to be able to edit all three of the grids, click the Save button in the third grid and have all the data in all of the grids saved.  I'm using the ItemCommand event on that third grid to enter a server-side function to perform the save.  However, I'm currently getting the error "Object reference not set to an instance of an object" when trying to reference another grid.  Is this possible and if so, can someone provide some guidance?

Thank you,

Eric Skaggs
Eric Skaggs
Top achievements
Rank 2
 answered on 05 Dec 2008
4 answers
147 views
I have a working custom dialog box. However, when I disable the editor and later enable the editor the custom dialog will no longer work. The only work around that I have found is setting the editMode to Preview/All instead of enable/disable, but this is not ideal.

Both Q2 and Q3 versions have this issue. I am currently using the Q3, I upgraded with hopes it would fix the problem.

Regards,
Ed C.
Echarbeneau
Top achievements
Rank 1
 answered on 05 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?