<telerik:RadGrid ID="dgCompNonGrid" GridLines="None" runat="server" AllowAutomaticDeletes="True"
AllowAutomaticInserts="True" PageSize="40" Skin="Default" OnItemDeleted="dgCompNonGrid_ItemDeleted" OnItemInserted="dgCompNonGrid_ItemInserted"
OnItemUpdated="dgCompNonGrid_ItemUpdated" AllowAutomaticUpdates="True" AllowPaging="False"
AutoGenerateColumns="False" Width="440px" OnBatchEditCommand="dgCompNonGrid_BatchEditCommand" Height="230px">
<ExportSettings>
<Pdf>
<PageHeader>
<LeftCell Text="" />
<MiddleCell Text="" />
<RightCell Text="" />
</PageHeader>
<PageFooter>
<LeftCell Text="" />
<MiddleCell Text="" />
<RightCell Text="" />
</PageFooter>
</Pdf>
</ExportSettings>
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView AllowNaturalSort="False" EditMode="Batch" BatchEditingSettings-OpenEditingEvent ="DblClick">
<BatchEditingSettings EditType="Cell" />
<CommandItemSettings ExportToPdfText="Export to PDF" />
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
</ExpandCollapseColumn>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
<PagerStyle PageSizeControlType="RadComboBox" />
</MasterTableView>
<MultiHeaderItemStyle Wrap="False" />
<ItemStyle Wrap="False" />
<PagerStyle PageSizeControlType="RadComboBox" />
<FilterMenu EnableImageSprites="False">
</FilterMenu>
</telerik:RadGrid>
CODE==================================================================================
With dgCompNonGrid
.Columns.Clear()
.DataSource = Nothing
.DataSource = ippService.SelectPlanComponentsDetails(iCompID)
End With
Dim boundColumn As GridBoundColumn
boundColumn = New GridBoundColumn()
dgCompNonGrid.MasterTableView.Columns.Add(boundColumn)
boundColumn.DataField = "ippComponentID"
boundColumn.UniqueName = "dgippComponentID"
boundColumn.Display = False
boundColumn.HeaderText = ""
boundColumn.ItemStyle.Font.Size = 8
boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left
boundColumn.ReadOnly = True
boundColumn = New GridBoundColumn()
dgCompNonGrid.MasterTableView.Columns.Add(boundColumn)
boundColumn.DataField = "ippComponentSeq"
boundColumn.UniqueName = "dgippComponentSeq"
boundColumn.Display = False
boundColumn.HeaderText = ""
boundColumn.ItemStyle.Font.Size = 8
boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left
boundColumn = New GridBoundColumn()
dgCompNonGrid.MasterTableView.Columns.Add(boundColumn)
boundColumn.DataField = "ippComponentSrcValue"
boundColumn.UniqueName = "dgippComponentSrcValue"
boundColumn.Display = True
boundColumn.HeaderText = "Value"
boundColumn.ItemStyle.Font.Size = 8
boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left
boundColumn = New GridBoundColumn()
dgCompNonGrid.MasterTableView.Columns.Add(boundColumn)
boundColumn.DataField = "ippComponentBonusPct"
boundColumn.UniqueName = "dgippComponentBonusPct"
boundColumn.Display = True
boundColumn.HeaderText = "Bonus %"
boundColumn.ItemStyle.Font.Size = 8
boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left
Dim oDeleteColumn As New GridButtonColumn
With oDeleteColumn
.UniqueName = "Delete"
.HeaderText = "Remove"
.ItemStyle.Font.Size = 8
.ButtonType = GridButtonColumnType.ImageButton
.ImageUrl = "~/Images/style7/cancel.gif"
.Display = True
.Visible = True
.CommandName = "Delete"
.ConfirmText = "Delete this increment?"
.ConfirmDialogType = GridConfirmDialogType.RadWindow
.ItemStyle.HorizontalAlign = HorizontalAlign.Left
End With
dgCompNonGrid.MasterTableView.Columns.Add(oDeleteColumn)
dgCompNonGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top
| function ToggleDatePicker(enable) | |
| { | |
| var DatePicker = $find('<%= StartDate.ClientID %>'); | |
| if (!enable) | |
| { | |
| DatePicker.get_dateInput().disable(); | |
| DatePicker.get_popupButton().onclick = null; | |
| } | |
| else | |
| { | |
| DatePicker.get_dateInput().enable(); | |
| DatePicker.get_popupButton().onclick = function() { DatePicker.togglePopup(); return false; }; | |
| } | |
| } |



