Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
390 views
Hello, I have the following RadGrid issue:

Multiple row selection is turned on.
Client side selection is turned on.
ASP.NET AJAX RadGrid version 2009.01.0402.35.

All of this is OK:
When I select a row and then postback, SelectedIndexChanged fires correctly.
When I select a 2nd row and then postback, SelectedIndexChanged fires correctly.
When I select a 3rd row and then postback, SelectedIndexChanged fires correctly.
When I deselect a row and then postback, there are two rows selected, and SelectedIndexChanged fires correctly.
When I deselect another row and then postback, there is one row selected, and SelectedIndexChanged fires correctly.

This is the problem:  When I deselect the final selected row, so there are now no selected rows, and then post back, SelectedIndexChanged does NOT fire.  It happens every time I deselect the final selected row, regardless of how much selecting/deselecting I do.

Here is my ASPX code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddressTypes.aspx.cs" Inherits="foo.AddressTypes" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<html>
    <head runat="server">
        <title>Test Page</title>
    </head>
    <body>
        <form runat="server">
            <asp:ScriptManager ID="sm" runat="server" />
            <asp:ObjectDataSource ID="gridDS" runat="server" TypeName="foo.AddressTypes" SelectMethod="GetRecords" />
            <telerik:RadGrid ID="grid" runat="server" DataSourceID="gridDS" OnSelectedIndexChanged="Grid_SelectedIndexChanged"
                    AllowMultiRowSelection="true">
                <ClientSettings>
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
            </telerik:RadGrid>
            <asp:Button ID="button" runat="server" Text="Postback" />
        </form>
    </body>
</html>


Here is my code-behind:
using System;
using System.Collections.Generic;
using System.Web.UI;
 
namespace foo
{
    public partial class AddressTypes : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
 
        public static Dictionary<string, string> GetRecords()
        {
            Dictionary<string, string> dict = new Dictionary<string, string>();
            dict.Add("Test 1", "Test record number 1");
            dict.Add("Test 2", "Test record number 2");
            dict.Add("Test 3", "Test record number 3");
            dict.Add("Test 4", "Test record number 4");
            dict.Add("Test 5", "Test record number 5");
            return dict;
        }
 
        protected void Grid_SelectedIndexChanged(object sender, EventArgs e)
        {
            Response.Write("SELECTED INDEXES: " + grid.SelectedIndexes.Count);
        }
    }
}


Everything works fine until that last selected row is deselected.  All of the row deselection is done using CTRL-Click, and adding a selection column to the grid is not an option.  Can you help me determine why SelectedIndexChanged does not fire when the last selected row is deselected?  Thank you.

Rich
Tsvetina
Telerik team
 answered on 06 Jun 2011
1 answer
196 views
I have followed a lot of the things online but my export filename seems to work but not the extension of the excel file.  It always ends up being aspx and it gives me the trusted file error.  I think I am getting this because it does not like the aspx extension.

 <telerik:RadGrid ID="myRadGrid" runat="server" Width="95%" BorderWidth="1px" CellPadding="6" GridLines="Horizontal" BorderColor="#404040" Skin="Web20" ExportSettings-Excel-Format="Html"
                ExportSettings-FileName="DeployReport" ExportSettings-ExportOnlyData="true"
                ExportSettings-Pdf-AllowPrinting="true"><ExportSettings><Pdf FontType="Subset" PaperSize="Letter" PageTitle="No Show Report" /><Excel Format="html" FileExtension="xls" /></ExportSettings>
                <MasterTableView AutoGenerateColumns="false" HierarchyDefaultExpanded="false" HierarchyLoadMode="ServerBind" BorderColor="#404040" Font-Size="10" Font-Names="Veranda,arial,sans-serif"
                HeaderStyle-HorizontalAlign="Center" GridLines="Horizontal" CommandItemSettings-ShowExportToPdfButton="true" CommandItemDisplay="Top" CommandItemSettings-ShowExportToExcelButton="true"
                CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowRefreshButton="false" CommandItemSettings-ShowExportToWordButton="true">
                <AlternatingItemStyle BackColor="#B0C4DE" />
                <HeaderStyle ForeColor="White" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="UIC" DataField="strUIC"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Att UIC" DataField="AttUIC"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Rank" DataField="strRank"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Name" DataField="strFullName"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="SRPType" DataField="strSrpname"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="IN" DataField="TimeIn"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Out" DataField="TimeOut"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Process Time" DataField="ProcessTime"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Deployable" DataField="deployable"></telerik:GridBoundColumn>
                    </Columns>
                 </MasterTableView>
                </telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 06 Jun 2011
