I am looking for a simple drag and drop solution from one radgrid that simply has a ssn and name to antoher grid that has positions that personnel can fill. When I drag from the personnel grid to the position it automatically updates the radgrid with that person whom was droped in and fills it. I was trying to use example on the site but they use a lot of datasource objects I cannot use, mine is straight code behind. this is what I ahve so far but the drop is not working to the other radgrid. I guess I am not getting the Id of the row I am draggging and I need to get the Id of where I drop it to save to the database. Here is what I have what do i need to add or do differently.
<table width="100%">
<tr>
<td align="center" valign="top">
<telerik:RadGrid ID="myGridPersonnel" runat="server" Width="100%" BorderWidth="1px" CellPadding="6" GridLines="None" BorderColor="#404040" Skin="Web20">
<ClientSettings AllowRowsDragDrop="true">
<Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="false" DataKeyNames="SSN_SM" GridLines="Both" BorderWidth="1px"
BorderColor="#404040" Font-Size="12" Font-Names="Veranda,arial,sans-serif" HeaderStyle-HorizontalAlign="Center">
<AlternatingItemStyle BackColor="#B0C4DE" />
<HeaderStyle ForeColor="White" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
<Columns>
<telerik:GridBoundColumn DataField="Name" HeaderText="NAME" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
</td>
<td align="center" valign="top">
<telerik:RadGrid ID="myGridPositions" runat="server" Width="100%" BorderWidth="1px" CellPadding="6" GridLines="None" BorderColor="#404040" Skin="Web20">
<ClientSettings AllowRowsDragDrop="true">
<Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="false" DataKeyNames="intPositionId" GridLines="Both" BorderWidth="1px"
BorderColor="#404040" Font-Size="12" Font-Names="Veranda,arial,sans-serif" HeaderStyle-HorizontalAlign="Center">
<AlternatingItemStyle BackColor="#B0C4DE" />
<HeaderStyle ForeColor="White" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
<Columns>
<telerik:GridBoundColumn DataField="strPosnTitle" HeaderText="TITLE" />
<telerik:GridBoundColumn DataField="strpara" HeaderText="PARA" />
<telerik:GridBoundColumn DataField="strLine" HeaderText="LINE" />
<telerik:GridBoundColumn DataField="intPositionNum" HeaderText="POSITION" />
<telerik:GridBoundColumn DataField="strGrade" HeaderText="GRADE" />
<telerik:GridBoundColumn DataField="strMos" HeaderText="MOS" />
<telerik:GridBoundColumn DataField="strFullName" HeaderText="Filled By" />
<telerik:GridTemplateColumn HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton ID="Delete" runat="server" CommandArgument='<%# bind("intPositionId") %>' CommandName="Del">Delete</asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</td>
</tr>
</table>
Protected Sub myGridPersonnel_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles myGridSoldier.RowDrop
If String.IsNullOrEmpty(e.HtmlElement) Then
If e.DraggedItems(0).OwnerGridID = myGridSoldier.ClientID Then
Dim destinationIndex As Int32 = -1
For Each dragged As GridDataItem In e.DraggedItems
Dim SSN As String = DirectCast(dragged.GetDataKeyValue("strssn"), String)
If SSN IsNot Nothing Then
If destinationIndex > -1 Then
If e.DropPosition = GridItemDropPosition.Below Then
destinationIndex += 1
End If
sql = "Insert tblMobUnitPersonnel (intpositionId, strssn) Values (45, " & SSN & ")"
Response.Write(sql)
Response.End()
insertUpdateDelete(sql)
Else
End If
End If
Next
End If
End If
End Sub
I
have an application, where i have used RadEditor inside a page with
uses master page, i have kept a button for export to PDF, the event
fires when i click the button , but nothing happens on screen , but
when i remove master page the code works like a charm.
<
asp:Button
ID
=
"ExportToPDFButton"
runat
=
"server"
Text
=
"Export to PDF"
OnClick
=
"ExportToPDFButton_Click"
/>
<
telerik:RadEditor
ID
=
"ContentEditor"
runat
=
"server"
ContentFilters
=
"DefaultFilters,PdfExportFilter"
Width
=
"100%"
>
<
ExportSettings
OpenInNewWindow
=
"true"
/>
<
Content
></
Content
>
</
telerik:RadEditor
>
protected
void
ExportToPDFButton_Click(
object
sender, EventArgs e)
{
ContentEditor.ExportToPdf();
}
<
td
width
=
"10%"
>
<
asp:TextBox
ID
=
"ProductID"
MaxLength
=
"7"
Width
=
"200 px"
Visible='<% # (Container as GridItem).OwnerTableView.IsItemInserted %>' runat="server">
</
asp:TextBox
>
</
td
>
<
td
width
=
"75%"
>
<
asp:Button
ID
=
"btnBrowse"
runat
=
"server"
Text
=
"..."
OnClientClick
=
"popUp('SelectProduct');return false;"
/>
</
td
>
i am running into a problem of returning a server side popup. here's my situation
1. I am having a grid with a edit command column as
<telerik:GridEditCommandColumn UniqueName="actions" EditText="Go" ButtonType="PushButton">
</telerik:GridEditCommandColumn>
2. the editform settings are
<EditFormSettings PopUpSettings-Modal="true" InsertCaption="Actions" EditFormType="Template">
<FormTemplate>
<Action:actions ID="something" runat="server" />
</FormTemplate>
</EditFormSettings>
3. on the click of of the go button the popup displays a user control
4. on the user control i am displaying a list of link buttons ( can use any of the buttons rad or asp)
5. on the click of the link on the popup i want to navigate to a url built on the code behind for each button.
prior to navigating to the url, i have to check if the some variables are valid or not for e.g.
if(x is true)
ask user a (some custom message as: this is the situation want to continue)
if user say yes navigate to the url otherwise do nothing or close the edit form popup.
the message is different for each linkbutton on the page.
I have tried few things nothing seems to be working (frustrated)
on the onclick of the link button, in the code behind:
1. tried using the scriptmanager in code behind as and call the confirmation method by passing in the messga parameter
string messgae = "some messagae"
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "confirm", "confirmation('&message&')", true);
this returns object not defined errorsonce the link is clicked
2. tried
string message = "so ethnugsa";
Page.ClientScript.RegisterStartupScript(this.GetType(), "radConfirm", "radConfirm('"message"', 200,200);", true);
not displaying any popup???? and am not sure even if it displays how would i be restricting the user to not navigate on cancel or No click on the popup.
helppppppp