Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
450 views
One of the variables in my update queries is the current date.  I don't know how to set it up ride on the sqldatasource.  Using the regular aspx gridview, I normally set this in the code behind.

I'm at a loss on how to do this in radgrid.  Here's the code that I've trying to solve.  Everything else works but when I do the update, it still cannot find this parameter.

I would appreciate the help.  Thank you!

 Protected Sub RadGrid1_UpdateCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand
        SqlDataSource1.UpdateParameters.Add("@InactiveDate", SqlDbType.DateTime)
        SqlDataSource1.UpdateParameters("@InactiveDate").DefaultValue = Date.Now()


    End Sub
Shinu
Top achievements
Rank 2
 answered on 13 Jun 2012
1 answer
77 views
hi,
i am using radgrid with vitualscrolling in my application and i am using client side databinding to avoid postpack .if radgrid contains more than two pages ,radgrid working fine but if radgrid contains two pages, i am unable to view second page..becoz scroll is not working... please give some suggestion.The following codings are using in my application.

javascript:
function RadGrid1_Command(sender, args)
{
args.set_cancel(
true);
var currentPageIndex = sender.get_masterTableView().get_currentPageIndex();
var pageSize = sender.get_masterTableView().get_pageSize();
...........................................
...........................................
..........................................
...........................................
...................
}
function updateGrid(result) {
var tableView = $find(document.getElementById("hdnradgridclientid").value).get_masterTableView();
tableView.set_dataSource(result);
tableView.dataBind();
}
function updateVirtualItemCount(result)
{
var tableView = $find(document.getElementById("hdnradgridclientid").value).get_masterTableView();
tableView.set_virtualItemCount(result);
}       


aspx page:

<telerik:RadGrid ID="RadGridAssessment" EnableViewState="false" Width="100%" runat="server"
 AllowSorting="True" Height="430px" AllowMultiRowSelection="true" AllowPaging="true"GridLines="None" BorderWidth="0" AutoGenerateColumns="true" PagerStyle-AlwaysVisible="false"Skin="Vista" OnNeedDataSource="RadGrid1_NeedDataSource">
<PagerStyle Visible="false" />
<MasterTableView Width="99%">
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
<ClientEvents OnCommand="RadGrid1_Command" />
<Selecting AllowRowSelect="True"></Selecting>
<Scrolling AllowScroll="true" EnableVirtualScrollPaging="true" UseStaticHeaders="true"ScrollHeight="275px" SaveScrollPosition="True">
</
Scrolling>
</ClientSettings>
 </telerik:RadGrid>

Prab
Top achievements
Rank 1
 answered on 13 Jun 2012
0 answers
74 views
the following thread started this discussion http://www.telerik.com/community/forums/aspnet-ajax/grid/getting-value-from-griddropdowncolumn-when-not-in-edit-mode.aspx about retrieving ListValueField of a cell when in display mode. At the time, it was not possible to do so directly. Have you made any changes in this regard enabling such retrieval? If not, i would like to propose this as a feature enhancement.

from my point of view - and no offense - it is a complete crock to make another trip to the database when the data has already once been retrieved.

to be more specific, i have the GridDataItem form of the data - i even have full access to the grid - and would like to retrieve the ListValueField - not the ListTextField value which is quite simple to access.
tony
Top achievements
Rank 1
 asked on 13 Jun 2012
1 answer
167 views
Hi telerik team,

Are there any approaches for this case?

Thanks so much!
Shinu
Top achievements
Rank 2
 answered on 13 Jun 2012
2 answers
127 views
Hi Telerik,

I have a dynamically created floating RadDock called "FormAreaDock" that I use to act like a box - sort of a placeholder - for other dynamically floating RadDocks.

I am purposely not using RadDockZones because as far as I know, zones cannot be moved anywhere I want to move it.

I have been able to move the "FormAreaDock" to virtually any position and any other floating RadDocks that are within the bounds of the "FormAreaDock" also move along with it.

My problem is that it only works when I'm running the program in my development machine. Once I publish (deploy) it, it refuses to work as it should and I am getting the following error message:

Webpage error details
  
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Thu, 7 Jun 2012 23:19:50 UTC
  
  
Message: Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: {"Top":346,"Left":969,"DockZoneID":"","Collapsed":false,"Pinned":false,"Resizable":true,"Closed":false,"Width":"701px","Height":"904px","ExpandedHeight":0,"Index":-1}.
Line: 6
Char: 84093
Code: 0
URI: http://xm-wvl-02:4201/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=AppContent_ctlAdminTemplatesFreeStyleEdit_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1f68db6e-ab92-4c56-8744-13e09bf43565%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.3.1305.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a8cba3cb6-b29d-4c9f-be22-7b43626a420a%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3af46195d3%3a854aa0a7%3a874f8ea2%3a5a6d9d23%3a7c926187%3a8674cba1%3ab7778d6c%3ac08e9f8a%3aa51ee93e%3a59462f1%3a5f39f986%3a1e771326%3aaa288e2d

So, my questions are:

1. Why do I not get that error in my development machine?
2. What factors should I take into consideration to avoid an INVALID JSON error?
3. Is there a better way of doing what I'm trying to achieve?

