Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
257 views
I've been trying unsuccssfully to be able to click on a row within the radgrid to trigger a postback so that when a user hits the "browser back button" it would back up to the original state or in my case a panel that was hidden.  It seems that the postback is still ajaxified somehow and when hitting the back button it goes back to far as if the row selection postback never occured so the browser is not seeing it in it's history.
So I'm trying to hide and show panels depending on what the user clicks upon (all on the same page) and I can hide and show all these panels and hit the browser back button at any time and it will bring me to the previously hidden panel, but if I select a row with the radgrid with the settings "EnablePostBackOnRowClick = true"     
it just backs up a whole page OR crashes my browser completely...Any ideas on what's going on here???  I've tried with and without the 

RadAjaxManager



<

 

telerik:RadGrid ID="rgdUsers" runat="server" HeaderStyle-HorizontalAlign="Center" Width="98%" Skin="OurSkin" EnableEmbeddedSkins="false"

 

 

 

AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" OnPageSizeChanged="rgdUsers_PageSizeChange" GridLines="Both" onneeddatasource="rgdUsers_NeedDataSource" PageSize="10"

 

 

 

onpageindexchanged="rgdUsers_PageIndexChanged" onselectedindexchanged="rgdUsers_SelectedIndexChanged" onsortcommand="rgdUsers_SortCommand">

 

 

 

<ClientSettings EnablePostBackOnRowClick="true">

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

<ClientEvents OnRowSelected="RowSelected" />

 

 

 

</ClientSettings>

 

 

 

<MasterTableView DataKeyNames="LastName, FirstName, UserName, Role">

 

 

 

<PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="True" />

 

 

 

<Columns>

 

 

 

<telerik:GridButtonColumn CommandName="Select" DataTextField="UserName" HeaderText="Click to Edit" SortExpression="UserName" UniqueName="UserName">

 

 

 

</telerik:GridButtonColumn>

 

 

 

<telerik:GridBoundColumn DataField="LastName" HeaderText="Last" SortExpression="LastName" UniqueName="LastName">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FirstName" HeaderText="First" SortExpression="FirstName" UniqueName="FirstName">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" UniqueName="UserName" Visible="False">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Role" HeaderText="User_Type" SortExpression="Role" UniqueName="Role">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="UserID" HeaderText="UserID" UniqueName="UserID" Visible="False">

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

Pavlina
Telerik team
 answered on 04 Feb 2010
9 answers
283 views

When editing text I click within text in H2, then click the H2 in the Dom path to select the tag.. and then select a class in the ApplyCss dropdown.
The editor inserts a span tag with the class applied.  I tried the online demos and it did the same thing.  I tried a  'RadEditor for asp.net' demo and it applied to the H2, as expected. 

I also tried applying a class to paragraphs, selecting via dom path,  and it always inserted a span tag, with the class applied.

Did I miss a config to prevent this?

Additionally, should a "element.class" limit which elements the editor will apply to?  Like, H2.big would only apply to H2 tags  in the edit view?  (would be a great feature)

Thanks,
David




Dobromir
Telerik team
 answered on 04 Feb 2010
1 answer
116 views
I am attempting to use a hierarchical grid and am having a number of issues with the ExpandColumn.  I want to hid the auto-generated expand column placed in the first column of all levels and add a formatted image for the expand column in the last column.  I have managed the last requirement by placing a GridButtonColumn with a Command handler to expand/collaspe the parent grid item.  This works, sort of.

The bigger problem comes when expanding the second level table.  I used the examples provided for others for hiding the expandcolumn in the first column and that seems to work until I expand the grid.  Then the expandcolumn for the first level is shown - moving the second level over by 250px. (which is the size of the first grids first data column).  I can see that the code to hide the expandcolumns is the last thing running - as expected as it is called from the grid's PreRender event.

It may help to show some code:

