Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
229 views
I'm currently on Version Q1 2009 of the ASP.NET AJAX Controls.

My issue here is that we have a RadWindow with dynamically generated content (so unsure of how much text will appear). However we're not getting a scrollbar in IE 8 even when we turn compatiblity mode on...

However in Firefox etc. the scrollbar appears fine.

The code for the RadWindow is below :

                <telerik:RadWindow runat="server" ID="uiReleaseNotes" Height="545px" Width="800px" 
                    Behaviors="Maximize" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" 
                    VisibleStatusbar="false" VisibleTitlebar="true" NavigateUrl="ShowReleaseNotes.aspx" 
                    Skin="Telerik"> 
                </telerik:RadWindow> 


The Code in the page that loads up :

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
    <title>Release Notes</title> 
 
    <script type="text/javascript"> 
        function GetRadWindow()   //Get reference to window     
        { 
            var oWindow = null; 
            if (window.radWindow) 
                oWindow = window.radWindow; 
            else if (window.frameElement.radWindow) 
                oWindow = window.frameElement.radWindow; 
            return oWindow; 
        }     
         
    </script> 
 
    <style type="text/css"> 
        body, form, html 
        { 
            height: 100%; 
            margin: 0px; 
            padding: 0px; 
        } 
    </style> 
    <link href="../CSS/businessport.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
    <form id="form2" runat="server"> 
        <div style="height:100%; width:100%; filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');"> 
        <asp:ScriptManager ID="ScriptManager" runat="server" /> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Sunset" ControlsToSkip="Scrollbars" /> 
        <div style="border: 1px solid #FFB700; margin-top: 25px; margin-bottom: 25px; width: 85%; 
            padding: 20px; background-color: #35435E;"> 
            <div style="width: 100%; height: 26px; text-align: right;"> 
                <asp:Button ID="cancelItemButton" runat="server" Text="Close" OnClick="cancelItemButton_Click" 
                    Width="75px" /> 
            </div> 
            <div class="Gold Large"> 
                Release Notes - 
                <asp:Label ID="uiVersion" runat="server" Font-Size="Large"></asp:Label> 
            </div> 
            <table class="Small White"> 
                <tr> 
                    <td> 
                        <asp:Label ID="uiReleaseNotes" runat="server"></asp:Label> 
                    </td> 
                </tr> 
            </table> 
        </div> 
        </div> 
    </form> 
</body> 
</html> 

Georgi Tunev
Telerik team
 answered on 23 Feb 2010
1 answer
192 views

My problem is
I use a self referencing grid. Im binding a List which has 2 objects. The 1st object has a property called ID set to 1 and ParentID set to 0. The second object has ParentID set to ID for FIrst Object(1). Now when i try to bind the list as datasource to the grid in Page Load,
I get the 1st record displayed and 2nd record as child to first record. The problem is in addition to that, i recieve a duplicate second record in the same level as 1st record.

Any help is appreciated.

I have attached a output which shows the wrong value. There the 2nd object is duplicated once in child view and in the same hierarchy as 1st node.

Following is the code

ASPX

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Organization.aspx.cs" Inherits="ConcordanceSample.Organization" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head id="Head1" runat="server">  
</head> 
<body> 
    <form id="form1" runat="server">  
        <telerik:RadScriptManager runat="server" ID="ScriptManager1">  
        </telerik:RadScriptManager> 
        <!-- content start --> 
    <div> 
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
         <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
         </AjaxSettings> 
 
        </telerik:RadAjaxManager> 
        <telerik:RadGrid ID="RadGrid1" runat="server" 
        OnColumnCreated="RadGrid1_ColumnCreated" OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound">  
          <MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" AllowSorting="true" 
                DataKeyNames="ParentID,ID" Width="100%">  
               <SelfHierarchySettings ParentKeyName="ParentID" KeyName="ID" /> 
            </MasterTableView> 
            <ClientSettings AllowExpandCollapse="true" /> 
        </telerik:RadGrid> 
 
 
 
    </div> 
      
    </form> 
</body> 
</html> 
 


CODE - BEHIND


using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
using System.Collections.Generic;  
using Telerik.Web.UI;  
 
