Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
89 views
Hi,

I have a requirement to create mutliple Radwindows in a server control, and opening the radwindow on menu item click event at client side. For testing purpose i have created two radwindows in the page load, added button and textbox events to it, and created a custom attribute to the rad menu item to pass the radwindow id, and calling the radwindow based on the id, but the issue here is
  • Even though i have added the controls for both radwindows, on the menu  item click i am able to see the Radwindow with controls only for menu, for other menu item click the radwindow opening without any content in it.
  • On the button event on the Radwindow, the entire page is getting refrehsed. ( because the radwindow is child control of the page),

so how to handle the scenario to not to refresh the page when the button on radwindow is clicked.

i am using the telerik version : 2010.2.929.35
Thanks,
Srikanth

 

Georgi Tunev
Telerik team
 answered on 01 Dec 2010
5 answers
254 views
Hello Sir,

How can i make validation for GridCheckBoxColumn.
I have a dropdownlist depending upon the value the checkbox is visible/hide.
but i want when checkbox is visible it should validate..if checkbox is disabled then no need for validation..

Please Help.

Thanks

 

Princy
Top achievements
Rank 2
 answered on 01 Dec 2010
4 answers
92 views
Hi all,

How can i display different msg in my input text box?
For example like
         if users ignore that email textbox, <email is required>,
         then if error format will display      <invalid email >.

My msg need to display in textbox like attechment.
Isit posible?
Any help is appreciated.

Best regards,
Nasri
Arteta Sam
Top achievements
Rank 1
 answered on 01 Dec 2010
3 answers
80 views
Hi. I have successfully installed the latest RadEditor on my site  but it won't allow me to save a list when I edit the contents (or create new).

To reproduce, enable RadEditor for list items and then edit the contents of a list item and press save.

The save command is ignored and nothing happens, although the cancel works just fine.

Any ideas?

thx 

Chris
Stanimir
Telerik team
 answered on 01 Dec 2010
1 answer
58 views
Hi,i have a treeview that dynamically filled with nodes in code behind and attach the context menu for it in code behind as well 
and when i clicked on the node an IFrame Loaded and the context menu item load an rad window created in the code behind ,first i faced an error about the viewstate that it not the same with the post back,i worked around by setting a root node "." and set the selected=true,but now when i click the context menu  at the first time i got "Microsoft JScript runtime error: '_events' is null or not an object "

 the only client event i use is the onClientContextMenuShowing
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }
 
        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
 
i hope you find me a solution for that ...Thank You
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }

        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
  
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }

        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }
 
        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
             if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }

        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
  
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }
 
        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
             }
                else {
                    menuItem.set_enabled(true);
                }
  
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }

        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }

        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
         }
        }
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }

        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
function onClientContextMenuShowing(sender, args) {
            var treeNode = args.get_node();
            treeNode.select();
            //enable/disable menu items
            setMenuItemsState(args.get_menu().get_items(), treeNode);
        }

        //this method disables the context menu items for the Root element
        function setMenuItemsState(menuItems, treeNode) {
            for (var i = 0; i < menuItems.get_count(); i++) {
                var menuItem = menuItems.getItem(i);
                if (treeNode.get_text() == ".") {
                    menuItem.set_enabled(false);
                }
                else {
                    menuItem.set_enabled(true);
                }
            }
        }
Nikolay Tsenkov
Telerik team
 answered on 01 Dec 2010
