or
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <ajaxsettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> <telerik:AjaxUpdatedControl ControlID="RadGrid2" /> <telerik:AjaxUpdatedControl ControlID="RadGrid3" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadGrid2"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid2" /> <telerik:AjaxUpdatedControl ControlID="RadGrid3" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadGrid3"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid3" /> </UpdatedControls> </telerik:AjaxSetting> </ajaxsettings> </telerik:RadAjaxManager> <strong>States:</strong> <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" PageSize="5" DataSourceID="SqlDataSource1" GridLines="None" width="95%"> <clientsettings allowkeyboardnavigation="true" enablepostbackonrowclick="true"> <Selecting AllowRowSelect="true" /> </clientsettings> <mastertableview datakeynames="State" /> <pagerstyle mode="NextPrevAndNumeric" /> </telerik:RadGrid><br /><br /> <strong>Companies:</strong> <telerik:RadGrid ID="RadGrid2" ShowStatusBar="true" runat="server" AllowPaging="True" PageSize="5" DataSourceID="SqlDataSource2" GridLines="None" width="95%" HorizontalAlign="NotSet"> <mastertableview width="100%" datakeynames="State" datasourceid="SqlDataSource2"> </mastertableview> <clientsettings allowkeyboardnavigation="true" enablepostbackonrowclick="true"> <Selecting AllowRowSelect="true" /> </clientsettings> <pagerstyle mode="NextPrevAndNumeric" /> </telerik:RadGrid><br /><br /> <strong>Records:</strong> <telerik:RadGrid ID="RadGrid3" ShowStatusBar="true" runat="server" AllowPaging="True" PageSize="5" DataSourceID="SqlDataSource3" GridLines="None" width="95%" HorizontalAlign="NotSet"> <mastertableview width="100%" datasourceid="SqlDataSource3"> </mastertableview> <clientsettings allowkeyboardnavigation="true" enablepostbackonrowclick="true"> <Selecting AllowRowSelect="true" /> </clientsettings> <pagerstyle mode="NextPrevAndNumeric" /> </telerik:RadGrid> <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:connex %>" ProviderName="MySql.Data.MySqlClient" SelectCommand=" SELECT EMPLOYER_STATE AS State, COUNT(EMPLOYER_STATE) as 'Total Filings' FROM y2010 GROUP BY EMPLOYER_STATE ORDER BY COUNT(EMPLOYER_STATE) desc" runat="server"></asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:connex %>" ProviderName="MySql.Data.MySqlClient" SelectCommand=" SELECT EMPLOYER_NAME AS Employer, EMPLOYER_STATE AS State, COUNT(EMPLOYER_NAME) as 'Total Filings' FROM y2010 WHERE EMPLOYER_STATE=@state GROUP BY EMPLOYER_NAME ORDER BY COUNT(EMPLOYER_STATE) desc" runat="server"> <SelectParameters> <asp:ControlParameter ControlID="RadGrid1" DefaultValue="CA" Name="State" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:connex %>" ProviderName="<%$ ConnectionStrings:connex.ProviderName %>" SelectCommand="SELECT SOC_NAME, EMPLOYER_NAME AS Employer FROM y2010 WHERE (EMPLOYER_NAME = @Employer)" runat="server"> <SelectParameters> <asp:ControlParameter ControlID="RadGrid2" name="Employer" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:SqlDataSource>
Hi I started with your
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultvb.aspx
I have altered it with comboboxes for form values to add or alter, they show up fine. but when I hit insert or update, the values are not nothing.
from user control combo <telerik:RadComboBox ID="rcbclient" runat="server" DataMember="id" DataTextField="client_name" AutoPostBack="true" AllowCustomText="true" Width="275px"> </telerik:RadComboBox> databind rcbclient.DataSource = getClients() rcbclient.DataBind() from Default.vb Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem) Dim userControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl) 'Prepare new row to add it in the DataSource Dim newRow As DataRow = Me.Staging.NewRow 'Insert new values Dim newValues As Hashtable = New Hashtable newValues("id") = CType(userControl.FindControl("rcbclient"), RadComboBox).SelectedItem.Value newValues("client_id") = CType(userControl.FindControl("rcbclient"), RadComboBox).DataMember newValues("client_name") = CType(userControl.FindControl("rcbclient"), RadComboBox).SelectedValue.ToString <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> <asp:Panel ID="pnlRadEditor" runat="server"> <div> Standard Button: <asp:Button ID="btnSave" UseSubmitBehavior="false" runat="server" OnClick="btnSave_Click" Text="Save" /></div> <div style="margin-top: 10px;"> Image Button: <asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="javascript:__doPostBack(this.id,'');return false;" OnClick="btnSave_Click" ImageUrl="http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/save.gif" /></div> <div style="margin-top: 10px;"> <telerik:RadEditor ID="RadEditor1" runat="server" EnableViewState="false"> </telerik:RadEditor> </div> </asp:Panel> </telerik:RadAjaxPanel> <div> Standard Button: <asp:Button UseSubmitBehavior="false" ID="Button1" runat="server" OnClick="btnSave_Click" Text="Save" /></div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" /> </Triggers> <ContentTemplate> <div style="margin-top: 10px;"> Image Button: <asp:ImageButton ID="ImageButton2" runat="server" OnClientClick="javascript:__doPostBack(this.id,'');return false;" OnClick="btnSave_Click" ImageUrl="http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/save.gif" /></div> <div style="margin-top: 10px;"> <telerik:RadEditor ID="RadEditor2" runat="server" EnableViewState="false"> </telerik:RadEditor> </div> </ContentTemplate> </asp:UpdatePanel> </form> function openRadWindow(args) { var EmpID = $find("<%=cboEmployee.ClientID %>")._value; window.radopen("AdminDelegationPopup.aspx?EmpID=" + EmpID + "&Type=" + args, "RadWindow1"); } function refreshGrid(arg) { if (arg == 'Delegation') { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Delegation"); // Invoking ajaxRequest } }
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="grdDelegatedRights" /> <telerik:AjaxUpdatedControl ControlID="btnDelegate" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="grdDelegatedRights"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="grdDelegatedRights" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnDelegate"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="grdDelegatedRights" /> <telerik:AjaxUpdatedControl ControlID="btnDelegate" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <asp:GridView ID="grdDelegatedRights" runat="server" AutoGenerateColumns="False" CellPadding="4" Font-Names="Tahoma,Verdana" Font-Size="10px" ForeColor="#333333" Width="825px" AllowPaging="True" DataKeyNames="EmpDelegationId"> <Columns> <asp:BoundField DataField = "EmpName" HeaderText = "Employee Name" /> <asp:BoundField DataField="EmpId" HeaderText="Employee Id" /> <asp:BoundField DataField="FullName" HeaderText="Delegated Employee" /> <asp:BoundField DataField="SecurityRole" HeaderText="Role" /> <asp:BoundField DataField="DateDelegated" HeaderText="Date Delegated" /> <asp:TemplateField ShowHeader="False"> <ItemTemplate> <asp:ImageButton ID="imgRemoveDelegation" runat="server" CausesValidation="False" CommandName="Delete" ImageUrl="~/Images/document_delete_small.gif" OnClientClick="return confirm('Are you sure you want to remove the delegation?');" ToolTip="Remove the delegated rights" /> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> </asp:TemplateField> </Columns> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> <PagerSettings Mode="NumericFirstLast" /> </asp:GridView>
AjaxRequest..I am able to step into the following code succesfully.
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) If e.Argument = "Delegation" Then Dim oDelegation As New Delegation Dim dsDelegatedRights As DataSetdsDelegatedRights = oDelegation.GetDelegatedRights(cboEmployee.SelectedValue)grdDelegatedRights.DataSource = dsDelegatedRights grdDelegatedRights.DataBind() End If End Subthis is on the radwindow.
function CloseAndRebindGrid(args) { GetRadWindow().Close(); GetRadWindow().BrowserWindow.refreshGrid(args); }