jQuery.noConflict(); function pageLoad(sender, args) { jQuery(document).ready(function ($) { var title; var col, row, preCol, preRow; // set the element draggable (WebUserControl) $(".drag").draggable({ drag: function (event, ui) { title = this.title; } }); // set the element droppable (each cells of RadGrid but not on the first column $(".drop2").droppable({ drop: function (event, ui) { col = $(this).parent().children().index($(this)); row = $(this).parent().parent().children().index($(this).parent()); dropped(); alert('Ligne: ' + row + ', Colonne: ' + col); } }); // AjaxRequest with cell indexes and control's id <== title property function dropped() { $find('<%= RadAjaxManager1.ClientID%>').ajaxRequest("Drop;" + title + ";" + col + ";" + row); } }); }public partial class WebForm2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // Create a List of half day for the next 3 months List<string> Montableau = new List<string>(); DateTime monHeure = DateTime.Now.AddDays(-1).AddHours(-DateTime.Now.Hour).AddMinutes(-DateTime.Now.Minute).AddSeconds(-DateTime.Now.Second).AddMilliseconds(-DateTime.Now.Millisecond); while (monHeure < DateTime.Now.AddMonths(3)) { Montableau.Add(monHeure.ToShortDateString() + " " + monHeure.ToShortTimeString()); monHeure = monHeure.AddHours(12); } RadGrid1.DataSource = Montableau; RadGrid1.DataBind(); for (int i = 0; i < Montableau.Count; i++) { RadGrid1.Items[i].Cells[2].Text = Montableau[i]; RadGrid1.Items[i].Cells[3].Text = ""; RadGrid1.Items[i].Cells[4].Text = ""; RadGrid1.Items[i].Cells[5].Text = ""; } // Creating 2 WebUserControl dynamically WebUserControl1 ctrl = (WebUserControl1)LoadControl("~/WebUserControl1.ascx"); ctrl.idControl = "wuc9"; ctrl.ID = "wuc9"; ctrl.numeroAffaire = "9"; ctrl.leSite = "Test"; ctrl.idControl = ctrl.ID; ctrl.couleurFond = Color.Aqua; Panel2.Controls.Add(ctrl); WebUserControl1 ctrl2 = (WebUserControl1)LoadControl("~/WebUserControl1.ascx"); ctrl2.idControl = "wuc10"; ctrl2.ID = "wuc10"; ctrl2.numeroAffaire = "10"; ctrl2.leSite = "Test"; ctrl2.idControl = ctrl2.ID; ctrl2.couleurFond = Color.Lime; Panel2.Controls.Add(ctrl2); } protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) { if (e.Argument.StartsWith("Drop")) { string[] mesArg = e.Argument.Split(';'); // Search the control with the id (title attributes) WebUserControl1 user = this.FindControl(mesArg[1]) as WebUserControl1; // Search the RadGrid RadGrid rg = (RadGrid)FindControl("RadGrid1"); if (rg != null) { // Add control in the correct cell if (rg.Items[int.Parse(mesArg[3])].Cells[int.Parse(mesArg[2]) + 2].Controls.Count == 0) { rg.Items[int.Parse(mesArg[3])].Cells[int.Parse(mesArg[2]) + 2].Controls.Add(user); } else { RadAjaxManager1.Alert("Cette case contient deja un control"); } } UpdatePanel1.Update(); } } }