Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
572 views
Hello,

I've been trying to find documentation about the Radmenu1.FindItem property and how to use conditions.
Could someone provide any examples or documentation links?
The problem is that I need to disable all items from a root and show those itens disabled.

Thanks for any help.

Marcio Nascimento
KSBA Techie
Top achievements
Rank 1
 answered on 04 Feb 2010
2 answers
135 views
I have a routine to handle enter key as save. However if the user enters an invalid date and hits enter i do not want the save functionality to be implemented. My Page.IsValid is returned true if the date entered is an invalid date.

is there a workaround for this?
below is the code for my enter key routine:

function

 

HandleEnterAsSave(sender, eventArgs) {

 

 

if (eventArgs.get_domEvent().keyCode == 13) {

 

 

//__doPostBack("btnSave", "Save");

 

 

var saveButton = document.getElementById('<%= btnSave.ClientID %>');

 

saveButton.click();

}

}

newbie
Top achievements
Rank 1
 answered on 04 Feb 2010
3 answers
86 views
I have a RadGrid and am using a customer usercontrol for the insert/edit forms.  I have an edit column in the grid, and have sized it down to a very small column, 15px.

<telerik:RadGrid ID="_cloudGrid" runat="server" DataSourceID="_dsClouds"    
      AllowAutomaticUpdates="True"   
      AllowAutomaticDeletes="True"   
      AllowAutomaticInserts="True" 
      AutoGenerateColumns="False" > 
      <MasterTableView Width="100%"  CommandItemDisplay="Top" DataKeyNames="Id" InsertItemDisplay="Top" EditMode="EditForms">  
         <CommandItemSettings AddNewRecordText="Create Cloud Account" /> 
         <Columns> 
            <telerik:GridEditCommandColumn HeaderText="Edit" Resizable="false" ButtonType="ImageButton">  
               <HeaderStyle Width="15" /> 
            </telerik:GridEditCommandColumn> 
            <telerik:GridBoundColumn DataField="Id" HeaderText="Id" ReadOnly="true" Visible="false" /> 
            <telerik:GridBoundColumn DataField="Alias" HeaderText="Name" ReadOnly="false" Visible="true" /> 
            <telerik:GridDropDownColumn DataField="Provider" HeaderText="Provider" ReadOnly="false" Visible="true" ListTextField="Name" ListValueField="Value" DataSourceID="_dsProviders" /> 
            <telerik:GridBoundColumn DataField="Login" HeaderText="Access Key" ReadOnly="false" Visible="true" /> 
         </Columns> 
         <EditFormSettings UserControlName="CloudEditForm.ascx" EditFormType="WebUserControl">  
            <PopUpSettings Modal="true" /> 
         </EditFormSettings> 
      </MasterTableView> 
      <ClientSettings> 
         <Resizing  AllowColumnResize="false" AllowRowResize="false" EnableRealTimeResize="false" ClipCellContentOnResize="true" /> 
      </ClientSettings> 
   </telerik:RadGrid> 


When the grid is initally displayed the edit column looks fine.  When you clicke the edit button, the columns resize and the edit column is now much larger.  The resizing only seems to occur when the EditMode is "EditForms", if the EditMode is "PopUp" the resizing doesn't occur.

Has anyone seen this, and possibly have a workaround?

Thanks,
Steve
Steve Wolfe
Top achievements
Rank 1
 answered on 04 Feb 2010
2 answers
179 views
I got a treeview, where its importante to me to get the full path of id's, from the first parent, to the last child checked, but the user dont need to get in the full depth of each tree.

I tried:

 

string message = string.Empty;

 

foreach (RadTreeNode node in trvCategorization.CheckedNodes)

 

 

{
    if (node.Nodes.Count == 0)

        message += node.FullPath +

 

 

 

 

"<br/>";

 }

Label1.Text = message;

 

 


It doesnt work. Besides certain nodes have no checked nodes, these uncheked nodes are retuned by the Count. And I can get the ID path using that, theres no FullValuePath method. I cant do a node.CheckedNodes.Count too. Is there a built in method that I still dont look at, or do I need to code a recursive method to get these paths, since i can have different depths in diferente cenarios?

How do I use the format code block?
André Freitas
Top achievements
Rank 1
 answered on 04 Feb 2010
2 answers
263 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
294 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
124 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
225 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
206 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
84 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
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?