Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
327 views

I am receiving an exception whenever i peform any postback on a page with a grid.
I am adding the grid's column in code and also putting the whole grid into edit mode. The datasource is a datatable. I've been using the examples from the tutorials to get started. I also have 2 linkbuttons in the CommandItemTemplate. Whenever i click on either button, i never back it to the ItemCommand, instead i receive an exception:
DotNetNuke.Services.Exceptions.PageLoadException: Specified argument was out of the range of valid values. Parameter name: index ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: indexat System.Web.UI.ControlCollection.get_Item(Int32 index)at Telerik.Web.UI.GridTextBoxColumnEditor.LoadControlsFromContainer() ...
I can provide the rest of the stack trace if you need.

here is the ascx code:

<telerik:RadGrid ID="grdProspects" runat="server" AutoGenerateColumns="false" AllowMultiRowEdit="true">  
    <ClientSettings EnableRowHoverStyle="true">  
        <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="400" /> 
    </ClientSettings> 
    <MasterTableView EditMode="InPlace" CommandItemDisplay="TopAndBottom">  
        <CommandItemStyle Height="25px" HorizontalAlign="Right" /> 
        <CommandItemTemplate> 
            <asp:LinkButton ID="lnkAddProspect" runat="server" CommandName="ADD_PROSPECT"><asp:Image ID="imgAddProspect" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/ADD.gif" ToolTip="Add New Prospect" />&nbsp;Add New Prospect</asp:LinkButton> 
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
            <asp:LinkButton ID="lnkSaveProspects" runat="server" CommandName="SAVE_PROSPECTS"><asp:Image ID="Image1" runat="server" ImageUrl="~/DesktopModules/BAOffice/images/save.gif" ToolTip="Save Changes" />&nbsp;Save Changes</asp:LinkButton> 
            &nbsp;&nbsp;  
        </CommandItemTemplate> 
    </MasterTableView> 
</telerik:RadGrid> 


here is the vb code:
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
            If Not IsPostBack Then 
 
              For Each column As SourceColumn In MyProspectEditor.SourceColumns  
 
                Dim boundColumn As New GridBoundColumn()  
                boundColumn.DataField = column.Name  
                boundColumn.HeaderText = column.Name  
                boundColumn.ReadOnly = column.IsReadOnly  
                grdProspects.MasterTableView.Columns.Add(boundColumn)  
 
               Next                 
 
            End If 
        End Sub
#Region " Prospects "  
 
        Private Sub grdProspects_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grdProspects.ItemCommand  
 
            Select Case e.CommandName.ToUpper  
 
                Case "SAVE_PROSPECTS" 
                      
 
                Case "ADD_PROSPECT" 
                      
            End Select 
        End Sub 
 
         
 
        Private Sub grdProspects_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles grdProspects.NeedDataSource  
            If MyProspectEditor IsNot Nothing Then 
                grdProspects.DataSource = MyProspectEditor.GetWorkingData()  
            End If 
        End Sub 
 
        Private Sub grdProspects_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdProspects.PreRender  
            If Not IsPostBack Then 
                For Each item As GridItem In grdProspects.MasterTableView.Items  
                    If TypeOf item Is GridEditableItem Then 
                        Dim editableItem As GridEditableItem = CType(item, GridDataItem)  
                        editableItem.Edit = True 
                    End If 
                Next 
                grdProspects.Rebind()  
            End If 
 
        End Sub 


Any ideas?
thanks!
Dave
Top achievements
Rank 1
 answered on 04 Nov 2009
2 answers
151 views
Why does the tooltip reload it's content when I only move the mouse on the object and not outside?
Andreas Selling
Top achievements
Rank 2
 answered on 04 Nov 2009
8 answers
294 views
Has anyone else run into this problem, and does anyone know a workaround?

The problem seems to ONLY occur in IE8, but if you have a vertical scrolling RadListBox and try to scroll down in the list, and select something, the box will "jump" back to the top of the list, making it almost impossible to select items further down in the list.

Again, this only happens in IE8 native mode.  IE6 and 7, firefox, safari, opera, chrome, and even IE8 compatibility mode seem to work fine. 

It's not a huge deal, but certaintly stuff of unecessary user enquiries when implemented.

Thanks,

Kuba
Zach
Top achievements
Rank 1
 answered on 04 Nov 2009
1 answer
241 views

Using this example, I was able to create a working CRUD interface using a SQL view; however, when I added calculated columns to the view, I received the following error.

Sys.WebForms.PageRequestManagerServerErrorException: Update or insert of view or function 'dbo.vwEnum' failed because it contains a derived or constant field.

