Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
301 views

Okay, so I have a RadGrid that is being filled with data.  I have an edit column.  I click the edit column, change a record, and hit update.  It posts back to the page, and goes back to the radgrid, only the update didn't happen. 

1. My first assumption was that I forgot to set it up so that radgrid would refresh, so I check the data table in the SQL database, only to find that the update simply didn't happen, so...

2. I check the ObjectDataSource; yup, all parameters exist.

3. I check the SQL to make sure the update is correct.  Yup, the update is correct.

So in essence, all my code is correct, it's Radgrid that is not working.  The question is, why?  If anyone has a clue, please let me know.  It's probably something that tired eyes are merely overlooking.  I think I lost a little more of my hair over this one...lol. 

...so here's the relevant .aspx code;

<telerik:RadGrid ID="RecentReviewsGrid" runat="server" 
    AllowAutomaticUpdates="True" AllowPaging="True" AllowSorting="True" 
    AutoGenerateColumns="False" DataSourceID="dsTransactionReview" GridLines="None" 
    HorizontalAlign="Center" PageSize="20">
    <mastertableview datakeynames="TransactionID" 
    datasourceid="dsTransactionReview" headerstyle-horizontalalign="Center">
        <commanditemsettings exporttopdftext="Export to Pdf" />
        <rowindicatorcolumn>
            <HeaderStyle Width="20px" />
        </rowindicatorcolumn>
        <expandcollapsecolumn>
            <HeaderStyle Width="20px" />
        </expandcollapsecolumn>
        <Columns>
            <telerik:GridBoundColumn 
                DataField="TransactionID" 
                DataType="System.Int32" 
                HeaderText="TransactionID" 
                ReadOnly="True" 
                SortExpression="TransactionID" 
                UniqueName="TransactionID" 
                Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="OrderID" 
                DataType="System.Int32" 
                HeaderText="OrderID" 
                SortExpression="OrderID" 
                UniqueName="OrderID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="OrderDate" 
                DataType="System.DateTime" 
                HeaderText="OrderDate" 
                SortExpression="OrderDate" 
                UniqueName="OrderDate" 
                Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="CreatedBy" 
                HeaderText="CreatedBy" 
                SortExpression="CreatedBy" 
                UniqueName="CreatedBy">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="CategoryType" 
                HeaderText="CategoryType" 
                SortExpression="CategoryType" 
                UniqueName="CategoryType">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn 
                DataField="IsEntryCorrect" 
                DataType="System.Boolean" 
                HeaderStyle-Width="50px" 
                HeaderText="Correct Code?" 
                ItemStyle-Width="50px" 
                SortExpression="IsEntryCorrect" 
                UniqueName="IsEntryCorrect">
                <HeaderStyle Width="50px" />
                <ItemStyle Width="50px" />
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn 
                DataField="Suitable" 
                DataType="System.Boolean" 
                HeaderStyle-Width="50px" 
                HeaderText="Suitable?" 
                ItemStyle-Width="50px" 
                SortExpression="Suitable" 
                UniqueName="Suitable">
                <HeaderStyle Width="50px" />
                <ItemStyle Width="50px" />
            </telerik:GridCheckBoxColumn>
            <telerik:GridBoundColumn 
                DataField="CorrectCode" 
                HeaderText="Correct Code" 
                SortExpression="CorrectCode" 
                UniqueName="CorrectCode">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn 
                DataField="NeedCoached" 
                DataType="System.Boolean" 
                HeaderStyle-Width="50px" 
                HeaderText="Need Coached?" 
                ItemStyle-Width="50px" 
                SortExpression="NeedCoached" 
                UniqueName="NeedCoached">
                <HeaderStyle Width="50px" />
                <ItemStyle Width="50px" />
            </telerik:GridCheckBoxColumn>
            <telerik:GridBoundColumn 
                DataField="Comments" 
                HeaderText="Comments" 
                SortExpression="Comments" 
                UniqueName="Comments">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="DateReviewed" 
                DataType="System.DateTime" 
                HeaderText="Review Date" 
                SortExpression="DateReviewed" 
                UniqueName="DateReviewed">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="Reviewer" 
                HeaderText="Reviewer" 
                SortExpression="Reviewer" 
                UniqueName="Reviewer">
            </telerik:GridBoundColumn>
            <telerik:GridEditCommandColumn UniqueName="EditCommand">
            </telerik:GridEditCommandColumn>
        </Columns>
        <HeaderStyle HorizontalAlign="Center" />
    </mastertableview>
