Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
1.1K+ views
Hi,

I have configured the CommandItemSetting of RadGrid to diplay Refresh button. But on clicking the button nothing happens.

Do I need to wire it up to any function? There is nothing mentioned any thing about this in Telerik demo.

-Rajesh
Princy
Top achievements
Rank 2
 answered on 14 Feb 2013
1 answer
96 views
I have a simple 2 level hierarchical grid with parent and child table joined on country id.  HierarchyLoadMode is set to  "Client".  Ive enabled AllowRowSelect="True" in clientsettings.  Its also set to have all parent rows collapsed by default (HierarchyDefaultExpanded="true")

So far so good and it works fine.

Ive put a simple button on the page that posts back  - nothing more.  In future that will loop through all the rows using foreach (GridDataItem item in myRadGrid.Items) and then send the selected output to a datatable etc etc.

What Ive noticed is the following:
 - I expand a country -> I select a region -> I collapse the same country - I click the button -> the page refreshes and all is well - the selected region is showing and the country is expanded - good.  This backs up what I had read, in that local settings such as whether a parent row is collapsed or expanded, and/or a child row is selected our passed back to the server. However,  I then collapse the region and then click the button again. This time the country is collapsed and when I expand it, the region is no longer selected.  I was expecting it to behave exactly as it did first time round.  When I loop through the items in code behind the child rows is not selected either.

I think what is happening here is that the first time round the parent row (country) starts off collapsed and is posted back collapsed.  And it is then able to remember the child rows selected. The second time round it starts off expanded, but is posted back collapsed which I am guessing makes it think no child rows are selected - or something like that. 

I guess there are two solutions:
 1. When a child row is selected then don't allow the user to then collapse the parent row (I imagine this is not too hard to do in javascript)
2. Fix the problem so that it remembers the selected child rows in the second stage described above.

Any help or advice greatly appreciated.  Ive pasted below extract of the mark up  - its pretty simple.

 <asp:Button ID="Button1" runat="server" Text="Button"   />
  <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
     <telerik:RadGrid ID="RadGrid1" DataSourceID="dsCountries" runat="server" AutoGenerateColumns="False"
        AllowMultiRowSelection="False" >

        <ClientSettings>
            <ClientEvents />
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <MasterTableView ClientDataKeyNames="CountryID" DataSourceID="dsCountries" DataKeyNames="CountryID"
             HierarchyLoadMode="Client" Width="100%">
                <DetailTables>
                <telerik:GridTableView  HierarchyLoadMode="Client"
                    DataSourceID="dsRegions" Width="100%" GridLines="Horizontal" CssClass="RadGrid2">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="CountryID" MasterKeyField="CountryID">
                        </telerik:GridRelationFields>
                    </ParentTableRelation>
                    <Columns>
                        <telerik:GridBoundColumn  HeaderText="State" HeaderButtonType="TextButton"
                            DataField="State">
                        </telerik:GridBoundColumn>
                       
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
             <Columns>
                 <telerik:GridBoundColumn  HeaderText="Country" HeaderButtonType="TextButton"
                    DataField="CountryName">
                </telerik:GridBoundColumn>
               
            </Columns>
            
        </MasterTableView>
    </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 14 Feb 2013
1 answer
425 views

Hi Telerik

I will like to hear if you can be informative about how to build a timesheet similar to your TeamPlus Timesheet. Which controls have you used(gridview, listview etc.), and which framework have you used(ASP.NET AJAX, ASP.MVC etc.). 
Sample code will be appreciated.

Best regards

Claus

Plamen
Telerik team
 answered on 14 Feb 2013
1 answer
63 views
Hi
I'm expanding all the nodes of my radtreelist on page load. I dont want the user to collapse it. I think it can be done by disabling or hiding the collapse button. However I wonder if there is some other way I can have this done. Please suggest another solution if you have one.
thanks
Allen
Princy
Top achievements
Rank 2
 answered on 14 Feb 2013
3 answers
214 views
Hi!
I am using the RadSpell control with custom dictionarys enabled.
When a user is spellchecking a large text and are adding words to the custom dictionary he sometimes gets the following javascript alert error:
Spell Check Handler Server Error:12152
What is the exact errormessage for 12152?

Best regards
Marcus
Rumen
Telerik team
 answered on 14 Feb 2013
1 answer
125 views
Hi there
         My radgrid has several boundcolumns. The insertform textbox is blank. I want the textbox to show a default text. How can i accomplish this. Please help me out somebody. Grateful for your help

Savyo
Princy
Top achievements
Rank 2
 answered on 14 Feb 2013
2 answers
894 views
Hi,

I've tried to use this in JavaScript code:

var result = $find("<%= HiddenField2.ClientID %>");

But, I've got the following error:

ReferenceError: $find is not defined

I use Firefox and Firebug.

Could someone help with this issue?
Goran
Top achievements
Rank 1
 answered on 14 Feb 2013
0 answers
56 views
2 answers
427 views
have ASP.NET web application that contains master page. Master page contains content page. Content page contains user control. User control contains Telerik grid with its context menu.

I'd like to click the item in grid's context menu and open new popup modal window. In that window there's drop down list. I pick up some option from drop down list and click OK. I'd like to get the value selected from drop down list and use it in my ASP.NET code to proceed further.

I've tried to use hidden field to store the value from drop down list but it doesn't work because I'm not sure where hidden field should be placed.

This is my code:

Open popup window:


function ClientItemClicked(sender, eventArgs)
{
    if (eventArgs.get_item().get_value() == "excel")
    {
        var retVal = window.showModalDialog("ExportToExcelChoice.aspx", null, "dialogWidth: 400; dialogHeight: 200; center: yes; resizable: no;");
    }
}

Click "OK" to close popup window:

function ReturnValue() {
    var choice = document.getElementById("DropDownList1").value;
    if ((window.opener != null) && (!window.opener.closed)) {
        window.opener.document.getElementById("HiddenField1").value = choice;
    }
    window.close();
}

It fails on this line:

window.opener.document.getElementById("HiddenField1").value = choice;

Because hidden field is placed in user control and the code can't get the reference to hidden field.

Could someone help me to make it work as soon as possible?

Thank you in advance.

Goran
Top achievements
Rank 1
 answered on 14 Feb 2013
1 answer
70 views
When a cell changes to edit mode the cursor is set at the beginning of the cell contents.

Here the ajax function:

function RowDblClick(sender, eventArgs) {
               editedRow = eventArgs.get_itemIndexHierarchical();
               $find("<%= RadGrid1.ClientID %>").get_masterTableView().editItem(editedRow);
           }

How can I select the cell contents at the time the cell goes into Edit mode?
Eyup
Telerik team
 answered on 14 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?