Thank you.
Virgil Rodriguez
Top achievements
Rank 1
 answered on 12 Jun 2012
1 answer
734 views
I have a radgrid with all rows in edit mode.
A update button is outside the grid.
<telerik:RadGrid ID="radgridFeeCalc" runat="server" ShowStatusBar="true"
                                    AutoGenerateColumns="False" PageSize="5" AllowPaging="True" AllowSorting="True"
                                    AllowMultiRowSelection="False" AllowAutomaticUpdates="false"
                                    GridLines="None" AllowAutomaticDeletes="false" AllowAutomaticInserts="false"
                                    OnItemDataBound="radgridFeeCalc_ItemDataBound"
                                    >
                                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                                    <MasterTableView DataKeyNames="SEQ_NUM, DST_ID"
                                    AllowMultiColumnSorting="True" ShowFooter="True"
                                    CommandItemDisplay="Top" Name="Address" AllowFilteringByColumn="False" TableLayout="Auto" >
                                        <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                                        <Columns>                                           
                                             
                                            <telerik:GridBoundColumn SortExpression="SEQ_NUM" HeaderText="Sequence" HeaderButtonType="TextButton"
                                                DataField="SEQ_NUM" UniqueName="sEQ_NUM" ReadOnly="true">
                                            </telerik:GridBoundColumn>
                                             
                                            <telerik:GridBoundColumn SortExpression="DESCR" HeaderText="Description" HeaderButtonType="TextButton"
                                                DataField="DESCR" UniqueName="dESCR" ReadOnly="true">
                                            </telerik:GridBoundColumn>
 
                                            <telerik:GridTemplateColumn HeaderText="Calc Amount" DataField="VAL" UniqueName="vAL" >
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="VAL" runat="server" Text='<%# Bind("VAL") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate >
                                                    <asp:TextBox ID="view_VAL" runat="server" Text='<%# Bind("VAL") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
 
                                            <telerik:GridBoundColumn SortExpression="DST_ID" HeaderText="Distribution Id" HeaderButtonType="TextButton"
                                                DataField="DST_ID" UniqueName="dST_ID" ReadOnly="true">
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
 
                                <telerik:RadButton ID="btnUpdate" runat="server" Text="Update" onclick="btnUpdate_Click"></telerik:RadButton>

How do I get all values from all rows from the grid in an external button "btnUpdate".
I have the following code and can get the datakeyvalues but cannot get the textbox value as the "VAL" textbox is not found.
protected void btnUpdate_Click(object sender, EventArgs e)
        {
            foreach (GridEditFormItem editedItem in radgridFeeCalc.MasterTableView.GetItems(GridItemType.EditFormItem))
            {
                string keyId1 = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["SEQ_NUM"].ToString();
                string keyId2 = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["DST_ID"].ToString();
 
                TextBox combo = ((GridEditFormItem)editedItem).EditFormCell.FindControl("VAL") as TextBox;
                string str1 = combo.Text;
            }
        }

Jayesh Goyani
Top achievements
Rank 2
 answered on 12 Jun 2012
5 answers
205 views
Background:

I have implemented RadScheduler (Q3 ASP.NET AJAX) into a custom MOSS web part. The scheduler is bound to a SharePoint Datasource on the page. The ds is attached to a standard SP task list. I have bound the scheduler start time field to the start date and the scheduler end time field to the due date.

Problem:

I am getting the following error: System.Exception: Appointment is invalid: Start time must be before the End time. at Telerik.Web.UI.Appointment.Validate()

In looking through my task list data, I see that some tasks are scheduled to start and end on the same day. I also see that I have tasks that do not have either a start date or a due date.

I assume my error is being generated from these inconsistencies.

Proposed Resolution:

I think I would need to verify each appointment, but I am unsure as to the best way to handle the exceptions. I am thinking the AppointmentDataBound event could be used to verify each appointment. I could check to make sure all fields exist and make sure the due date is after the start date. Would using this event work? 

Question:

Can the scheduler handle using dates only without a time field? I would like to have all appointments register as full day appointments. If the start date was 5/1 and the due date was 5/2, can the sceduler evaluate this? Also, if the start date and due date were the same, can the scheduler evaluate this? Or do I need to add custom handling in the AppointmentDataBound event for these scenarios?

Thanks.
Peter
Telerik team
 answered on 12 Jun 2012
0 answers
73 views
Sorry guys for the trouble. I solved it. It was my CssClass. Removing that does the trick.

Thanks,
-Sree
Sreekanth
Top achievements
Rank 1
 asked on 12 Jun 2012
1 answer
151 views
The OnKeyPress event will fire on a RadGrid but NOT when you are in Edit Mode using EditMode="EditForms". 

How do I capture KeyPress event in a RadGrid while in Edit Mode?
Eyup
Telerik team
 answered on 12 Jun 2012
1 answer
185 views
Hi All, 

I m using radgrid's google like filtering feature.

Also i m having two checkbox columns which are dynamically created.

Now, if i check a checkbox and filter the values the checkbox's status is lost. It becomes unchecked.

How can i persist the checkbox's checked status after filtering?
Eyup
Telerik team
 answered on 12 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?