</telerik:RadGrid>
  
<asp:ObjectDataSource ID="dsTransactionReview" runat="server" 
    DeleteMethod="Delete" 
    OldValuesParameterFormatString="{0}" 
    SelectMethod="GetData" 
    TypeName="Pan_App.PanDataTableAdapters.Tink_CoachingTableAdapter" 
    UpdateMethod="Update">
    <DeleteParameters>
        <asp:Parameter Name="TransactionID" Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="OrderID" Type="Int32" />
        <asp:Parameter Name="OrderDate" Type="DateTime" />
        <asp:Parameter Name="CreatedBy" Type="String" />                        
        <asp:Parameter Name="CategoryType" Type="String" />
        <asp:Parameter Name="IsEntryCorrect" Type="Boolean" />
        <asp:Parameter Name="Suitable" Type="Boolean" />
        <asp:Parameter Name="CorrectCode" Type="String" />
        <asp:Parameter Name="NeedCoached" Type="Boolean" />
        <asp:Parameter Name="Comments" Type="String" />
        <asp:Parameter Name="DateReviewed" Type="DateTime" />                            
        <asp:Parameter Name="Reviewer" Type="String" />
        <asp:Parameter Name="TransactionID" Type="Int32" />
    </UpdateParameters>
</asp:ObjectDataSource>

I think that about covers it.  Here's the Update command for SQL:
UPDATE    TableName
SET              
    OrderID = @OrderID, 
    OrderDate = @OrderDate, 
    CreatedBy = @CreatedBy, 
    CategoryType = @CategoryType, 
    IsEntryCorrect = @IsEntryCorrect, 
    Suitable = @Suitable, 
    CorrectCode = @CorrectCode, 
    NeedCoached = @NeedCoached, 
    Comments = @Comments, 
    DateReviewed = @DateReviewed, 
    Reviewer = @Reviewer
WHERE     (TransactionID = @TransactionID)
seems straight-forward enough...any clue would be appreciated.

Tsvetoslav
Telerik team
 answered on 09 Dec 2010
1 answer
145 views
I need some help ith one o the demos I am trying to use.
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx

I have created a very similar version except that I am using a pop up window instead and 2 ascx user control forms which just allows the user to enter all info and then edit some info.

The first problem is: with this code behind in the RadGrid1_PreRender event.
if (!this.IsPostBack)
{
this.RadGrid1.MasterTableView.Items[1].Edit = true;
this.RadGrid1.MasterTableView.Rebind();
}

I get this error when my page loads.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Now I am using a hierarchy grid which is pullong data from the same db.

The second issue I am having is the Insert and Update button in the user control form .ascx file. I have this code for the update button which is directly from the demo.
    <asp:Button ID="btnUpdate" Text="Update" runat="server" CommandName="Update" Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>' Font-Size="0.9em" />
</td>
<td>
    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false" CommandName="Cancel"
        Font-Size="0.9em" />

For some reason the DataItem is not liked and I am getting this web page request error when I go to edit a record.
Error: Sys.WebForms.PageRequestManagerServerErrorException: c:\test\Web Projects\Sites\Industries VS2008\ Industries\Board\Controls\Admin\EmailSettingsUpdate.ascx(172): error CS0103: The name 'DataItem' does not exist in the current context

Can anyone shed some light here?

Thanks


Tsvetoslav
Telerik team
 answered on 09 Dec 2010
1 answer
92 views
I'm wondering if it's possible to show/hide (set visible to true or false) nested panel items in the panelbar based on a combobox, etc selection in the first panelitem?