namespace ConcordanceSample  
{  
    public partial class Organization : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!IsPostBack)  
            {  
                RadGrid1.DataSource = AddMatter();  
                RadGrid1.DataBind();  
            }  
 
        }  
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
 
        }  
 
        protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)  
        {  
            if (e.Column is GridExpandColumn)  
            {  
                e.Column.Visible = false;  
            }  
            else if (e.Column is GridBoundColumn)  
            {  
                e.Column.HeaderStyle.Width = Unit.Pixel(100);  
            }  
        }  
 
        public void Page_PreRenderComplete(object sender, EventArgs e)  
        {  
            HideExpandColumnRecursive(RadGrid1.MasterTableView);  
        }  
        public void HideExpandColumnRecursive(GridTableView tableView)  
        {  
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);  
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)  
            {  
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)  
                {  
                    nestedView.Style["border"] = "0";  
 
                    Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton");  
                    if (nestedView.Items.Count == 0)  
                    {  
                        if (MyExpandCollapseButton != null)  
                        {  
                            MyExpandCollapseButton.Style["visibility"] = "hidden";  
                        }  
                        nestedViewItem.Visible = false;  
                    }  
                    else 
                    {  
                        if (MyExpandCollapseButton != null)  
                        {  
                            MyExpandCollapseButton.Style.Remove("visibility");  
                        }  
                    }  
 
                    if (nestedView.HasDetailTables)  
                    {  
                        HideExpandColumnRecursive(nestedView);  
                    }  
                }  
            }  
        }  
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            CreateExpandCollapseButton(e.Item, "ID");  
 
            if (e.Item is GridHeaderItem && e.Item.OwnerTableView != RadGrid1.MasterTableView)  
            {  
                e.Item.Style["display"] = "none";  
            }  
 
            if (e.Item is GridNestedViewItem)  
            {  
                e.Item.Cells[0].Visible = false;  
            }  
        }  
 
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            CreateExpandCollapseButton(e.Item, "ID");  
        }  
 
        protected void RadGrid1_PreRender(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
            }  
        }  
        public void CreateExpandCollapseButton(GridItem item, string columnUniqueName)  
        {  
            if (item is GridDataItem)  
            {  
                if (item.FindControl("MyExpandCollapseButton") == null)  
                {  
                    Button button = new Button();  
                    button.Click += new EventHandler(button_Click);  
                    button.CommandName = "ExpandCollapse";  
                    button.CssClass = (item.Expanded) ? "rgCollapse" : "rgExpand";  
                    button.ID = "MyExpandCollapseButton";  
 
                    if (item.OwnerTableView.HierarchyLoadMode == GridChildLoadMode.Client)  
                    {  
                        string script = String.Format(@"$find(""{0}"")._toggleExpand(this, event); return false;", item.Parent.Parent.ClientID);  
 
                        button.OnClientClick = script;  
                    }  
 
                    int level = item.ItemIndexHierarchical.Split(':').Length;  
                    if (level > 1)  
                    {  
                        button.Style["margin-left"] = level + 10 + "px";  
                    }  
 
                    TableCell cell = ((GridDataItem)item)[columnUniqueName];  
                    cell.Controls.Add(button);  
                    cell.Controls.Add(new LiteralControl("&nbsp;"));  
                    cell.Controls.Add(new LiteralControl(((GridDataItem)item).GetDataKeyValue(columnUniqueName).ToString()));  
                }  
            }  
        }  
 
        void button_Click(object sender, EventArgs e)  
        {  
            ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand";  
        }  
 
        public List<MatterObject> AddMatter()  
        {  
            List<MatterObject> olistMatter = new List<MatterObject>();  
            MatterObject objMatter = new MatterObject();  
            objMatter.ID = 1;  
            objMatter.Name = "Parket & Parker";  
            objMatter.CreatedBy = "Krishnan";  
            objMatter.CreationDate = "2/17/2010";  
            objMatter.LastModifiedDate = "2/17/2010";  
            objMatter.LastModifiedBy = "Krishnan";  
            objMatter.ParentID = 0;  
            olistMatter.Add(objMatter);  
            MatterObject objMatter1 = new MatterObject();  
            objMatter1.ID = 2;  
            objMatter1.Name = "Lancer & Lancer";  
            objMatter1.CreatedBy = "L.N.K";  
            objMatter1.CreationDate = "2/17/2010";  
            objMatter1.LastModifiedDate = "2/17/2010";  
            objMatter1.LastModifiedBy = "Krishnan";  
            objMatter1.ParentID = 1;  
            olistMatter.Add(objMatter1);  
            return olistMatter;  
        }  
        public List<MatterObject> AddChild()  
        {  
            List<MatterObject> olistMatter = new List<MatterObject>();  
            MatterObject objMatter = new MatterObject();  
            objMatter.ID = 2;  
            objMatter.Name = "Organization Folder 1";  
            objMatter.CreatedBy = "LN";  
            objMatter.CreationDate = "2/16/2010";  
            objMatter.LastModifiedDate = "2/16/2010";  
            objMatter.LastModifiedBy = "LN";  
            olistMatter.Add(objMatter);  
            objMatter = new MatterObject();  
            objMatter.ID = 3;  
            objMatter.Name = "Organization Folder 2";  
            objMatter.CreatedBy = "Krishnan";  
            objMatter.CreationDate = "2/15/2010";  
            objMatter.LastModifiedDate = "2/15/2010";  
            objMatter.LastModifiedBy = "Krishnan";  
            olistMatter.Add(objMatter);  
            return olistMatter;  
        }  
    }  
    public class MatterObject  
    {  
        public int ID { get; set; }  
        public string Name { get; set; }  
        public string CreatedBy { get; set; }  
        public string CreationDate { get; set; }  
        public string LastModifiedDate { get; set; }  
        public string LastModifiedBy { get; set; }  
        public int ParentID { get; set; }  
        //public MatterChild Child { get; set; }          
    }  
}  
 
 
Martin
Telerik team
 answered on 23 Feb 2010