2 answers
118 views
Hello Every One,

I'm using GridEditCommandColumn  for modify
how bind radlistbox in the GridEditCommandColumn  modify mode

i'm using assigned value for this EditFormSettings ...
Reply As soon as possible

<EditFormSettings CaptionFormatString="Create" EditFormType="Template">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                    <FormTemplate>
                        <div style="margin-left: 10px;">
                            <table>
                                <tr>
                                    <td style="height: 100px; width: 470px;">
                                        <table style="float: right;">
                                            <tr>
                                                <td>
                                                    <asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*" Width="1px"></asp:Label>
                                                    <asp:Label ID="Label2" Text="Mandatory Field(s)" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                        <fieldset>
                                            <legend style="margin-bottom: 10px">Layout</legend>
                                            <table cellspacing="2" cellpadding="1" width="470px" border="0">
                                                <tr>
                                                    <td colspan="2">
                                                        <asp:TextBox Width="200px" ID="LayoutId" AutoCompleteType="Disabled" runat="server"
                                                            Text='<%# Bind("LayoutId") %>' Visible="false"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">
                                                        Layout Name :
                                                    </td>
                                                    <td>
                                                        <asp:TextBox Width="200px" ID="LayoutName" AutoCompleteType="Disabled" runat="server"
                                                            Text='<%# Bind("LayoutName") %>'></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <fieldset>
                                                            <legend>Layout List</legend>
                                                            <table style="width: 450px;">
                                                                <tr>
                                                                    <td width="50%">
                                                                        <asp:Label ID="Label15" runat="server">         Selected</asp:Label>
                                                                        <telerik:RadListBox runat="server" DataTextField="Text" DataValueField="Value" ID="RadListBoxDestinationGroup"
                                                                            AutoPostBackOnReorder="true" EnableDragAndDrop="true" AllowReorder="true" Height="140px"
                                                                            Width="160px" ButtonSettings-Position="Left">
                                                                        </telerik:RadListBox>
                                                                    </td>
                                                                    <td width="50%">
                                                                        <asp:Label ID="GroupAvailable" runat="server">         Available</asp:Label>
                                                                        <telerik:RadListBox runat="server" DataSourceID="SqlDataSource1" DataValueField="COLUMN_NAME"
                                                                            DataTextField="COLUMN_NAME" ID="RadListBoxSourceGroup" AllowTransfer="true" TransferToID="RadListBoxDestinationGroup"
                                                                            SelectionMode="Multiple" AllowReorder="false" AllowDelete="false" TransferMode="Move"
                                                                            AutoPostBackOnTransfer="true" AutoPostBackOnReorder="true" EnableDragAndDrop="true"
                                                                            Height="140px" Width="160px" ButtonSettings-Position="Left" OnTransferred="RadListBoxSourceGroup_Transferred">
                                                                        </telerik:RadListBox>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </fieldset>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top" align="right">
                                                        Layout UserId :
                                                    </td>
                                                    <td>
                                                        <asp:CheckBox ID="LayoutUserId" runat="server" Checked='<%# 2.Equals(Eval("LayoutUserId")) ? true : false %>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top" align="right">
                                                        Sort Column :
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="ComboBox_SortColumn" runat="server" Width="175px" DataValueField="ID"
                                                            DataTextField="Name">
                                                        </telerik:RadComboBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top" align="right">
                                                        Sort Order :
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="ComboBox_SortOrder" runat="server" Width="175px" SelectedValue='<%# Bind("SortOrder") %>'>
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="Ascending" Value="Asc" Selected="true" />
                                                                <telerik:RadComboBoxItem Text="Descending" Value="Desc" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top" align="right">
                                                        Group Column :
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="ComboBox_GroupByColumn" runat="server" Width="175px" DataValueField="ID"
                                                            DataTextField="Name">
                                                        </telerik:RadComboBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                            </table>
                            <table>
                                <tr>
                                    <td>
                                        <asp:Button ID="Button3" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                            CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                        </asp:Button>
                                        <asp:Button ID="Button4" runat="server" Text="Cancel" CausesValidation="false" CommandName="Cancel">
                                        </asp:Button>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </FormTemplate>
                    <PopUpSettings Modal="True"></PopUpSettings>
                </EditFormSettings>


