| <DetailTables> |
| <telerik:GridTableView runat="server" DataSourceID="SqlDataSource4" DataKeyNames="JobPersonID" |
| ShowHeader ="true" Width="100%" CommandItemDisplay= "TopAndBottom" Name = "Detail" |
| AllowAutomaticDeletes="true" AllowAutomaticInserts="true" onupdatecommand="RadGrid1_UpdateCommand" |
| AllowAutomaticUpdates="true" BorderColor="#BC9A10" GridLines="None"> |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="PersonId" MasterKeyField="PersonTableID" /> |
| </ParentTableRelation> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn > |
| <HeaderStyle Width="20px" ForeColor="Aqua" /> |
| </ExpandCollapseColumn> |
| <Columns> |
| '''' |
| <telerik:GridBoundColumn DataField="PositionControlNum" HeaderText="Position Control#" HeaderStyle-Width="50%" |
| SortExpression="PositionControlNum" UniqueName="PositionControlNum" > |
| <HeaderStyle Width="50%"></HeaderStyle> |
| </telerik:GridBoundColumn> |
| '''' |
| </Columns> |
| <EditFormSettings EditFormType="Template"> |
| <EditColumn UniqueName="EditCommandColumn1"></EditColumn> |
| <FormTemplate> |
| <table id="Table1a" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none" |
| style="border-collapse: collapse; background: white;"> |
| <tr class="EditFormHeader"> |
| <td colspan="2"> |
| <asp:Label ID="UserJobLabel" |
| CssClass="form-local_Headers" runat="server" Text="User Job Details" |
| Font-Underline="True" |
| ></asp:Label> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| </td> |
| <tr> |
| <td> |
| Position Control#</td> |
| <td> |
| <telerik:RadComboBox ID="RadComboBoxPositionControl" runat="server" |
| DataSourceID="SqlDataSource5" DataTextField="PositionControlNum" DataValueField="PositionControlNum" |
| DropDownWidth="599px" Height="110px" HighlightTemplatedItems="true" |
| MarkFirstMatch="true" |
| SelectedValue='<%#Bind("PositionControlNum") %>' Width="600px" |
| > |
| <HeaderTemplate> |
| <table cellpadding="0" cellspacing="0" style="width: 565px"> |
| <tr> |
| <td style="width: 105px;"> |
| Position Control#</td> |
| <td style="width: 75px;"> |
| Budget</td> |
| '' |
| '' |
| </tr> |
| </table> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <table cellpadding="0" cellspacing="0" style="width: 565px"> |
| <tr> |
| <td style="width: 105px;"> |
| <%# DataBinder.Eval(Container.DataItem, "PositionControlNum") %> |
| </td> |
| <td style="width: 75px;"> |
| <%# DataBinder.Eval(Container.DataItem, "Budget", "{0:N2}")%> |
| </td> |
| '' |
| '' |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| </td> |
| <tr> |
| <td> |
| </td> |
| <td> |
| <asp:Label ID = "FormTemplate_Label" runat = "server"></asp:Label> |
| </td> |
| <td> |
| </td> |
| <td align="right" colspan="2"> |
| <asp:Button ID="btnUpdate" runat="server" CssClass="form-button" |
| CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' |
| Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
| /> |
| |
| <asp:Button ID="btnCancel" runat="server" CausesValidation="False" CssClass="form-button" |
| CommandName="Cancel" Text="Cancel" /> |
| </td> |
| </tr> |
| </tr> |
| </table> |
| </FormTemplate> |
| </EditFormSettings> |
| </telerik:GridTableView> |
| <DetailTables> |
| '''' |
| <asp:SqlDataSource ID="SqlDataSource4" runat="server" |
| ConnectionString="<%$ ConnectionStrings:My_AuthorizationConnectionString %>" |
| SelectCommand=" ...." |
| DeleteCommand="..." |
| InsertCommand="..." |
| UpdateCommand="..." |
| <UpdateParameters> |
| <asp:Parameter Name="PositionControlNum" Type="String" /> |
| <asp:Parameter Name="Budget" Type="Decimal" /> |
| '''' |
| </UpdateParameters> |
| <InsertParameters> |
| '''' |
| </InsertParameters> |
| </asp:SqlDataSource> |
nonqueryCommand.Parameters.Add(
"@jobStart", SqlDbType.SmallDateTime)
nonqueryCommand.Parameters.Add(
"@jobEnd", SqlDbType.DateTime)
nonqueryCommand.Parameters(
"@jobStart").Value = RadDateJobStart.SelectedDate.Value
nonqueryCommand.Parameters(
"@jobEnd").Value = RadDateJobEnd.SelectedDate.Value
the entries in the db are empty ?? what am I missing
datetimeColumn.DataFormatString =
"{0:yyyy-MM-dd}";
but looks like only data value format has changed and filter textbox data format is still MM-dd-yyyy after selecting date from calendar control.
Any idea to fix this.
Thanks,
Sam
popupScript =
"<script>var wnd = window.radopen(\"[path]\", \"[name]\");</script>";
Page.RegisterStartupScript(
"PopupScript", popupScript);
function
OpenWindow(name) {
var wnd = window.radopen([path], [name]);
wnd.Maximize();
return false;
}
[c#]
popupScript =
"<script>OpenWindow('[name]');</script>";
Page.RegisterStartupScript("PopupScript", popupScript);
or:
popupScript = 'javascript:OpenWindow('[name]');:;
Page.RegisterStartupScript("PopupScript", popupScript);
I know that Page.RegisterStartupScript is considered obsolete, but it still works to open normal windows. Is there something specific I would have to do to make a RadWindow able to be opened in server code?
| Protected Sub rgTimeslips_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles rgTimeslips.ItemCommand |
| If (e.CommandName = RadGrid.EditCommandName) Then |
| e.Item.OwnerTableView.EditFormSettings.CaptionFormatString = "Edit Time Slip" |
| Dim frmitem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem) |
| Dim ddlreason As RadComboBox = DirectCast(frmitem.FindControl("ddlReason1"), RadComboBox) |
| ddlreason.Skin = Application("TelerikTheme") |
| End If |
| End Sub |
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
| Protected Sub RadAjaxManagerProxy1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) |
| Dim grid As Telerik.Web.UI.RadGrid = DirectCast(FindControl("RadMultiPage1").FindControl("PageSearch").FindControl("grdSearchRFS"), Telerik.Web.UI.RadGrid) |
| If e.Argument = "Rebind" Then |
| grid.MasterTableView.SortExpressions.Clear() |
| grid.MasterTableView.GroupByExpressions.Clear() |
| grid.Rebind() |
| ElseIf e.Argument = "RebindAndNavigate" Then |
| grid.MasterTableView.SortExpressions.Clear() |
| grid.MasterTableView.GroupByExpressions.Clear() |
| grid.MasterTableView.CurrentPageIndex = grid.MasterTableView.PageCount - 1 |
| grid.Rebind() |
| End If |
| End Sub |
<
telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
| function refreshGrid(arg) |
| { |
| if(!arg) |
| { |
| $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); |
| } |
| else |
| { |
| $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate"); |
| } |
| } |
| <telerik:RadWindowManager ID="RadWindowManager1" runat="server" ShowContentDuringLoad="False" |
| VisibleStatusbar="False" Modal="True" Behaviors="Close, Resize, Move" Height="550px" |
| Width="1000px"> |
| <Windows> |
| <telerik:RadWindow ID="CallDetails" runat="server" Left="" NavigateUrl="RFSDetail.aspx" |
| Height="550px" Width="1000px" Style="display: none;" Title="RFS Detail" Top="" |
| OnClientClose="refreshGrid"> |
| </telerik:RadWindow> |
| </Windows> |
| </telerik:RadWindowManager> |
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
| <!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 runat="server"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
| </telerik:RadScriptManager> |
| </div> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" |
| ConnectionString="<%$ ConnectionStrings:NwindConnectionString %>" |
| DeleteCommand="DELETE FROM [Customers] WHERE (([CustomerID] = ?) OR ([CustomerID] IS NULL AND ? IS NULL))" |
| InsertCommand="INSERT INTO [Customers] ([CustomerID], [CompanyName]) VALUES (?, ?)" |
| ProviderName="<%$ ConnectionStrings:NwindConnectionString.ProviderName %>" |
| SelectCommand="SELECT CustomerID, CompanyName, postalcODE FROM Customers where LEFT(CustomerID,2) <= "CB" ORDER BY CustomerID" |
| UpdateCommand="UPDATE [Customers] SET [CompanyName] = ? WHERE (([CustomerID] = ?) OR ([CustomerID] IS NULL AND ? IS NULL))"> |
| <DeleteParameters> |
| <asp:Parameter Name="CustomerID" Type="String" /> |
| </DeleteParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="CompanyName" Type="String" /> |
| <asp:Parameter Name="CustomerID" Type="String" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="CustomerID" Type="String" /> |
| <asp:Parameter Name="CompanyName" Type="String" /> |
| </InsertParameters> |
| </asp:SqlDataSource> |
| <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" |
| GridLines="None" AllowPaging="True" AllowSorting="True"> |
| <MasterTableView DataSourceID="SqlDataSource1" CommandItemDisplay= "TopAndBottom" |
| AutoGenerateColumns="False" DataKeyNames="CustomerID"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="CustomerID" DefaultInsertValue="" |
| HeaderText="CustomerID" ReadOnly="True" SortExpression="CustomerID" |
| UniqueName="CustomerID"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="CompanyName" DefaultInsertValue="" |
| HeaderText="CompanyName" SortExpression="CompanyName" UniqueName="CompanyName"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <CommandItemTemplate> |
| <div style="padding: 5px 5px;"> |
| Custom command item template for Grid: |
| <asp:linkbutton id="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" /> Edit selected</asp:LinkButton> |
| <asp:linkbutton id="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.gif" /> Update</asp:LinkButton> |
| <asp:linkbutton id="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.gif" /> Cancel editing</asp:LinkButton> |
| <asp:linkbutton id="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" /> Add new</asp:LinkButton> |
| <asp:linkbutton id="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" /> Add this </asp:LinkButton> |
| <asp:linkbutton id="LinkButton1" OnClientClick="javascript:return confirm('Delete selected?')" |
| runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" /> Delete selected Jobs</asp:LinkButton> |
| </div> |
| </CommandItemTemplate> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </form> |
| </body> |
| </html> |