Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
279 views
I have the following grid:

<telerik:RadGrid ID="grdList" runat="server" AutoGenerateColumns="False" Width="450px" 
                        Height="260px" GridLines="None" AllowMultiRowSelection="True" AllowPaging="True" 
                        PageSize="10" CssClass="CriteriaGrid"
                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                            Font-Underline="False" Wrap="True" /> 
                        <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="{4} &amp;nbsp;Page {0} of {1}" /> 
                        <MasterTableView DataKeyNames="Value" Name="Master" ShowHeader="False" GridLines="None" HierarchyLoadMode="Client"
                            <RowIndicatorColumn> 
                                <HeaderStyle Width="20px"></HeaderStyle> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn Visible="True"
                                <HeaderStyle Width="20px"></HeaderStyle> 
                            </ExpandCollapseColumn> 
                            <Columns> 
                                <telerik:GridClientSelectColumn HeaderText="Include" UniqueName="Include"
                                    <HeaderStyle Width="20px" /> 
                                </telerik:GridClientSelectColumn> 
                                <telerik:GridBoundColumn DataField="Text" HeaderText="Text" UniqueName="Text"
                                    <HeaderStyle Width="100%" /> 
                                    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                                        Font-Underline="False" Wrap="False" /> 
                                </telerik:GridBoundColumn> 
                            </Columns> 
                            <ItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False"></ItemStyle> 
                            <GroupHeaderItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False"></GroupHeaderItemStyle> 
                            <AlternatingItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False"></AlternatingItemStyle> 
                            <EditItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False"></EditItemStyle> 
                            <DetailTables> 
                                <telerik:GridTableView runat="server" Name="Detail" DataKeyNames="Value" ShowHeader="False"
                                    <Columns> 
                                        <telerik:GridClientSelectColumn HeaderText="Include" UniqueName="Include"
                                            <HeaderStyle Width="20px" /> 
                                        </telerik:GridClientSelectColumn> 
                                        <telerik:GridBoundColumn DataField="Text" HeaderText="Text" UniqueName="Text"
                                            <HeaderStyle Width="100%" /> 
                                            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                                                Font-Underline="False" Wrap="False" /> 
                                        </telerik:GridBoundColumn> 
                                    </Columns> 
                                    <RowIndicatorColumn> 
                                        <HeaderStyle Width="20px" /> 
                                    </RowIndicatorColumn> 
                                    <ExpandCollapseColumn> 
                                        <HeaderStyle Width="20px" /> 
                                    </ExpandCollapseColumn> 
                                </telerik:GridTableView> 
                            </DetailTables> 
                        </MasterTableView> 
                        <ClientSettings> 
                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False"></Selecting> 
                            <ClientEvents OnRowSelected="SelectChildren" OnRowDeselected="SelectChildren" OnRowSelecting="CancelNonInputSelect" OnRowDeselecting="CancelNonInputSelect"
                            </ClientEvents> 
                            <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling> 
                        </ClientSettings> 
                        <FilterMenu EnableTheming="True"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </FilterMenu> 
                    </telerik:RadGrid> 