Here is the grid:

    <telerik:RadGrid ID="statusGrid" runat="server" EnableViewState="false" AllowPaging="false" AllowSorting="false" 
                     OnNeedDataSource="statusGrid_NeedDataSource" OnItemCreated="statusGrid_ItemCreated"   
                     OnDetailTableDataBind="statusGrid_DetailTableDataBind" OnPreRender="statusGrid_PreRender" 
                     AutoGenerateColumns="false" AllowMultiRowSelection="false" Width="98%" OnItemCommand="statusGrid_ItemCommand">  
        <MasterTableView EnableViewState="false" EnableNoRecordsTemplate="true" GridLines="None" 
                         AllowFilteringByColumn="false" ShowHeader="false" ShowFooter="false" 
                         DataKeyNames="StatusID" HorizontalAlign="Right" Width="100%" Name="Status" 
                         HierarchyLoadMode="ServerOnDemand" HierarchyDefaultExpanded="false" > 
            <NoRecordsTemplate> 
                No Patients or Forms available.  
            </NoRecordsTemplate> 
            <ItemStyle BackColor="#CDE3DD" /> 
            <Columns> 
                <telerik:GridTemplateColumn> 
                    <ItemStyle HorizontalAlign="Left" Width="250px" CssClass="statusInfo" /> 
                    <ItemTemplate>                          
                        <asp:Label ID="status" runat="server" /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn> 
                    <ItemStyle Width="350px" BorderStyle="None" /> 
                    <ItemTemplate> 
                        &nbsp;  
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn> 
                    <ItemStyle HorizontalAlign="Right" Width="250px" CssClass="statusItem" /> 
                    <ItemTemplate> 
                        <asp:Label ID="patientCount" runat="server" /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridButtonColumn UniqueName="levelOne" ButtonType="ImageButton" CommandName="Expand" ImageUrl="../images/header_menu.gif" > 
                    <ItemStyle HorizontalAlign="Right" CssClass="statusButton" /> 
                </telerik:GridButtonColumn> 
            </Columns>                          
            <DetailTables> 
                <telerik:GridTableView DataKeyNames="PatientID" EnableViewState="false" AllowSorting="false" 
                                       AllowPaging="true" PageSize="5" OnDataBound="patientGrid_DataBound" Name="Patients" > 
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="StatusID" MasterKeyField="StatusID" />                          
                    </ParentTableRelation> 
                    <Columns> 
                        <telerik:GridTemplateColumn> 
                            <ItemStyle HorizontalAlign="Left"  Width="250px"/>  
                            <ItemTemplate>                          
                                <asp:Label ID="patient" runat="server" /> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridTemplateColumn> 
                            <ItemStyle HorizontalAlign="Right" Width="250px"/>  
                            <ItemTemplate> 
                                <asp:Label ID="formCount" runat="server" /> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridExpandColumn UniqueName="levelTwo" CollapseImageUrl="../images/expand.jpg" ExpandImageUrl="../images/expand.jpg" > 
                            <HeaderStyle HorizontalAlign="Right" Width="10px" />                              
                        </telerik:GridExpandColumn> 
                    </Columns> 
                    <DetailTables> 
                        <telerik:GridTableView DataKeyNames="FormID" EnableViewState="false"   
                                               AllowPaging="true" PageSize="20" OnDataBound="formGrid_DataBound" Name="Forms" > 
                            <ParentTableRelation> 
                                <telerik:GridRelationFields DetailKeyField="PatientID" MasterKeyField="PatientID" /> 
                            </ParentTableRelation> 
                            <HeaderStyle CssClass="listItem" /> 
                            <ItemStyle CssClass="listItem" /> 
                            <Columns> 
                                <telerik:GridButtonColumn HeaderText="Form Name" DataTextField="SurveyName" SortExpression="SurveyName" ButtonType="LinkButton">  
                                    <ItemStyle ForeColor="#1A3F62" Font-Bold="false" Font-Underline="false" /> 
                                </telerik:GridButtonColumn> 
                                <telerik:GridBoundColumn DataField="PatientInitials" HeaderText="Patient Initials" SortExpression="PatientInitials" ReadOnly="true" /> 
                                <telerik:GridBoundColumn DataField="Comment" HeaderText="Comment" SortExpression="Comment" ReadOnly="true" /> 
                                <telerik:GridBoundColumn DataField="VisitName" HeaderText="Visit Name" SortExpression="VisitName" ReadOnly="true" /> 
                                <telerik:GridDateTimeColumn DataField="LastChange" HeaderText="Last Change" SortExpression="LastChange" ReadOnly="true" /> 
                                <telerik:GridBoundColumn DataField="ChangedBy" HeaderText="Changed By" SortExpression="ChangedBy" ReadOnly="true" /> 
                            </Columns> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                </telerik:GridTableView> 
            </DetailTables> 
        </MasterTableView> 
    </telerik:RadGrid> 
 