Example, a panelbar with 10 total panelitems contained in it.  First panelitem has a combobox.  User selected a value from combobox and only certain subsequent panelitems show, the rest get hidden.

Is this possible?  Is it at all possible to do this in jquery by getting the id of the parent object and then walking down to the appropriate child level?
Shinu
Top achievements
Rank 2
 answered on 09 Dec 2010
7 answers
125 views
I have some issues with Point Chart of your Ajax components. As you can see on my attachment, in a point chart, changing the point size loses it's center on the axes.

Also how can i disable or collapse the visibilty of the coordinate plate, axes of y=0 and x=0 ??

Thank you...
Evgenia
Telerik team
 answered on 09 Dec 2010
1 answer
113 views
In MS Word I can select all the text, hit Shift F3 and it converts the text to All Lowercase, then if I hit Shift F3 again it will capitalize the first word in every sentence. Is there a way to do that with the radEditor?
Rumen
Telerik team
 answered on 09 Dec 2010
1 answer
94 views
I need to localize "all day" and "Show 24 hours..." in the scheduler.

For "all day" I added the localization tag below. For "Show 24 hours..." I figured this line of code would do it. What am I missing?

rsScheduler.Localization.Show24Hours = (

 

string)_Master.m_FormLabels["Show 24 hours..."];

 



 

 

<telerik:RadScheduler ID="rsScheduler" runat="server" Skin="Office2009" EnableEmbeddedSkins="false"

 

 

 

DataKeyField="RecordID" DataStartField="StartDate" DataEndField="EndDate" DataSubjectField="Name"

 

 

 

Height="100%" Width="100%" OnNavigationCommand="rsScheduler_OnNavigationCommand" OnAppointmentDataBound="rsScheduler_AppointmentDataBound"

 

 

 

OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick" OnClientAppointmentInserting="OnClientAppointmentInserting" OnClientAppointmentCreated="OnClientAppointmentCreated" AllowDelete="false" AllowEdit="false" ShowDateHeaders="True" ShowNavigationPane="True" BorderStyle="NotSet" OverflowBehavior="Scroll">

 

 

 

<Localization AdvancedAllDayEvent="All day"></Localization>

 

 

 

<AppointmentTemplate>

 

 

 

<div class="rsAptContent"><img id="imgAppt" src="<%# Eval("Attributes[\"IconUrl\"]") %>" />&nbsp;<%# Eval("Subject") %></div>

 

 

 

</AppointmentTemplate>

 

 

 

</telerik:RadScheduler>

 

Shinu
Top achievements
Rank 2
 answered on 09 Dec 2010
2 answers
793 views
Hi,

I am using FormTemplate of EditFormSettings of Data Grid to add/modify records. I want to place the popup center to screen instead of relative to row/grid. I am using popup as modal popup (PopUpSettings-Modal="true").

Thanks in advance.

Thanks & Regards,
Sumanth
Sumanth
Top achievements
Rank 1
 answered on 09 Dec 2010
1 answer
220 views
Hi,

I have 10 GridBoundColumns in RadGrid1. I want to hide and unhide columns from outside grid. Let say I have 2 buttons when user click on first button i want to hide first five columns and when user click on second button i want to hide last five columns.

Can you please tell me how do i do this?

Many Thanks
Shinu
Top achievements
Rank 2
 answered on 09 Dec 2010
1 answer
189 views
I have created a custom control that uses the newest telerik version. I have now compiled that into a dll and want to reuse it in some projects what use an older version of the telerik controls. Is this possible?

The newest version is in the GAC but when I try to compile the old project I get an error.
Princy
Top achievements
Rank 2
 answered on 09 Dec 2010
1 answer
78 views
Hi,

Page Size is not appearing in grid footer after once user set the page size equal to maximum number of record. For example, if there are 600 total number of records and page size is initially set to 25 records per page, later when in run time user set it to 600 per page, then after that page size is not appearing to reset it back to 25 records per page.

Please suggest.

Regards,
Krunal
Princy
Top achievements
Rank 2
 answered on 09 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?