Here's the table class definition.  CreateUser and UpdateUser are the calculated columns, and it works if they are removed.  Does anyone know how to prevent the calculated columns from being updated?

  <Table Name="dbo.vwEnum" Member="vwEnums">  
    <Type Name="vwEnum">  
      <Column Name="EnumId" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 
      <Column Name="Created" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" /> 
      <Column Name="CreateUserId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> 
      <Column Name="Updated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" /> 
      <Column Name="UpdateUserId" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> 
      <Column Name="Name" Type="System.String" DbType="VarChar(50) NOT NULL" CanBeNull="false" /> 
      <Column Name="Code" Type="System.String" DbType="VarChar(20) NOT NULL" CanBeNull="false" /> 
      <Column Name="Description" Type="System.String" DbType="VarChar(1000) NOT NULL" CanBeNull="false" /> 
      <Column Name="Attributes" Type="System.Xml.Linq.XElement" DbType="Xml" CanBeNull="true" UpdateCheck="Never" /> 
      <Column Name="CreateUser" Type="System.String" DbType="VarChar(153)" IsReadOnly="true" CanBeNull="true" /> 
      <Column Name="UpdateUser" Type="System.String" DbType="VarChar(153)" IsReadOnly="true" CanBeNull="true" /> 
      <Association Name="vwEnum_vwEnumValue" Member="vwEnumValues" ThisKey="EnumId" OtherKey="EnumId" Type="vwEnumValue" /> 
    </Type> 
  </Table> 

Wyatt
Top achievements
Rank 1
 answered on 04 Nov 2009
3 answers
196 views
My drag and drop works perfectly in Chrome, however I just discovered that in IE, the grid 'loses' the associated styles and javascript after a postback.  When the page first loads, everything looks and works.  But after dragging, the page does a full postback (even though I am using a RadAjaxPanel) and when it loads again I see my grid populated with all the right data but it does not display correctly and the drag and drop no longer works.

The attached images show what it looks like before and after a drag.
Here are my grids:
                <telerik:RadGrid runat="server" ID="grdAvailableItems" AllowMultiRowSelection="True"
                    Visible="true" ShowHeader="false" Height="145" Width="620" OnNeedDataSource="grdAvailableItems_NeedDataSource"
                    OnRowDrop="grdAvailableItems_RowDrop" AutoGenerateColumns="False" GridLines="None"
                    Skin="Default" BorderColor="#8CB71F" BorderWidth="1px">
                    <MasterTableView DataKeyNames="ItemTypeID">
                        <NoRecordsTemplate>
                            <div style="padding: 3px 0px 0px 5px">
                                Click on an item above to load selections</div>
                        </NoRecordsTemplate>
                        <Columns>
                            <telerik:GridBoundColumn DataField="ItemTypeName" HeaderText="ItemTypeName" UniqueName="ItemTypeName">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowRowsDragDrop="True">
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
                        <ClientEvents OnRowDropping="onRowDropping" />
                        <Scrolling AllowScroll="True" />
                    </ClientSettings>
                </telerik:RadGrid>

and 

 <telerik:RadGrid runat="server" ID="grdSelectedItems" AllowMultiRowSelection="true"
                    OnDeleteCommand="grdSelectedItems_DeleteCommand" Visible="true" ShowHeader="false"
                    Height="125" Width="620" AutoGenerateColumns="False" OnNeedDataSource="grdSelectedItems_NeedDataSource"
                    OnRowDrop="grdSelectedItems_RowDrop" Skin="Default" BorderColor="#8CB71F" BorderWidth="1px">
                    <MasterTableView DataKeyNames="ItemTypeID">
                        <NoRecordsTemplate>
                            <div style="height: 95px; width: 590px; cursor: pointer; padding: 3px 0px 0px 5px">
                                Drag selected items to this area</div>
                        </NoRecordsTemplate>
                        <Columns>
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                UniqueName="DeleteColumn">
                                <ItemStyle HorizontalAlign="Center" Width="20px" />
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn DataField="ItemTypeName" HeaderText="ItemTypeName" UniqueName="ItemTypeName">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowRowsDragDrop="True">
                        <Selecting AllowRowSelect="False" EnableDragToSelectRows="True" />
                        <Scrolling AllowScroll="True" />
                    </ClientSettings>
                </telerik:RadGrid>


Thanks for any help!

- John
John M
Top achievements
Rank 1
 answered on 04 Nov 2009