Thanks,
Mohamed
mohamed
Top achievements
Rank 1
 answered on 06 Jun 2011
6 answers
187 views
Is there a way to disable the Image Properties (right click on image) within the Editor?  In our app, images are resized and formatted on upload so there's no need for users to use it.
Rumen
Telerik team
 answered on 06 Jun 2011
2 answers
74 views

I'm using VS2008 and .Net 3.51 SP1 with Dynamic Data I'm using the latest DD RadGrid I can find here, I have followed;
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/exporting/defaultcs.aspx
and
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/excelmlexport/defaultcs.aspx
if I set

ExportOnlyData="true"

anywhere in code or markup I just get an empty worksheet if left unset I get all the data including links etc. are there any fixex for this?

I've now tested with .Net 4 + SP1 and the Telerik build 2011.1.519.40 same issue sample in .Net 4

I have a sample but am unable to upload it.

Maria Ilieva
Telerik team
 answered on 06 Jun 2011
1 answer
68 views
Hi 

In my application i got two RadComboBox as  ItemTemplate in grid , both has onselectedindexchanged event. But when i select cmbcolItemNo
- it fires cmbcolItemNo_SelectedIndexChanged as expected and but when i select cmbcolItemDescription this also fires cmbcolItemNo_SelectedIndexChanged
not cmbcolItemDescription_SelectedIndexChanged. I'm using radpanel and radloadingpanel.Initially both combobox's are workin fine.now this the problem.

And even radloading image dnt work on crome sometime but works fine on IE.

I want urgent help in this.....

<telerik:RadGrid ID="gvItems" runat="server" AutoGenerateColumns="False"  Width="100%"
                                EnableHeaderContextMenu="True" HorizontalAlign="Left" BorderWidth="0px"
                                CellSpacing="-1" Skin="Default" Height="230" EnableViewState = "true">
                                 <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                                    </ClientSettings>
                                <MasterTableView CellPadding="-1" CellSpacing="-1">
                                    <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                                  <Columns>                                               
                                        <telerik:GridTemplateColumn HeaderStyle-Width="5px"></telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="Item No" UniqueName="colItemNo" HeaderStyle-Width="160px">
                                            <ItemTemplate>
                                                <telerik:RadComboBox ID="cmbcolItemNo" runat="server" AutoPostBack="true" EnableEmbeddedSkins="false"
                                                    onselectedindexchanged="cmbcolItemNo_SelectedIndexChanged1" width="160px"
                                                    EmptyMessage="Select a ItemCode" AllowCustomText="true" Filter="StartsWith" >
                                                </telerik:RadComboBox>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderStyle-Width="18px" UniqueName="ColOpenItemCode">
                                            <ItemTemplate>
                                                  <asp:HyperLink NavigateUrl="javascript:OpenItemCode();" runat="server" ID="hl1OpenItemCode"
                                                                 ImageUrl="../Images/link2.png" >
                                                  </asp:HyperLink>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="Item Description" UniqueName="colItemDescription" HeaderStyle-Width="300px">
                                            <ItemTemplate>
                                                <telerik:RadComboBox ID="cmbcolItemDescription" runat="server" Width="300px" 
                                                     AutoPostBack="true" OnSelectedIndexChanged ="cmbcolItemDescription_SelectedIndexChanged"
                                                     EmptyMessage="Select a Item Description" AllowCustomText="true" Filter="StartsWith">
                                                </telerik:RadComboBox>                                              
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                         <telerik:GridTemplateColumn HeaderStyle-Width="18px" UniqueName="btnColOpenItemDesc">
                                            <ItemTemplate>
                                                  <asp:HyperLink NavigateUrl="javascript:OpenItemCode();" runat="server" ID="hl2OpenItemCode"
                                                                 ImageUrl="../Images/link2.png" >
                                                  </asp:HyperLink>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
