Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
141 views
Hi everyone

Since the RadGrid doesn't automatically postback when a user selects multiple items from the RadGrid using the SHIFT key, you have to do it manually. I've implemented this behaviour by subscribing to the the RadGrid's client-side OnRowSelected event. All I do in the mentioned event handler is calling the RadAjaxManager's ajaxRequest method (also on the client) to trigger the postback:
function RowSelected(sender, args) { 
    var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); 
    ajaxManager.ajaxRequest('StrgShiftCombinationPressed'); 
} 

Should be that simple, but I have the following issue: Everytime I select multiple items with the SHIFT key, one item (actually, the last one) doesn't show up as selected after the postback. For example, if I select 4 items with the SHIFT key, first all the selected items are selected, but after the postback (and after the loading panel disappears), only 3 elements are selected.

To see what's going on on the server-side, I added an event handler for the RadGrid's server-side OnSelectedIndexChanged event. In the event handler, the grid.SelectedItems collection counts also one element less than selected (e.g. 4 items are selected with the SHIFT key, but grid.SelectedItems.Count evaluates to only 3). Also, if I select only one row with the SHIFT key pressed, the RadAjaxManager's server-side OnAjaxRequest is fired, but not the RadGrid's OnSelectedIndexChanged event (I have to mention, that I added the following AjaxSetting to the RadAjaxManager: radAjaxManager.AjaxManager.AjaxSettings.AddAjaxSetting(((MyMaster)this.Master).ajaxManager,  radGrid) ). When I select 2 items with the SHIFT key pressed, the OnSelectedIndexChanged is fired!

This issue has been bothering me for quite a long time, and I would be very thankful if somebody could successfully point me where I'm doing something wrong.

Thanks in advance.

Greetings,
Mallory
Pavlina
Telerik team
 answered on 15 Apr 2010
1 answer
102 views

Hi,
I have a RADGRID with a DATABIND client-side.
The databind event is raised with a JS SETTIMEOUT function:
setTimeout('bindGrid()', 5000);

and in a bindGrid I have a regular call to my web service:
WS.GetDocumentsSelected(startIndex, pageSize, sortField, sortOrder, filtroT, filtroM, mozione, updateGrid, koMessage);

where filtroT, filtroM, mozione are a custom filter.
The return of WS is a below code

function updateGrid(result) {   
        var tableView = $find("<%=RadGrid1.ClientID %>").get_masterTableView();   
        tableView.set_dataSource(result);   
        tableView.dataBind();   
}  

It's work fine, but I have a problem with selected row:

If I selected the second row, e.g., and I execute a sort command, my row selected persist in the second row.
The same problem occours with paging-change and a filter changed.

I try to save my selected-row id in hidden-field and in data bound function set the selection manually with the follow code:

function RadGrid1_RowDataBound(sender, args) {  
        var dkvs = document.getElementById("<%=DataKeyValueSelected.ClientID%>");   
        if (dkvs && dkvs.value && (args.get_dataItem()["Id_doc"] == dkvs.value)) {   
           //args.get_dataItem().set_selected(true);   
           sender.get_masterTableView().get_dataItems()[parseInt(args.get_item()._itemIndexHierarchical)].set_selected(true);   
        } else {   
           //args.get_dataItem().set_selected(false);   
           sender.get_masterTableView().get_dataItems()[parseInt(args.get_item()._itemIndexHierarchical)].set_selected(false);   
        }  
} 

 

after data bound the paging-change and a sort works fine, but if after row selected I remove my filter, I have all alternating item selected (after the selected row - see attached) .....

Maria Ilieva
Telerik team
 answered on 15 Apr 2010
11 answers
106 views
I have system has widgets (controls)
is the widget in the page and this widget has menu bar the image of the menu item in a wrong position

please check the image
Yana
Telerik team
 answered on 15 Apr 2010
4 answers
112 views
Hello,Telerik.
When I use Telerik gird,meet trouble below.
Scenerio is:
 I have a List page which provides all kinds of querying condition by textbox or combobox(dropdownlist).
After I filter some data,  I click one row I wanted  that open a radWindow which provides  function of  editing selected row.
after I close the opened window, I return the list page.
How can I keep the textbox or combobox(dropdownlist) status that I just typed or selected , and only refresh the grid.
sometimes, I met "Retry/Cancel" popup when I use "window.location.reload(true)" .now I update "window.location.reload(true)" to
"window.location.href=window.location.href", Only do this, cannot keep the previous state of textbox or combobox(dropdownlist)
How to solve it?
Thanks
Best Regards
Yavor
Telerik team
 answered on 15 Apr 2010
1 answer
259 views
in my webpage , I do not set  z-index to all elements.