5 answers
250 views
Hi All,
I have the need to get the selected value from a GridDropDownColumn while the row is not in Edit mode.
My Grid is defined as :
<telerik:RadGrid ID="rgCriterias" runat="server" GridLines="None" OnDeleteCommand="rgCriterias_DeleteCommand"
    OnInsertCommand="rgCriterias_InsertCommand" OnItemCommand="rgCriterias_ItemCommand"
    OnItemDataBound="rgCriterias_ItemDataBound" OnNeedDataSource="rgCriterias_NeedDataSource"
    OnPreRender="rgCriterias_PreRender" OnUpdateCommand="rgCriterias_UpdateCommand"
    OnCreateColumnEditor="rgCriterias_CreateColumnEditor">
    <ClientSettings EnableRowHoverStyle="True">
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" ScrollHeight="400px" UseStaticHeaders="True" />
    </ClientSettings>
    <MasterTableView DataKeyNames="Id,Version,CategoryId" AutoGenerateColumns="False"
        CommandItemDisplay="Top" EditMode="EditForms">
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                <HeaderStyle Width="8%" />
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="Sequence" DataType="System.Int32" HeaderText="Sequence"
                UniqueName="Sequence" ReadOnly="True">
                <HeaderStyle Width="12%" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description">
                <HeaderStyle Width="15%" />
            </telerik:GridBoundColumn>
            <telerik:GridHTMLEditorColumn DataField="Notes" HeaderText="Notes" UniqueName="Notes"
                ConvertEmptyStringToNull="False">
                <HeaderStyle Width="20%" />
            </telerik:GridHTMLEditorColumn>
            <telerik:GridHTMLEditorColumn DataField="TypicalResponse" HeaderText="Typical Response"
                UniqueName="TypicalResponse" ConvertEmptyStringToNull="False">
                <HeaderStyle Width="20%" />
            </telerik:GridHTMLEditorColumn>
            <telerik:GridDropDownColumn DataField="RoleId" EmptyListItemText="-- Select Role --"
                EmptyListItemValue="-1" EnableEmptyListItem="True" HeaderText="Role" ListTextField="desc"
                ListValueField="code" UniqueName="Role">
                <HeaderStyle Width="10%" />
            </telerik:GridDropDownColumn>
            <telerik:GridNumericColumn DataField="Weighting" DataType="System.Decimal" DefaultInsertValue="0"
                EmptyDataText="0" HeaderText="Weighting" UniqueName="Weighting" DataFormatString="{0:###.00}">
                <HeaderStyle Width="10%" />
            </telerik:GridNumericColumn>
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="column1"
                ButtonType="ImageButton" ConfirmDialogType="RadWindow">
                <HeaderStyle Width="5%" />
            </telerik:GridButtonColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn UniqueName="EditCommandColumn1">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</telerik:RadGrid>
I have a button I click that I then need to fill out an object with the selected rows data.  I am able to do so mostly by using the GridDataItem from the MasterTableView.GetSelectedItems(). From there, I access the .Text property of the table cell.
But with a GridDropDownColumn, I am after the Value of the dropdownlist item, not the Text.
How do I access this?
Thanks for any info.
Steele.
Marin
Telerik team
 answered on 01 Dec 2010
1 answer
89 views
I have a grid which is working exactly as I want apart from one slight annoyance which I can't seem to fix.

My grid has a paging turned on and a page size of 25. In my example, my grid has 566 pages.

I have also allowed grouping on the grid so users can drag the column header to the grouping bar.

When a user creates a group and the number of rows for that group exceeds my page size, then a message shows saying...

"Group: x (showing y of z items. Group continues on the next page)"

However, I have a group which has 36 items in and, by chance, the first 11 of these fall on one page and the remaining 25 on the next.

On the first page for this group (which happens to be page 3 of my grid), the group header message reads...

"Group: x (showing 11 of 36 items. Group continues on the next page)"

but on the second page (page 4 of my grid) the group header message reads...

 "Group: x (... group continued from the previous page. Showing 0 of 36 items."

Surely this should read...

 "Group: x (... group continued from the previous page. Showing 25 of 36 items."

Is this a known bug or am I missing something?
Vasil
Telerik team
 answered on 01 Dec 2010
3 answers
19 views
+
Hi everyone,

I have a RadGrid which i am builind up from xml in my code behind. The problem is that when sorting the 'date created' column, the grid sorts the fields as if it were a string. For example 01/03/10 would come before 02/03/05.