</Columns>
 
                                </MasterTableView>
                                <ClientSettings>
 
                                    <ClientEvents OnRowContextMenu="RowContextMenuItems" />
                                    <Scrolling AllowScroll="True" UseStaticHeaders="true" EnableVirtualScrollPaging="true"  />
                                    <Selecting AllowRowSelect="true"   />
                                     
                                </ClientSettings>
                                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" EnableImageSprites="True">
                                </HeaderContextMenu>
                            </telerik:RadGrid>
Tsvetina
Telerik team
 answered on 06 Jun 2011
3 answers
90 views
Hello Experts,

I'm new with Telerik and I have a problem which i'll describe bellow:

[PREFACE]

Imagine this structure:

Default.aspx
  |
  |
  |======> Modules|
                   |
                               |----> Module1|--->UserControl1.ascx
|--->UserControl2.ascx

there is some modules in this structure. i have a master page with a runat=server tagged DIV tag. whenever i want to use the appropriate module, I would just use the LoadControl() method and assign the loaded user control to the spoken DIV. for example if I want to use module "Module1":

contentPlaceHolder.Controls.Add(LoadControl("Modules/Module1/UserControl1.ascx"));

each user control has the appropriate controls and layer to handle requests.
 
[MY PROBLEM]

all the first level loadings will take place via real postback. in the first level loaded user control i have a <Telerik:RadAjaxManager> tag with the specified controls added to it and it works fine (thanx to telerik developers). the problem comes when I try to load another user control in an ajaxified DIV (for example).

When I load the specified control, I want to register new ajax settings for that dynamic loaded user control's controls collection.
BUT I CANT

any idea???

Tsvetina
Telerik team
 answered on 06 Jun 2011
4 answers
71 views
Hi All

I have exactly the same problem as in this POST but unfortunately theat solution will not work for me?
Is there any other way i can set the z index of a filter?

Many Thanks

Regards

Cush
Cush
Top achievements
Rank 1
 answered on 06 Jun 2011
0 answers
58 views
hi ,

we are using RadMenu Control ,we are facing a problem on navigation  when user clicks on menu item with Ctrl+Mouse Click it is opening the page in new window.

please tell me how restrict that opening the page in the new window.

we are attaching the sample application


thanks and Regards
Srikanth.Narala
nsrikanth 2009
Top achievements
Rank 1
 asked on 06 Jun 2011
2 answers
95 views
Hello,
I have a solution contains radgrid in witch there are also template columns.
Calling the ExportToExcel method from a button event of export falls with the error:
"Object refernce" in pre-render of grid event, because of hiding the checkbox column.
And even if i skip the per-render code by flag, the export doesnt work.
Actually the export doesnt work and my grid on screen has no checkbox anymore but "false" in the column.
I have tried hiding the column, but nothing helps.
I have spent many hours reading same problems but none of the solutions helped me.
I also tried putting standard code of exporting, like gridview (with response and htmltextwriter) but it falls with error:

יש למקם את הפקד '

ctl00_contentBody_gridInviteds_ctl00_ctl02_ctl00_ctl00' מסוג 'GridLinkButton' בתוך תג טופס עם runat=server.

 


Actually, when my grid is with no template columns, the export is working but still there is a poblem that the headers have a button in the excel sheet, even though i wrote in code "allowSorting=false"

thanks,
gila
  
gila
Top achievements
Rank 1
 answered on 06 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?