With the follwing JS events:
function CancelNonInputSelect(sender, args)    
            {    
                var e = args.get_domEvent();   
                //IE - srcElement, Others - target   
                var targetElement = e.srcElement || e.target;   
                 
                if (targetElement != null) { 
                    //is the clicked element an input checkbox? <input type="checkbox"...>   
                    if(targetElement.tagName.toLowerCase() != "input" && (!targetElement.type || targetElement.type.toLowerCase() != "checkbox"))  
                    {                       
                        //cancel the event   
                        args.set_cancel(true);   
                        return
                    }   
                } 
            }    
             
            function SelectChildren(sender, args) { 
                if(args.get_tableView().get_name()=='Master') { 
                    var di = args.get_tableView().get_dataItems()[args.get_itemIndexHierarchical()]; 
                    di.set_expanded(true); 
                     
                    var grid = $find("<%= grdList.ClientID %>"); 
                    var table = grid.get_detailTables()[args.get_itemIndexHierarchical()]; 
                                                            
                    for (i = 0; i < table.get_dataItems().length; i++) 
                    { 
                        if (di.get_selected() == true
                            table.selectItem(table.get_dataItems()[i].get_element()); 
                        else 
                            table.deselectItem(table.get_dataItems()[i].get_element()); 
                    } 
                } 
            } 

I have paging enabled, and since the grid doesn't maintain what was selected on a previous page (I think this would be an AWESOME feature to include in a future build), I have to capture all the selected items from each page so that I can reselect them again when the grid renders back to one of the pages.

I have the hierarchy load mode set to client and have subscribed to both the NeedDataSource and DetailTableDataBind events so that the grid is fully loaded when it comes to the screen.

The problem is when I'm trying to look at what is selected inside of my detail tables. I'm able to loop through the MasterTableView grid items see what is selected and what isn't and add them or remove them from my SelectedItems array. However, when I get down and start looping through the detail tables, they don't have any grid items, so I can't add them to my SelectedDetailItems array.
Private Sub grdList_PageIndexChanged(ByVal source As ObjectByVal e As Telerik.Web.UI.GridPageChangedEventArgs) Handles grdList.PageIndexChanged 
        For Each item As Telerik.Web.UI.GridItem In grdList.MasterTableView.Items 
            If item.Selected Then 
                If Not SelectedItems.Contains(grdList.MasterTableView.DataKeyValues(item.ItemIndex).Item("Value")) Then 
                    SelectedItems.Add(grdList.MasterTableView.DataKeyValues(item.ItemIndex).Item("Value")) 
                End If 
            Else 
                SelectedItems.Remove(grdList.MasterTableView.DataKeyValues(item.ItemIndex).Item("Value")) 
            End If 
        Next 
 
        For Each det As Telerik.Web.UI.GridTableView In grdList.MasterTableView.DetailTables 
            For Each item As Telerik.Web.UI.GridItem In det.Items 
                If item.Selected Then 
                    If Not SelectedDetailItems.Contains(det.DataKeyValues(item.ItemIndex).Item("Value")) Then 
                        SelectedDetailItems.Add(det.DataKeyValues(item.ItemIndex).Item("Value")) 
                    End If 
                Else 
                    SelectedDetailItems.Remove(det.DataKeyValues(item.ItemIndex).Item("Value")) 
                End If 
            Next 
        Next 
    End Sub 

I would love to be able to use the SelectedItems array on the RadGrid (which does have the selected items from the detail tables), but can't because it will only tell me what has been selected, but I need to know what isn't selected so I can remove them from my storage array. As you can see, if there was a way for the grid to maintain selections when the page index/sort changes and restore them when it renders those grid items, that would be GREAT and save me tons of time and additional code writing to handle something that really should be included.

Thanks,
Adam
Adam
Top achievements
Rank 1
 answered on 22 Aug 2008
1 answer
112 views
Hi,

I have takena GridTemplateColumn,  in that I take a LinkButton to download a file related to each reecord. The problem is, when I clicked on the linkbutton to download a file, the open/save dialog box opened, then after I clicked on Open, Save or Cancel button of the dialog box the certain action will takes place. After that when I Clicked on pager link to go next page the same open/save dialog box opened untill I refresh the page.

pls let me know the solution

Thanks
ANand
Nikita Gourme
Top achievements
Rank 1
 answered on 22 Aug 2008
2 answers
76 views

 Dear Telerik team,
                             I was using "RadControls for ASP.NET Q3 2007" trial version with my web application.But now I have purchased a new version "RadControls for ASPNET AJAX Q2 2008".
Since new version has some assembly changes along with some new features, I have to change my web application accordingly for rad controls used in my web application.
So can you please help me to upgrade my web application. Also please tell me what kind of changes I have to make while using RadControls and while upgrading my web application from "RadControls for ASP.NET Q3 2007" to "RadControls for ASPNET AJAX Q2 2008"

Thanking you.

Daniel
Telerik team
 answered on 22 Aug 2008
1 answer
74 views
I am using the AJAX RadScheduler  (Telerik.Web.UI v 2008.1.619.20) and the standard appointment creation form.

If you enter unexpected information in the form - for example putting a word in the "every [x] days" recurrence textbox rather than a number you, quite rightly, get an "Input string was not in a correct format" .NET exception.

This exception appears to happen before any events are fired - is there any way I can catch this exception - or have later versions of the scheduler got improved validation on the form?

Thanks
Mark
T. Tsonev
Telerik team
 answered on 22 Aug 2008
2 answers
67 views
We are using the masked input text box in several places on our site.

When the input box is empty it is not possible to copy in any text.  However if there is at least 1 character then the copy works.

We have the latest version of code and this issue (been raised in a couple of other posts) has still not be addressed.

Can you update when this error will be fixed?

Regards

Rob
Missing User
 answered on 22 Aug 2008
3 answers
143 views
Hello,

I have a RadGrid that is bound to a LinqDataSource. When I group and set the GroupDefaultExpanded to false, and when I do any type of postback it automatically folds everything back.

I would like it to preserve the status of the grouping when I do a postback. How can I do this?

Kind Regards,

Jurjen Ladenius
Nikita Gourme
Top achievements
Rank 1
 answered on 22 Aug 2008
1 answer
279 views

Hi All,

I am using RadControl ASP.NET AJAX Q1 2008

In my page i am using ScriptManager,RadAjaxManager,RadAjaxLoadingPanel,buttton
I apply loading panel on button click .
When i click on button it gives me following error.
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

Thanking you
Princy
Top achievements
Rank 2
 answered on 22 Aug 2008
4 answers
138 views
Hi,
 
I have GridDropDownColumn in RadGrid.In edit mode, i can select items from the GridDropDownColumn but when i click insert button, no items are shown in GridDropDownColumn in RadGrid.Can you help me?

Note : I am not using DataSource, i am using datatable in code to fill grid and dropdown.





In Edit Mode
Inserted Mode

Princy
Top achievements
Rank 2
 answered on 22 Aug 2008
1 answer
192 views
Hi,

I have a problem with html image map code being altered when toggling between source and design view. It seems like it is only image maps that contain polygon coordinates that are affected. What happens is that the poly attribute is changed to rect and the coords to 0,0,0,0.
Does this have something to do with the fact that the Image map editor is only supporting rectangular and circular areas? I'm currently not using the latest version of RadEditor, perhaps this has already been corrected?

Regards
Daniel
Rumen
Telerik team
 answered on 22 Aug 2008
2 answers
124 views
Hi

I want to use the RadPanelbar as a simple menu on a website. Each item on the panel represents a page on the site like this:

Homepage      >
    Page One
    Page Two
    Page Three
    Page Four     >
        Sub 1
    Page Five

What I want to happen is when you click the text 'homepage' it links to the url. And when you click the arrow for homepage it toggles the visibility of the sub items but not link through.

By default it seems to always link through and toggle no matter where you click on the item.

Thanks
Tristan
AbsolutelyN
Top achievements
Rank 1
 answered on 22 Aug 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?