Here is the code:

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">

 

 

<telerik:RadGrid ID="rgHistory" ItemStyle-Font-Size="10px" AlternatingItemStyle-Font-Size="10px"

 

 

HeaderStyle-Font-Size="10px" runat="server" AllowSorting="True"

 

 

Skin="WebBlue" Width="895px" AutoGenerateColumns="false">

 

 

<AlternatingItemStyle Font-Size="10px" />

 

 

<ItemStyle Font-Size="10px" />

 

 

<MasterTableView TableLayout="Fixed" Width="100%">

 

 

<Columns>

 

 

<telerik:GridDateTimeColumn DataField="Created Date" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="50px" HeaderText="Created Date"

 

 

UniqueName="Created Date" >

 

 

<HeaderStyle Width="52px" />

 

 

</telerik:GridDateTimeColumn>

 

 

<telerik:GridBoundColumn DataField="Details" HeaderStyle-Width="360px" HeaderText="Details"

 

 

UniqueName="Details">

 

 

<HeaderStyle Width="360px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Handler" HeaderStyle-Width="75px" HeaderText="Handler"

 

 

UniqueName="Handler">

 

 

<HeaderStyle Width="75px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Action Type" HeaderStyle-Width="40px" HeaderText="Action Type"

 

 

UniqueName="Action Type">

 

 

<HeaderStyle Width="39px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Corr Type" HeaderStyle-Width="40px" HeaderText="Corr Type"

 

 

UniqueName="Corr Type">

 

 

<HeaderStyle Width="39px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Cost Code" HeaderStyle-Width="80px" HeaderText="Cost Code"

 

 

UniqueName="Cost Code">

 

 

<HeaderStyle Width="80px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="No of Units" HeaderStyle-Width="40px" HeaderText="No of Units"

 

 

UniqueName="No of Units">

 

 

<HeaderStyle Width="39px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Cost Value" HeaderStyle-Width="40px" HeaderText="Cost Value"

 

 

UniqueName="Cost Value">

 

 

<HeaderStyle Width="39px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Completed Date" HeaderStyle-Width="50px" HeaderText="Completed Date"

 

 

UniqueName="Completed Date">

 

 

<HeaderStyle Width="52px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Cost Desc" HeaderStyle-Width="80px" HeaderText="Cost Desc"

 

 

UniqueName="Cost Desc">

 

 

<HeaderStyle Width="80px" />

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

</MasterTableView>

 

 

<HeaderStyle Font-Size="10px" />

 

 

</telerik:RadGrid>

 

 

</telerik:RadAjaxPanel>

 


The grid is bound to a datatable:

 

Dim table As DataTable

 

table =

New DataTable("History")

 

 

Dim rCreatedDate As DataColumn = New DataColumn("Created Date")

 

rCreatedDate.DataType = System.Type.GetType(

"System.DateTime")

 

table.Columns.Add(rCreatedDate)

 

Dim rDetails As DataColumn = New DataColumn("Details")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rDetails)

 

Dim rHandler As DataColumn = New DataColumn("Handler")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rHandler)

 

Dim rActionType As DataColumn = New DataColumn("Action Type")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rActionType)

 

Dim rCorrType As DataColumn = New DataColumn("Corr Type")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rCorrType)

 

Dim rCostCode As DataColumn = New DataColumn("Cost Code")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rCostCode)

 

Dim rCostNoUnits As DataColumn = New DataColumn("No of Units")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rCostNoUnits)

 

Dim rCostValue As DataColumn = New DataColumn("Cost Value")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rCostValue)

 

Dim rCompletedDate As DataColumn = New DataColumn("Completed Date")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rCompletedDate)

 

Dim rCostDescription As DataColumn = New DataColumn("Cost Desc")

 

rCreatedDate.DataType = System.Type.GetType(

"System.String")

 