1 answer
154 views
Hi,
    I have some problem with DataKey values. I used to bind certain template controls of the grid based on the datakey values of the grid. I only need to bind when the grid is in edit mode. So i used ItemDataBound event and check the IsEditMode mtthod to bind the details  based on the DataKeyvalues. Every thing is working fine it is getting the records based on primarykey Datakey value.

But the problem occures when i try to add new record. When i click the Insert button it goes to ItemDatabound event and check the IsEditMode but throws error when comes to this line of code,

EID = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][

"EID"].ToString();

But i need the above code for binding data when in EditMode, but causes an null error when click Insert Button.

So help me to solve this issue,

-Thanks

 

Shinu
Top achievements
Rank 2
 answered on 23 Feb 2010
4 answers
358 views
I have a RadGrid that is bound to an EntityDataSource.  The RadGrid uses an edit form template and two of the controls are bound to Foreign Key tables(objects) of the parent entity object.  I have insert and update working.  But I get "Object reference not set to an instance of an object" when i perform a delete.  Does anyone know why this happens?

Below is a very rough markup of how my code is structured:

<telerik:radgrid id="myGrid" runat="server" DatasourceID="dsCustomers" AllowAutomaticInserts="true"
AllowAutomaticUpdates
="true" AllowAutomaticDeletes="true">
  <MasterTableView CommandItemDisplay="top" DataSourceId="dsCustomers" DataKeyNames="CustomerId" EditMode="EditForms">
    <Columns>
      <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Edit" />
      <telerik:GridBoundColumn HeaderText="Title" DataField="Title.Description" />
      <telerik:GridBoundColumn HeaderText="Name" DataField="Name" />
      <telerik:GridButtonColumn ConfirmText="Delete this Customer?" ConfirmDialogType="Classic" ConfirmTitle="Delete"
        ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" />
    </Columns>
    <EditFormSettings EditFormType="Template">
      <FormTemplate>
        <table>
          <tr>
            <td>
              <telerik:RadComboBox id="cmbTitle" runat="server" DataSourceID="dsTitles" AppendDataBoundItems="true"
                DataTextField="Description" DataValueField="Id" SelectedValue='<%# Bind("Title.Id") %>' >
                <Items><telerik:RadComboBoxItem Value="0" Text="" Selected="true" /></Items>
              </telerik:RadcomboBox>
            </td>
            <td>
              <telerik:RadTextBox id="txtName" runat="server" Text='<% Bind("Name") %>;' />
            </td>
          </tr>
        </table>
      </FormTemplate>
    </EditFormSettings>
  </MasterTableView>
</telerik:radgrid>
<asp:EntityDataSource ID="dsCustomers" runat="server" ConnectionString="name=CustomerEntities"
DefaultContainerName="CustomerEntities" EnableUpdate="true" EnableInsert="true" EnableDelete="true"
EntitySetName="Customer" Include="Title" />
<asp:EntityDataSource ID="dsTitles" runat="server" ConnectionString="name=CustomerEntities"
DefaultContainerName="CustomerEntities" EntitySetName="Title" />

Tsvetoslav
Telerik team
 answered on 23 Feb 2010
2 answers
273 views

Hi,

In Rad grid Control, there are 2 TemplateColums (Start time and end time) and it has two RadTimePicker control for      EditItemTemplate .im using the master page as well.
I want to validate that end time value is greater than the start time .
 How to use Compare Validator?

Can you plz tell me the way of doing this.because this is ugent.

