Hi
We have a grid that, in edit mode, the user has the options to 'Save this record' or 'Save this record and add another'. When clicking the 2nd option, the current record should be persisted to the database and a new blank form should be presented to allow the user to enter more data. Very often we want to prepopulate the form based on the previous entry. I have the following code to do this:
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e) { if (e.CommandSource is LinkButton) { LinkButton sourceLinkButton = (LinkButton)e.CommandSource; if (sourceLinkButton.ID == "SaveThisRecordAndAddAnotherLinkButton") { e.Item.OwnerTableView.PerformInsert(); RadGrid1.MasterTableView.IsItemInserted = true;
//Prepare an IDictionary with the predefined values System.Collections.Specialized.ListDictionary newValues = new System.Collections.Specialized.ListDictionary(); newValues["Remarks"] = "Test remarks";
//Insert the item and rebind e.Item.OwnerTableView.InsertItem(newValues); RadGrid1.Rebind(); Utils.Log("IsItemInserted:" + RadGrid1.MasterTableView.IsItemInserted); } else { RadGrid1.MasterTableView.IsItemInserted = false; } } }RadGrid1.MasterTableView.IsItemInserted = true;' in the Page_Load event and the grid loaded with the insert form open as expected.true;' to show the insert form?RadTabStrip3.Tabs[0].Selected =
true; //first tab in the tabs collection
LoadPlanMenuMon.Visible = true; //corresponding pageview
RadGrid1.Visible = true; //corresponding radgrid inside pageview
Plz help.
Hi,
I am using radgrid with Inplace EditMode and its working fine when there is data available in grid.
But when there is no any data in grid, and then on clicking on “Add Row” the grid is getting blank without any new row for inserting data
Please get the details decription in attached file.
Thanks
Mukesh
Hi
I am using this code to display a RAD Date Picker (I am using Rad Ajax Control for ASP .Net Version Q3 2008) . My requirement is on Tab off(lost focus) calendar popup should be hide. This is working while I added “OnBlur” event on “DateInput” control. But now it is creating a new problem. It is not showing new selected date in DatePicker control. For example if DatePicker already have “09/09/2008” as date value and now I have selected “09/08/2008” as new date, This new selected date is not coming in DatePicker control (If I commented ctl.hidePopup() statement from _txtClaimantDOI_OnBlur() Then I am able to see new selected date in date picker control).
<telerik:RadDatePicker ID="txtClaimantDOI" runat="server" Skin="Office2007" EnableEmbeddedSkins="false" Width="70px">
<DateInput onfocus="_txtClaimantDOI_OnFocus()" OnBlur="_txtClaimantDOI_OnBlur()" >
</DateInput>
<Calendar DayNameFormat="FirstLetter" FirstDayOfWeek="Default" EnableMultiSelect="false"
UseColumnHeadersAsSelectors="False"
UseRowHeadersAsSelectors="False" TabIndex="0">
</Calendar>
<ClientEvents OnDateSelected="DateSelected" />
<DatePopupButton Visible="true" Style="display: none;" TabIndex="0" />
</telerik:RadDatePicker>
<telerik:RadScriptBlock ID="txtClaimantDOIScriptBlock" runat="server">
<script language="javascript" type="text/javascript">
//<![CDATA[
function _txtClaimantDOI_OnFocus() {
var ctl = $find("<%= txtClaimantDOI.ClientID %>");
ctl.showPopup();
}
function _txtClaimantDOI_OnBlur() {
var ctl = $find("<%= txtClaimantDOI.ClientID %>");
ctl.hidePopup();
}
//]]>
</script>
</telerik:RadScriptBlock>
Please help me in this.
Regards
Atul Kumar Srivastav
If TypeOf e.Item Is GridGroupHeaderItem Then Dim item As GridGroupHeaderItem = e.Item If item.GroupIndex = "0" Then item.Expanded = True End IfEnd IfPrivate Sub rgvReportGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgvReportGrid.ItemCommand If e.CommandName = RadGrid.ExpandCollapseCommandName Then Dim item As GridGroupHeaderItem = e.Item Dim groupIndex As String = item.GroupIndex.ToString Dim grid As RadGrid = source For Each gridItem As GridItem In grid.MasterTableView.Controls(0).Controls If TypeOf (gridItem) Is GridGroupHeaderItem Then Dim groupHeaderItem As GridGroupHeaderItem = gridItem If groupHeaderItem.GroupIndex.ToString = groupIndex Then groupHeaderItem.Expanded = True Else groupHeaderItem.Expanded = False End If End If Next End IfEnd Sub