0 answers
101 views
I have to allow the users to search and select one of the resources in advanced form of scheduler. When the advanced form is posted back, the form looses all values (like the appt #, subject, start & end). How can I retain the bound values even after postback?
Ez Bala
Top achievements
Rank 1
 asked on 04 Nov 2009
3 answers
133 views
Hi Everybody, how are you?

Well, I have been thinking of a solution, and then I decided to post the case for somebody that had some situation.

I created a ASPX page with two grids. I'd like that the any user clicks on any item of a grid and then He/She can move this item to another grid. When the user move the item I'd like the item shows of differente form like clear or transparent.

Is it possible the user to drag items of a grid for another grid and then to add these items?

Plase, Can Somebody help me?

Thank you for attention,

Carlos
Carlos Marchi
Top achievements
Rank 1
 answered on 04 Nov 2009
2 answers
190 views
I'm trying to bind a gridview inside a RadPanelBar.  My initial aspx code is somewhat like this:

 

<telerik:RadPanelBar ID="rpbSections" runat="server">

 

<Items>

 

 

<telerik:RadPanelItem runat="server">

 

<Items>

 

<telerik:RadPanelItem runat="server">

 

<ItemTemplate>

 

<asp:GridView ID="gvPlanContents" runat="server" AutoGenerateColumns="True"

 

DataKeyNames="PlanContentID" HorizontalAlign="Center" Width="60%" ShowHeader="true"

 

EmptyDataText="No Data here">

 

</asp:GridView>

 

</ItemTemplate>

 

</telerik:RadPanelItem>

 

</Items>

 

</telerik:RadPanelItem>

 

</Items>

 

</telerik:RadPanelBar>

My code starts something like this:

 

List<PlanSections> mySections = PlanSections.GetAllPlanSections();
rpbSections.DataSource = mySections;

 

 

rpbSections.DataValueField =

"PlanSectionID";

 

 

rpbSections.DataTextField =

"PlanSectionName";

 

 

rpbSections.DataBind();

 


 

for (int i = 0; i < rpbSections.Controls.Count; i++)

 

 

 {

 

 

    int mySectionID = Convert.ToInt32(rpbSections.Items[i].Value);

 

 

   // what I need to know is, what code do I use to access the gridview.  I want to bind it for each
    // of its instantiations, by generating an object that depends on the value of MySectionID.
    // Where do I go from here?
}

Thanks!

Laurie

 

 

 

Laurie
Top achievements
Rank 2
 answered on 04 Nov 2009
2 answers
138 views
I'm using Scheduler (Q2 2009), when I try to load it I get the following error:

Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.


I found in your forum the line that can solve it::
sessionState mode="InProc" in my Web.config,
it works but for me it's not possible use this mode.

How can I use this control with :
sessionState mode="StateServer"

?

Thanks,

Ester




Peter
Telerik team
 answered on 04 Nov 2009
0 answers
149 views
Removed obsolete Scheduler-related members:

  • SchedulerFormCreatingEventArgs.Time – The Start and End time of the appointment to be inserted/edited can be accessed through the Appointment property.
  • SchedulerNavigationCommandEventArgs.SelectedDay - Please, use the SelectedDate property instead
  • SchedulerStrings.Insert - The Insert string is no longer in use and has beeen replaced by Save
  • SchedulerStrings.Update - The Insert string is no longer in use and has beeen replaced by Save
  • SchedulerStrings.AdvancedMoreDetails - No longer used in the standard templates
  • SchedulerStrings.AdvancedRecurringAppointment - No longer used in the standard templates
  • SchedulerStrings.AdvancedRange - No longer used in the standard templates
  • SchedulerProviderBase.SupportsMultipleResourceValues - Use ResourceType.AllowMultipleValues to indicate if a resource type supports multiple values
  • RadScheduler.MonthVisibleAppointmentsPerDay - Use RadScheduler.MonthView.VisibleAppointmentsPerDay instead
  • RadScheduler.ShowWeeklyColumnHeader - "Use RadScheduler.WeekView.ShowDateHeaders and RadScheduler.WeekView.ShowResourceHeaders instead
  • RadScheduler.ShowMonthlyColumnHeader - Use RadScheduler.MonthView.ShowDateHeaders and RadScheduler.MonthView.ShowResourceHeaders instead
  • RadScheduler.DayHeaderDateFormat - Use RadScheduler.DayView.HeaderDateFormat instead
  • RadScheduler.WeekHeaderDateFormat - Use RadScheduler.WeekView.HeaderDateFormat instead
  • RadScheduler.MonthHeaderDateFormat - Use RadScheduler.MonthView.HeaderDateFormat instead
  • RadScheduler.WeekColumnHeaderDateFormat - Use RadScheduler.WeekView.ColumnHeaderDateFormat instead
  • RadScheduler.MonthColumnHeaderDateFormat - Use RadScheduler.MonthView.ColumnHeaderDateFormat instead
  • RadScheduler.StartInFullTime - Use ShowFullTime instead
  • RecurrenceRange.MaxOccurences - Use MaxOccurrences instead (misspelling)
  • RecurrenceState.Occurence - Use Occurrence instead (misspelling)
  • SchedulerViewType.ResourceView - Use DayView and set the GroupBy property
Telerik Admin
Top achievements
Rank 1
Iron
 asked on 04 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?