table.Columns.Add(rCostDescription)

 

 

newRow.Item(

"Created Date") = historyItem.SelectSingleNode("following-sibling::history.created_date").InnerText

 

newRow.Item(

"Details") = historyItem.SelectSingleNode("following-sibling::history.details").InnerText

 

newRow.Item(

"Handler") = historyItem.SelectSingleNode("following-sibling::history.handler").InnerText

 

newRow.Item(

"Action Type") = historyItem.SelectSingleNode("following-sibling::history.action_type").InnerText

 

newRow.Item(

"Corr Type") = historyItem.SelectSingleNode("following-sibling::history.corr_type").InnerText

 

newRow.Item(

"Cost Code") = historyItem.SelectSingleNode("following-sibling::history.cost_code").InnerText

 

newRow.Item(

"No of Units") = historyItem.SelectSingleNode("following-sibling::history.cost_no_units").InnerText

 

newRow.Item(

"Cost Value") = historyItem.SelectSingleNode("following-sibling::history.cost_value").InnerText

 

newRow.Item(

"Completed Date") = historyItem.SelectSingleNode("following-sibling::history.completed_date").InnerText

 

newRow.Item(

"Cost Desc") = historyItem.SelectSingleNode("following-sibling::history.cost-description").InnerText

 

table.Rows.Add(newRow)


 

Dim grid As RadGrid

 

grid = Page.FindControl(

"rgHistory")

 

grid.DataSource = table

grid.DataBind()


------------------------------------------------------------------------------------------

Any help would be great.

Thanks
Pavlina
Telerik team
 answered on 01 Dec 2010
3 answers
175 views
I have a RadGrid which has a GridButtonColumn.  Until recently when clicking on the button image in the grid, the ItemCommand event was firing as expected and I was being redirected to another page as specified in the code behind.  As of yesterday, nothing happens when clicking on the button image in the grid though no code changes have occurred.

The ItemCommand event for the grid does fire when filtering or sorting columns in the grid, just not when clicking on the image button.

Here's the code in the aspx page for the first part of the RadGrid and the GridButtonColumn...
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowFilteringByColumn="true" AllowPaging="True" AutoGenerateColumns="False" Skin="tds" EnableEmbeddedSkins="false" AllowSorting="True" EnableLinqExpressions="false" >
    <MasterTableView HeaderStyle-HorizontalAlign="Center" dataKeyNames="intItemID, intItemTypeID" TableLayout="Fixed">
        <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" Position="TopAndBottom" />
        <Columns>
            <%--Review--%>
            <telerik:GridButtonColumn UniqueName="btnReview" Text="Review" ButtonType="ImageButton" ImageUrl="/TestDevelopment/images/review.png" CommandName="review" HeaderStyle-Width="40px">
            </telerik:GridButtonColumn>

I am able to see the button and the image is the one specified in the 'ImageURL'.

Here is the code in the .vb page for the ItemCommand event, note I've commented out the code that would appear in the 'If' statement with just a comment line for security/privacy reasons:
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        If e.CommandName = "review" Then
                  //redirect page here
                End If
End Sub

In debug mode, I have a breakpoint on the 'If' line in the ItemCommand and when sorting or filtering on the grid the breakpoint is hit.  However, when clicking on the image button in the grid the breakpoint is never hit.

Could someone provide any suggestions as to what may have caused this?
Thanks!
Pavlina
Telerik team
 answered on 01 Dec 2010
1 answer
88 views
Hi,

Is there a way to sort custom FileExplorer columns? Preferably client side?
The sever side fileExplorer.Grid.SortCommand event doesn't fire, either for pre-defined or custom columns.

Is there a way to use a custom sort order for the pre-defined columns 'Name'?
Preferably I would like a "natural" sort order, e.g. file1, file2, file12
FileExplorer sorts this as file1, file12, file2

Best regards,
Andreas
Fiko
Telerik team
 answered on 01 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?