<telerik:GridTemplateColumn HeaderText="Starttime" UniqueName="Starttime" >    
            <EditItemTemplate>    
                <telerik:RadTimePicker ID="rtpStartTime" runat="server">     
                </telerik:RadTimePicker>    
             </EditItemTemplate>    
            <ItemTemplate>    
                <asp:Label ID="lblStarttime" runat="server" Text='<%# Eval("StartTime","{0:t}") %>'></asp:Label>    
            </ItemTemplate>    
        </telerik:GridTemplateColumn>    
             
         <telerik:GridTemplateColumn HeaderText="End time" UniqueName="EndTime">     
            <EditItemTemplate>    
                <telerik:RadTimePicker ID="rtpEndTime" runat="server"       
                </telerik:RadTimePicker>                     
            </EditItemTemplate>    
            <ItemTemplate>    
                <asp:Label ID="lblEndTime" runat="server" Text='<%# Eval("EndTime", "{0:t}") %>'></asp:Label>    
            </ItemTemplate>    
 

Thanks
Waruni

waruni
Top achievements
Rank 1
 answered on 23 Feb 2010
3 answers
288 views
Hi,

Im not sure whether this should go under the Radgrid section or the RadWindow section, but here goes.

I have a RadGrid on a RadWindow and would like to know if its possible to use the popup edit form, to edit items in the RadGrid.
I have tried this and instead of the popup appearing, the RadWindow disappears and the screen goes grey as it would if the editform had appeared, but it doesn't appear.

Any help would be much appreciated,

Cheers
Tsvetoslav
Telerik team
 answered on 23 Feb 2010
2 answers
235 views
Hi, is it possible to close a RadWindow by just clicking outside of it on the screen/parent window?

I have tried searching for such functionality, but haven't been able to find it.

Tried to do it by creating an onclick-function on the body of the parent page, that searches for any active RadWindow and closes it if found. This kind of works - BUT it closes the window just as it's getting opened too, so for a user the screen just flickers as the window opens and closes again immediately.

Would be grateful for any help here.

Hans Gunnar
Top achievements
Rank 1
 answered on 23 Feb 2010
7 answers
253 views
hi all,

i have a GridDateTimeColumn in a grid, i added compare validators for it in the code like the example here http://www.telerik.com/help/aspnet-ajax/grdvalidation.html, one to check the type, and another to compare it with Date.Now

the problem is that the validator that checks the type works only on insert but not on update! i can't find any logical reason for that..here is my code

<telerik:GridDateTimeColumn HeaderText="Start Date" SortExpression="startDate" UniqueName="startDate" AutoPostBackOnFilter="true" DataField="startDate" 
    FilterControlWidth="110px" PickerType="DatePicker" DataFormatString="{0:d/M/yyyy}" DataType="System.DateTime">  
</telerik:GridDateTimeColumn>   

    Private Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated  
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then 
            Dim item As GridEditableItem = CType(e.Item, GridEditableItem)  
 
            Dim startColumnEditor As GridDateTimeColumnEditor = TryCast(DirectCast(e.Item, GridEditableItem).EditManager.GetColumnEditor("startDate"), GridDateTimeColumnEditor)  
            Dim startCell As TableCell = DirectCast(startColumnEditor.PickerControl.Parent, TableCell)  
 
            Dim compareValidator1 As New CompareValidator()  
            compareValidator1.ID = "compareValidator1" 
            compareValidator1.ControlToValidate = startColumnEditor.PickerControl.ID  
            compareValidator1.[Operator] = ValidationCompareOperator.DataTypeCheck  
            compareValidator1.Type = ValidationDataType.[Date]  
            compareValidator1.ErrorMessage = "Invalid date. " 
            compareValidator1.Display = ValidatorDisplay.Dynamic  
            startCell.Controls.Add(compareValidator1)  
 
            Dim compareValidator3 As New CompareValidator()  
            compareValidator3.ID = "compareValidator3" 
            compareValidator3.ControlToValidate = startColumnEditor.PickerControl.ID  
            compareValidator3.[Operator] = ValidationCompareOperator.GreaterThanEqual  
            compareValidator3.Type = ValidationDataType.[Date]  
            compareValidator3.ErrorMessage = "Date can't be earlier than today" 
            compareValidator3.ValueToCompare = DateTime.Now.ToShortDateString()  
            compareValidator3.Display = ValidatorDisplay.Dynamic  
            startCell.Controls.Add(compareValidator3)  
        End If 
    End Sub 
 
    Private Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand  
        If e.CommandName = "Update" Then 
            If Page.IsValid Then
                e.Item.Edit = False 
            End If 
        ElseIf e.CommandName = "PerformInsert" Then 
            If Page.IsValid Then 
                e.Canceled = True 
                e.Item.OwnerTableView.IsItemInserted = False 
                e.Item.OwnerTableView.Rebind()  
            End If 
        ElseIf e.CommandName = "Delete" Then 
 
        End If 
    End Sub 