but in IE6, RadMenu's Drop List is shown behind DIV. 

In IE8,  I use RadWindow  as Modal Dialog, but the Window can't override this Menu.

my page :(sorry,it's so long)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <style type="text/css">
        html, body
        {
            overflow: hidden;
            height: 100%;
            margin: 0;
            padding: 0;
            font: 13px Georgia, Arial, Simsun;
        }
        html
        {
            _padding: 92px 0;
        }
        #divPageHead
        {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100px;
            background: #EFF3FB;
        }
        #divPageMenu
        {
            position: absolute;
            top: 70px;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
        }
        #divPageFoot
        {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 30px;
            background: #EFF3FB;
        }
        #divPageBody2
        {
            position: absolute;
            top: 140px;
            right: 0;
            bottom: 40px;
            left: 0;
            overflow: hidden;
            width: 100%;
            _height: 100%;
        }
        #divPageLeft2
        {
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            overflow: auto;
            width: 240px;
            _height: 100%;
            background: #EFF3FB;
        }
        #divPageRight2
        {
            position: absolute;
            _position: static;
            top: 0;
            right: 0;
            bottom: 0;
            left: 250px;
            overflow: auto;
            _overflow: hidden;
            _height: 100%;
            _margin-left: 250px;
            background: #EFF3FB;
        }
        #divRightContent2
        {
            _overflow: auto;
            _width: 100%;
            _height: 100%;
        }
        #divPageBar2
        {
            position: absolute;
            top: 110px;
            left: 0;
            right: 0;
            height: 30px;
            width: 100%;
            overflow: hidden;
            z-index: 10;
        }
        #divPageLeftHd2
        {
            position: absolute;
            top: 0;
            left: 0;
            width: 240px;
            height: 30px;
            background: #F00;
        }
        #divPageRightHd2
        {
            position: absolute;
            _position: static;
            top: 0;
            left: 250px;
            right: 0;
            height: 30px;
            _margin-left: 250px;
            background: #FF0;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="divPageHead">
        <div style="height: 70px">
            some text
        </div>
        <div id="divPageMenu">
            <telerik:RadMenu ID="mainMenu" runat="server" CausesValidation="False" EnableViewState="False"
                PersistLoadOnDemandItems="False">
            </telerik:RadMenu>
        </div>
    </div>
    <div id="divPageBar2">
        <div id="divPageLeftHd2">
        </div>
        <div id="divPageRightHd2">
        </div>
    </div>
    <div id="divPageBody2">
        <div id="divPageLeft2">
        </div>
        <div id="divPageRight2">
            <div id="divRightContent2">
            </div>
        </div>
    </div>
    <div id="divPageFoot">
        Copyright &copy;(2010)
    </div>
    </form>
</body>
</html>

Peter
Telerik team
 answered on 15 Apr 2010
1 answer
210 views
hi

I have a menu in the master page and i would like to fix its position.

For example, when i have default page that uses the master page and when i scroll up and down the default page, the menu should stay fix. what should i do? Thanks
Yana
Telerik team
 answered on 15 Apr 2010
7 answers
283 views
i ve griddropdowncolumn and gridbound columns on my radgrid
while selecting the value from dropdown i need to bind values on bound columns n also i want to make some bound columns read only true on the selected index changes event
<telerik:radgrid   ID="RadGrid1" runat="server" Height="300" Visible="true" BackColor="LightBlue" ShowFooter="true" PageSize="20" AllowPaging="True" AllowFilteringByColumn="True" AllowSorting="true" ShowStatusBar="true" GridLines="None" AutoGenerateColumns="False" Skin="Vista"   OnPreRender="RadGrid1_PreRender"  OnItemDataBound ="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated"  OnNeedDataSource="RadGrid1_NeedDataSource" OnColumnCreated="RadGrid1_ColumnCreated" >                                                                                                                              
                <MasterTableView      CommandItemDisplay="Top" AutoGenerateColumns="false" AllowFilteringByColumn="True" AllowSorting="true"   >                                                                                    
                        <ExpandCollapseColumn><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn> 
                        <RowIndicatorColumn><HeaderStyle Width="20px" /></RowIndicatorColumn> 
                        <ExpandCollapseColumn><HeaderStyle Width="20px" /></ExpandCollapseColumn>                                                                                                 
                        <Columns>                        
               <%-- <telerik:GridDropDownColumn DataField="a" HeaderText="a" UniqueName="a"  />--%> 
               <telerik:GridDropDownColumn DataField="a" HeaderText="a" UniqueName="a" ListTextField="a" ListValueField="a" DataSourceID="SqlDataSource1"/>                 
               <telerik:GridBoundColumn    DataField="b" HeaderText="b" UniqueName="b" />                 
               <telerik:GridBoundColumn    DataField="c" HeaderText="c" UniqueName="c" />                 
               <telerik:GridBoundColumn    DataField="d" HeaderText="d" UniqueName="d" />   


 protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
        { 
            if (e.Item is GridEditFormItem && e.Item.IsInEditMode) 
            { 
                string[] strArray = { "a", "e"}; 
                    GridEditFormItem item = (GridEditFormItem)e.Item; 
                    for (int k = 0; k < 2; k++) 
                    { 
                        GridDropDownListColumnEditor editor = (GridDropDownListColumnEditor)item.EditManager.GetColumnEditor(strArray[k]); 
                        editor.DataSource = (DataSet)Session["sesds"]; 
                        editor.DataTextField = strArray[k]; 
                        editor.DataValueField = strArray[k]; 
                        editor.DataBind(); 
                        editor.ComboBoxControl.AutoPostBack = true; 
                        editor.ComboBoxControl.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(ComboBoxControl_SelectedIndexChanged); 
                    } 
                     
            } 
             
        } 
 
 
protected void ComboBoxControl_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
        { 
            try 
            { 
                //string ElementID = Convert.ToString((sender as RadComboBox).SelectedItem.Text); 
                RadComboBox rad = (RadComboBox)o;                 
                GridEditableItem editedItem = (GridEditableItem)(o as RadComboBox).NamingContainer; 
                GridEditManager editMan = editedItem.EditManager; 
                foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns) 
                { 
                if (column is IGridEditableColumn) 
                {                    
                    IGridEditableColumn editableCol = (column as IGridEditableColumn); 
                    if (editableCol.IsEditable) 
                    { 
                        IGridColumnEditor editor = editMan.GetColumnEditor(editableCol);                         
                        if (editor is GridTextColumnEditor) 
                        {                         
                            if ( rad.ID.ToLower() == "rcb_a") 
                            { 
                                if (column.UniqueName == "b") 
                                { 
                                    (editor as GridTextColumnEditor).Text = "Done"; 
                                } 
                                else if (column.UniqueName == "c") 
                                { 
                                    (editor as GridTextColumnEditor).Text = "ok"; 
                                } 
                                else if (column.UniqueName == "d") 
                                { 
                                    (editor as GridTextColumnEditor).Text = "ok1"; 
                                } 
                            } 
                            if (rad.ID.ToLower() == "rcb_e") 
                            { 
                                if (column.UniqueName == "f") 
                                { 
                                    (editor as GridTextColumnEditor).Text = "Done2"; 
                                } 
                                else if (column.UniqueName == "g") 
                                { 
                                    (editor as GridTextColumnEditor).Text = "ok2"; 
                                } 
                                else if (column.UniqueName == "h") 
                                { 
                                    (editor as GridTextColumnEditor).Text = "ok3"; 
                                    (editor as GridTextColumnEditor).Visible = false; 
                                } 
                            } 
                             
                        } 
                    } 
                 } 
              }             
            } 
            catch 
            { 
 
            } 
        } 


i can able to fetch values to bound columns but couldnt make it as non editable .
dynamically i want to set ,for some scenarios i need to make them as non editable ,n for some it shd be editable for that
only am not setting those properties on source


thanks in advance
shankar mohan
Top achievements
Rank 1
 answered on 15 Apr 2010
3 answers
104 views
I have a panel bar that is built up of some pretty expensive database queries, I don't want this binding to happen per page load.

In my code I build up the panel using allocated RadPanelItems(), and than I was planning to allocate a RadPanelItemCollection() to put all the items into.  Then I would only have to cache that Item Collection once across the site, and just assign it to the Items property of the RadPanel...  But you can't do that.

The collection can only be constructed with a parent control, and once a control is built you can't assign a collection to it (get, no set).

How are you supposed to cache the items list in a RadPanel?  I don't want it to have to cache per user, and I don't want to have the bind happen over and over.

Thanks.


Kalina
Telerik team
 answered on 15 Apr 2010
3 answers
132 views
Hi

I have a databound Repeater control. I'm using RadWindow to show additional Data and pop up additional forms.

Currently I have:

GetRadWindow().BrowserWindow.location.href = GetRadWindow().BrowserWindow.location.href;

to reload the page so that any changes take effect. The problem is it relaods the whole page and resets any paramters that may be selected in a series of dropdowns. All I want to do is refresh the Repeater contol with Ajax from the RadWindow close.

How would I go about doing this.
Andy

Georgi Tunev
Telerik team
 answered on 15 Apr 2010
1 answer
69 views
I basically don't want the user to be able to enter paragraphs into the RadEditor.  Is there a way to make it single-line only?
Stanimir
Telerik team
 answered on 15 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?