Here is the code run from the statusGrid-PreRender:

    /// <summary>  
    /// Hides the expand column recursively.  
    /// </summary>  
    /// <param name="view">The view.</param>  
    private void HideExpandColumnRecursive( GridTableView view )  
    {  
        GridItem[] nestedViewItems = view.GetItems( GridItemType.NestedView );  
        foreach ( GridNestedViewItem nestedViewItem in nestedViewItems )  
        {  
            foreach ( GridTableView nestedView in nestedViewItem.NestedTableViews )  
            {  
                if ( nestedView.Items.Count == 0 )  
                {  
                    nestedViewItem.Visible = false;  
 
                    TableCell cell = nestedView.ParentItem["ExpandColumn"];  
                    cell.Visible = false;  
                      
                    cell.Controls[0].Visible = false;  
                }  
 
                if ( nestedView.HasDetailTables )  
                {  
                    HideExpandColumnRecursive( nestedView );  
                }  
            }  
        }  
    }  
 

and attached is a screen shot of the expanded grid:    

Any help is greatly appreciated.

David
Pavlina
Telerik team
 answered on 04 Feb 2010
1 answer
219 views
The load on demand example has the developer creating RadComboBoxItem objects and add those to the RadComboBox items collection.

Is there any way to work with Load on Demand in conjunction with the defined datasource model, where I have a datasource on my page that is fetching the objects for the radcombobox, or do I have to manually create RadComboBoxItems in order to use Load On Demand?
Kalina
Telerik team
 answered on 04 Feb 2010
6 answers
192 views
I have a radcombobox that using an item template to show tabular data. There is 3 columns in total.
This all works fine on server side if I create the collection of RadComboBoxItems and have it bound to the control. The item template will render the tabular data.

What I am trying to achieve now is to create the items client side. So I am using javscript to create the items and adding it to the collection and setting the attributes as well. I am not using databinding on server side so i am not sure on how to get the itemtemplate to render the multi-columns.

So I need to know
1. how to implement the itemtemplate without server side binding
2. how get templates to work on client side

Can some one point me in the right direction.

Thanks
Veselin Vasilev
Telerik team
 answered on 04 Feb 2010
1 answer
79 views
Hello,
I'm experiencing some problem with RadAjaxManager. I don't know if it is a normal behaviour or not. This is the scenario:
I have to use a RadGrid that uses a Window for Insert/Editing. I have seen this example:

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid

This works perfectly if I use RadAjaxManager as described in the example. In my case, I have a RadPanelBar on the left side of my page, that loads a RadTabstrip with RadMultiPage. In one of these page I have the RadGrid that uses Window for editing. If I set RadAjaxManager to updates the multipage on panelbar modifications, It's not possible to see the Windows anymore...

Can anyone suggest me a workaround to fix problem?

Thank you

Iana Tsolova
Telerik team
 answered on 04 Feb 2010
4 answers
195 views
I have a tree view.
I add a new node, and allow the user to edit it.
The user presses the escape key and cancels the editing.

Problem: There is no event to let me know that the editing was cancelled, so that I can remove the node!

From my testing, it would appear that in this case niether the "OnClientNodeEdited" or "OnClientNodeEditing" events are triggered

Unless I am missing something, there is no other event that would cover this case.

Is there anything I can do, other than set-up a timer to poll for the change in the editing state of the node?

Thanx

Andrew
Jason
Top achievements
Rank 2
 answered on 04 Feb 2010
1 answer
158 views
Hi,

I have a Filter-enabled Grid with 10 columns. The last column's type is CheckBox. If doing filter without data back, the last column will disappear. If I put the CheckBox column as the last second column, then when I scroll to the end of grid, it will disappear also. I have to scroll back a little bit to see it. How can I fix this problem?

I am using the following setting:

</

 

MasterTableView>

 

 

<FilterItemStyle HorizontalAlign="Left" />

 

 

<HeaderStyle Font-Bold="true" />

 

 

<ClientSettings EnableRowHoverStyle="true">

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" FrozenColumnsCount="2">

 

 

</Scrolling>

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 

 

<PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />

 

 

</telerik:RadGrid>

Thanks,
Enoch

Pavlina
Telerik team
 answered on 04 Feb 2010
1 answer
103 views
Does Multi column menu have RTL support ?
Veronica
Telerik team
 answered on 04 Feb 2010
1 answer
106 views
Hello.

On the masterpage I have search form. After clicking on button "search" loaded radgrid (search form is not visible). Here url adress is the same as in search form. On hyperlink pressing in radgrid open new page with details data. Here url adress is the another. Here I have button "Go back". If I press on this button, I go on search form, but I need go to radgrid . Before using radajaxmanager  I have used javascript:history.go(-1); for going back on radgrid. But now it not work correctly. Do you have any idea?

<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnSearch">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="btnSearch" />
                <telerik:AjaxUpdatedControl ControlID="contentView1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
...
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>


Regards,
Roman
Iana Tsolova
Telerik team
 answered on 04 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?