"compareValidator1" is the one that is not working on update, when i enter string characters in the date field and click on update button it performs updating process, it considers the page as valid

Any ideas?? wht am i doing wrong??

thnx in advance
Tsvetoslav
Telerik team
 answered on 23 Feb 2010
1 answer
143 views
hi,
  I am  using file explorer and using radUpload for uploading the files...what I want when the new form is open for uploading the file, and when the user click the ok button the progress should be shown how much file is uploaded...I using the rad AjaxUploadingPanel but i didnt fullfill my requirement...I use radProgressbar i also didnt fullfill my requirement...how can it done??when the user upload the file the progress bar is shown and it depends upon the size of file as well like if the file takes 30 minutes for upload the progress bar should be shown according to that..........

regards
samee javaid 
T. Tsonev
Telerik team
 answered on 23 Feb 2010
7 answers
196 views
I am working with a Grid. I use the client side row selection but, when I try to get the selected item (server side) the "SelectedIndexes.count" is always 0 (zero) although I have a row selected. What can I do???

DGRID CODE
<telerik:RadGrid ID="CnsGrid"  runat="server" Style="position: static" AllowFilteringByColumn="True"  
        AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="15" ShowGroupPanel="True" Skin="Simple" AllowCustomPaging="True"> 
            <GroupPanel Text="Arrastre un t&#237;tulo de columna aqu&#237; para agrupar por dicha columna"> 
            </GroupPanel> 
            <PagerStyle FirstPageToolTip="Primera p&#225;gina" LastPageToolTip="&#217;ltima P&#225;gina" 
                NextPagesToolTip="Pr&#243;ximas P&#225;ginas" NextPageToolTip="Pr&#243;xima P&#225;gina" 
                PrevPagesToolTip="P&#225;gina Anterior" PrevPageToolTip="P&#225;gina Anterior" PagerTextFormat="Cambiar p&#225;gina: {4} &amp;nbsp;P&#225;gina &lt;strong&gt;{0}&lt;/strong&gt; de &lt;strong&gt;{1}&lt;/strong&gt;, items &lt;strong&gt;{2}&lt;/strong&gt; a &lt;strong&gt;{3}&lt;/strong&gt; de &lt;strong&gt;{5}&lt;/strong&gt;." /> 
            <GroupingSettings CollapseTooltip="Contraer grupo" ExpandTooltip="Expandir grupo" 
                GroupContinuedFormatString="... grupo viene de la p&#225;gina anterior" GroupContinuesFormatString="Grupo continua en la siguiente p&#225;gina..." 
                ShowUnGroupButton="True" UnGroupButtonTooltip="Click aqui para desagrupar" UnGroupTooltip="Arrastre fuera para eliminar el grupo por dicha columna" /> 
             
            <SortingSettings SortedAscToolTip="Orden Asc" SortedDescToolTip="Orden Desc" SortToolTip="Clic aqu&#237; para ordenar" /> 
            <StatusBarSettings LoadingText="Cargando..." ReadyText="Listo" /> 
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" /> 
            <FilterItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
            <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
             
            <ClientSettings EnableRowHoverStyle="True"> 
                <Selecting AllowRowSelect="True" /> 
            </ClientSettings> 
            <SelectedItemStyle BackColor="#FFC080" /> 
             
        </telerik:RadGrid> 


VB CODE
        Dim ArrRes() As String = Nothing 
        Dim index As Integer 
        Session("Cns_sn_cancel") = False 
 
        Try 
            For index = 2 To CnsGrid.Items(Me.CnsGrid.SelectedIndexes(0)).Cells.Count - 1 
                         'HERE I ALWAYS GET AN ERROR  
                         'BECAUSE THERE'S NO ROW SELECTED 
                ReDim Preserve ArrRes(index) 
                ArrRes(index - 2) = CnsGrid.Items(Me.CnsGrid.SelectedIndexes(0)).Cells(index).Text 
            Next 
 
            Session("ResConsulta") = ArrRes 
        Catch ex As Exception 
            Session("CNS_sn_error") = True 
            Session("Cns_error") = ex.Message.ToString 
        Finally 
 
            Dim strScript As String 
            strScript = "<script language=javascript> " 
            strScript += "window.close();" 
            strScript += "</script>" 
            ClientScript.RegisterStartupScript(Me.Page.GetType(), "CierraConsulta", strScript) 
        End Try 

Daniel
Telerik team
 answered on 23 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?