| <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> | |
| </asp:Content> | |
| <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> | |
| <%--master--%> | |
| <telerik:RadGrid ID="gvTasksDataSteward" runat="server" AutoGenerateColumns="False" | |
| DataSourceID="dsTasks" GridLines="None" Skin="Office2007"> | |
| <ClientSettings EnablePostBackOnRowClick="true" AllowKeyboardNavigation="True"> | |
| <Selecting AllowRowSelect="true" /> | |
| </ClientSettings> | |
| <MasterTableView DataSourceID="dsTasks" Name="DatastewardTasks" DataKeyNames="TaskId" | |
| AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" | |
| EditMode="PopUp"> | |
| <RowIndicatorColumn Visible="False"> | |
| <HeaderStyle Width="20px"></HeaderStyle> | |
| </RowIndicatorColumn> | |
| <ExpandCollapseColumn Visible="False" Resizable="False"> | |
| <HeaderStyle Width="20px"></HeaderStyle> | |
| </ExpandCollapseColumn> | |
| <Columns> | |
| <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandProject"> | |
| <HeaderStyle Width="20px" /> | |
| </telerik:GridEditCommandColumn> | |
| <telerik:GridBoundColumn DataField="TaskId" HeaderText="TaskId" UniqueName="TaskId" | |
| Visible="false" ReadOnly="true"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company" SortExpression="Company" | |
| UniqueName="Company"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="ProjectName" HeaderText="Project" SortExpression="ProjectName" | |
| UniqueName="ProjectName"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="TaskDescription" HeaderText="TaskDescription" | |
| SortExpression="TaskDescription" UniqueName="TaskDescription"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="Remarks" HeaderText="Remarks" SortExpression="Remarks" | |
| UniqueName="Remarks"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="StartDate" DataType="System.DateTime" HeaderText="StartDate" | |
| SortExpression="StartDate" UniqueName="StartDate" DataFormatString="{0:d}"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="SoortBewerking" HeaderText="SoortBewerking" SortExpression="SoortBewerking" | |
| UniqueName="SoortBewerking"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="RealHours" DataType="System.Decimal" HeaderText="RealHours" | |
| SortExpression="RealHours" UniqueName="RealHours" Visible="false"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="StatusId" UniqueName="StatusId" Visible="false" | |
| ReadOnly="true"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="Accept" Text="Accept" | |
| ImageUrl="~/Images/OK.png" ShowInEditForm="false" CommandName="Accepted"> | |
| </telerik:GridButtonColumn> | |
| <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="NotAccept" Text="Not Accept" | |
| ImageUrl="~/Images/OK.png" ShowInEditForm="false" CommandName="NotAccepted"> | |
| </telerik:GridButtonColumn> | |
| <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="Executed" Text="Executed" | |
| ImageUrl="~/images/11new.gif" ShowInEditForm="false" CommandName="Executed" ConfirmText="Executed?"> | |
| </telerik:GridButtonColumn> | |
| </Columns> | |
| <EditFormSettings CaptionFormatString="Edit: {0}" CaptionDataField="ProjectName"> | |
| <PopUpSettings ScrollBars="Auto"></PopUpSettings> | |
| <EditColumn ButtonType="ImageButton" CancelText="Cancel Edit" UpdateText="Update Task" | |
| InsertText="Insert User" UniqueName="EditCommandColumn"> | |
| </EditColumn> | |
| <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> | |
| </EditFormSettings> | |
| </MasterTableView> | |
| </telerik:RadGrid> | |
| <%--Details--%> | |
| <telerik:RadGrid ID="gvDetails" runat="server" AutoGenerateColumns="False" DataSourceID="dsFiles" | |
| GridLines="None" Skin="Office2007"> | |
| <MasterTableView Name="Details" DataSourceID="dsFiles" DataKeyNames="FileId"> | |
| <RowIndicatorColumn Visible="False"> | |
| <HeaderStyle Width="20px"></HeaderStyle> | |
| </RowIndicatorColumn> | |
| <ExpandCollapseColumn Visible="False" Resizable="False"> | |
| <HeaderStyle Width="20px"></HeaderStyle> | |
| </ExpandCollapseColumn> | |
| <Columns> | |
| <telerik:GridBoundColumn DataField="FileName" HeaderText="FileName" SortExpression="FileName" | |
| UniqueName="FileName"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="ProjectId" DataType="System.Int32" HeaderText="ProjectId" | |
| SortExpression="ProjectId" UniqueName="ProjectId"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="FileId" HeaderText="FileId" SortExpression="FileId" | |
| UniqueName="FileId" Visible="false"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="FileSaveAs" HeaderText="FileSaveAs" SortExpression="FileSaveAs" | |
| UniqueName="FileSaveAs" Visible="false"> | |
| </telerik:GridBoundColumn> | |
| </Columns> | |
| <EditFormSettings> | |
| <PopUpSettings ScrollBars="None"></PopUpSettings> | |
| </EditFormSettings> | |
| </MasterTableView> | |
| <ClientSettings AllowKeyboardNavigation="True" EnablePostBackOnRowClick="True"> | |
| <Selecting AllowRowSelect="true" /> | |
| </ClientSettings> | |
| </telerik:RadGrid> | |
| <asp:SqlDataSource ID="dsTasks" runat="server" ConnectionString="<%$ ConnectionStrings:dsBewerkingenConnectionString %>" | |
| SelectCommand="SELECT tblTasks.ReadyDate, tblTasks.TaskDescription, tblTasks.Remarks, tblTasks.TaskId, tblTasks.StartDate, tblTasks.StatusId, tblTasks.RealHours, tblBewerkingen.SoortBewerking, tblStatusTasks.StatusNam, tblProjects.ProjectName, tblCompany.CompanyName FROM tblTasks INNER JOIN tblStatusTasks ON tblTasks.StatusId = tblStatusTasks.StatusId LEFT OUTER JOIN tblProjects ON tblTasks.ProjectId = tblProjects.ProjectId LEFT OUTER JOIN tblBewerkingen ON tblTasks.BewerkingId = tblBewerkingen.BewerkingId LEFT OUTER JOIN tblCompany ON tblProjects.CompanyId = tblCompany.CompanyId WHERE (tblTasks.StatusId IN (7, 4)) AND (tblTasks.UserId = @UserId)" | |
| DeleteCommand="DELETE FROM [tblTasks] WHERE [TaskId] = @TaskId" InsertCommand="INSERT INTO [tblTasks] ([ProjectId], [BewerkingId], [UserId], [ReadyDate], [TaskDescription], [Remarks], [Date], [StartDate], [EstimatedHours], [RealHours], [NumberArticles], [EstimatedReadyDate], [Status_actief], [StatusId], [DateSendDataSteward]) VALUES (@ProjectId, @BewerkingId, @UserId, @ReadyDate, @TaskDescription, @Remarks, @Date, @StartDate, @EstimatedHours, @RealHours, @NumberArticles, @EstimatedReadyDate, @Status_actief, @StatusId, @DateSendDataSteward)" | |
| UpdateCommand="UPDATE [tblTasks] SET [ReadyDate] = @ReadyDate, [RealHours] = @RealHours, [StatusId] = @StatusId WHERE [TaskId] = @TaskId"> | |
| <SelectParameters> | |
| <asp:SessionParameter DefaultValue="0" Name="UserId" SessionField="UserId" | |
| Type="Int32" /> | |
| </SelectParameters> | |
| <DeleteParameters> | |
| <asp:Parameter Name="TaskId" Type="Int32" /> | |
| </DeleteParameters> | |
| <UpdateParameters> | |
| <asp:Parameter Name="ReadyDate" Type="DateTime" /> | |
| <asp:Parameter Name="RealHours" Type="Decimal" /> | |
| <asp:Parameter Name="StatusId" /> | |
| <asp:Parameter Name="TaskId" /> | |
| </UpdateParameters> | |
| <InsertParameters> | |
| <asp:SessionParameter Name="ProjectId" SessionField="ProjectId" Type="Int32" /> | |
| <asp:Parameter Name="BewerkingId" Type="Int32" /> | |
| <asp:Parameter Name="UserId" Type="Int32" /> | |
| <asp:Parameter Name="ReadyDate" Type="DateTime" /> | |
| <asp:Parameter Name="TaskDescription" Type="String" /> | |
| <asp:Parameter Name="Remarks" Type="String" /> | |
| <asp:Parameter Name="Date" Type="DateTime" /> | |
| <asp:Parameter Name="StartDate" Type="DateTime" /> | |
| <asp:Parameter Name="EstimatedHours" Type="Int32" /> | |
| <asp:Parameter Name="RealHours" Type="Int32" /> | |
| <asp:Parameter Name="NumberArticles" Type="Int64" /> | |
| <asp:Parameter Name="EstimatedReadyDate" Type="DateTime" /> | |
| <asp:Parameter Name="Status_actief" Type="String" /> | |
| <asp:Parameter Name="StatusId" /> | |
| <asp:Parameter Name="DateSendDataSteward" Type="DateTime" /> | |
| </InsertParameters> | |
| </asp:SqlDataSource> | |
| <asp:SqlDataSource ID="dsStatus" runat="server" ConnectionString="<%$ ConnectionStrings:dsBewerkingenConnectionString %>" | |
| SelectCommand="SELECT [StatusId], [StatusNam] FROM [tblStatusTasks]"> | |
| <SelectParameters> | |
| </SelectParameters> | |
| </asp:SqlDataSource> | |
| <asp:SqlDataSource ID="dsFiles" runat="server" ConnectionString="<%$ ConnectionStrings:dsBewerkingenConnectionString %>" | |
| SelectCommand="SELECT tblFiles.FileName, tblFiles.ProjectId, tblFiles.FileSaveAs, tblTasks.TaskId, tblFiles.FileId FROM tblFiles LEFT OUTER JOIN FilesPerTask ON tblFiles.FileId = FilesPerTask.FileId LEFT OUTER JOIN tblTasks ON FilesPerTask.TaskId = tblTasks.TaskId AND tblFiles.ProjectId = tblTasks.ProjectId WHERE (tblTasks.TaskId = @TaskId)"> | |
| <SelectParameters> | |
| <asp:ControlParameter ControlID="gvTasksDataSteward" DefaultValue="0" Name="TaskId" | |
| PropertyName="Selectedvalue" Type="Int32" /> | |
| </SelectParameters> | |
| </asp:SqlDataSource> | |
| </asp:Content> |
| Partial Class ovz_Datasteward | |
| Inherits System.Web.UI.Page | |
| Private Function getItemName(ByVal tableName As String) As String | |
| Select Case tableName | |
| Case ("DatastewardTasks") | |
| Return "DatastewardTasks" | |
| Case ("Details") | |
| Return "Details" | |
| Case Else | |
| Return "" | |
| End Select | |
| End Function | |
| Protected Sub gvDetails_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gvDetails.ItemCommand | |
| If (e.CommandName = "RowClick" AndAlso (e.Item.OwnerTableView.DataSourceID = "dsFiles")) Then | |
| If (TypeOf e.Item Is GridDataItem) Then | |
| e.Item.Selected = True | |
| Dim text As String = "Selected File Id is: " & e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("FileId") | |
| Dim file As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("FileSaveAs") | |
| Dim filename As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("FileName") | |
| Dim ObjSR As FileStream | |
| Dim path As String = System.Configuration.ConfigurationManager.AppSettings("UploadFolder").ToString | |
| Dim fileToDownload As String = path + file | |
| ObjSR = New FileStream(fileToDownload, FileMode.Open, FileAccess.Read) | |
| Dim loc_StreamBuffer(ObjSR.Length) As Byte | |
| ObjSR.Read(loc_StreamBuffer, 0, ObjSR.Length) | |
| ObjSR.Close() | |
| Response.AddHeader("content-disposition", "attachment; filename=" & filename) | |
| Response.BinaryWrite(loc_StreamBuffer) | |
| Response.AppendHeader("Content-Length", loc_StreamBuffer.Length.ToString()) | |
| Response.End() | |
| End If | |
| End If | |
| End Sub | |
| 'Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | |
| ' If Page.IsPostBack = True Then | |
| ' End If | |
| 'End Sub | |
| Protected Sub gvTasksDataSteward_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gvTasksDataSteward.ItemCommand | |
| Dim cmdName As String = e.CommandName | |
| If cmdName = "Executed" Then | |
| Dim Today As Date = Now | |
| Dim dataItem As GridDataItem = CType(e.Item, GridDataItem) | |
| Dim TaskId As Integer = dataItem("TaskId").Text | |
| Dim strSQL As String = _ | |
| "UPDATE tblTasks " & _ | |
| "SET " & _ | |
| "StatusId = @StatusId, " & _ | |
| "ReadyDate = @ReadyDate " & _ | |
| "WHERE TaskId = @TaskId " | |
| Dim Command As New SqlCommand(strSQL) | |
| Command.Parameters.Add(New SqlParameter("@StatusId", SqlDbType.Int)).Value = "5" | |
| Command.Parameters.Add(New SqlParameter("@TaskId", SqlDbType.Int)).Value = TaskId | |
| Command.Parameters.Add(New SqlParameter("@ReadyDate", SqlDbType.DateTime)).Value = Today | |
| DBPortal.Execute(Command) | |
| Else | |
| If cmdName = "NotAccepted" Then | |
| Dim dataItem As GridDataItem = CType(e.Item, GridDataItem) | |
| Dim TaskId As Integer = dataItem("TaskId").Text | |
| Dim strSQL As String = _ | |
| "UPDATE tblTasks " & _ | |
| "SET " & _ | |
| "StatusId = @StatusId " & _ | |
| "WHERE TaskId = @TaskId " | |
| Dim Command As New SqlCommand(strSQL) | |
| Command.Parameters.Add(New SqlParameter("@StatusId", SqlDbType.Int)).Value = "3" | |
| Command.Parameters.Add(New SqlParameter("@TaskId", SqlDbType.Int)).Value = TaskId | |
| DBPortal.Execute(Command) | |
| Else | |
| If cmdName = "Accepted" Then | |
| Dim dataItem As GridDataItem = CType(e.Item, GridDataItem) | |
| Dim TaskId As Integer = dataItem("TaskId").Text | |
| Dim strSQL As String = _ | |
| "UPDATE tblTasks " & _ | |
| "SET " & _ | |
| "StatusId = @StatusId " & _ | |
| "WHERE TaskId = @TaskId " | |
| Dim Command As New SqlCommand(strSQL) | |
| Command.Parameters.Add(New SqlParameter("@StatusId", SqlDbType.Int)).Value = "4" | |
| Command.Parameters.Add(New SqlParameter("@TaskId", SqlDbType.Int)).Value = TaskId | |
| DBPortal.Execute(Command) | |
| End If | |
| End If | |
| End If | |
| If cmdName = RadGrid.EditCommandName Then | |
| End If | |
| gvTasksDataSteward.Rebind() | |
| End Sub | |
| Protected Sub gvTasksDataSteward_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvTasksDataSteward.PreRender | |
| For Each dataItem As GridDataItem In gvTasksDataSteward.Items | |
| 'toont 'accepted' en 'not accepted' en verbergt 'Executed' indien Status 'Scheduled' is | |
| If dataItem("StatusId").Text = "7" Then | |
| Dim Accept As Button = DirectCast(dataItem("Accept").Controls(0), Button) | |
| Dim NotAccept As Button = DirectCast(dataItem("NotAccept").Controls(0), Button) | |
| Dim Executed As Button = DirectCast(dataItem("Executed").Controls(0), Button) | |
| Accept.Visible = True | |
| NotAccept.Visible = True | |
| Executed.Visible = False | |
| End If | |
| 'toont 'Executed' en verbergt 'accepted' en 'not accepted' indien Status 'Scheduled' is | |
| If dataItem("StatusId").Text = "4" Then | |
| Dim Accept As Button = DirectCast(dataItem("Accept").Controls(0), Button) | |
| Dim NotAccept As Button = DirectCast(dataItem("NotAccept").Controls(0), Button) | |
| Dim Executed As Button = DirectCast(dataItem("Executed").Controls(0), Button) | |
| Accept.Visible = False | |
| NotAccept.Visible = False | |
| Executed.Visible = True | |
| End If | |
| Next | |
| End Sub | |
| End Class | |
<
telerik:RadMenu ID="RadMenu1" runat="server" DefaultGroupSettings-OffsetY="-1" EnableEmbeddedSkins="False">
<DefaultGroupSettings OffsetY="-1"></DefaultGroupSettings>
<Items>
<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavCollections_Off.jpg" HoveredImageUrl="~/images/pnavCollections_On.jpg"
NavigateUrl="/Collections.aspx"
SelectedImageUrl="~/images/pnavCollections_On.jpg">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavYourSkin_Off.jpg" HoveredImageUrl="~/images/pnavYourSkin_On.jpg"
NavigateUrl="/Your-Skin.aspx"
SelectedImageUrl="~/images/pnavYourSkin_On.jpg">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavWhyShea_Off.jpg" HoveredImageUrl="~/images/pnavWhyShea_On.jpg"
NavigateUrl="/Why-Shea.aspx"
SelectedImageUrl="~/images/pnavWhyShea_On.jpg">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavFAQ_Off.jpg" HoveredImageUrl="~/images/pnavFAQ_On.jpg"
NavigateUrl="/FAQ.aspx" SelectedImageUrl="~/images/pnavFAQ_On.jpg">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavWheretoBuy_Off.jpg" HoveredImageUrl="~/images/pnavWheretoBuy_On.jpg"
NavigateUrl="/Where-to-Buy.aspx"
SelectedImageUrl="~/images/pnavWheretoBuy_On.jpg">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" ImageUrl="~/images/pnavNewsEvents_Off.jpg" HoveredImageUrl="~/images/pnavNewsEvents_On.jpg"
NavigateUrl="/News-Events.aspx"
SelectedImageUrl="~/images/pnavNewsEvents_On.jpg">
</telerik:RadMenuItem>
</Items>
</
telerik:RadMenu>
| <telerik:Radgrid ID="RadGrid1" (...)> |
| (...) |
| <MasterTableView (...)> |
| <EditFormSettings EditformType="Template"> |
| <FormTemplate> |
| (...) |
| <tr> |
| <td> |
| <span>Couleur: </span> |
| </td> |
| <td> |
| <telerik:RadColorPicker ID="RadColorPicker1" runat="server" Preset="Standard" ShowIcon="true" Skin="Black" PaletteModes="All" SelectedColor='<%# HexStringToColor(myCStr(Bind("Couleur"))) %>'> |
| </telerik:RadColorPicker> |
| </td> |
| </tr> |
| (...) |
| </FormTemplate> |
| </EditFormSettings> |
| </MasterTableView> |
| </RadGrid> |
| Function HexStringToColor(ByVal hex As String) As System.Drawing.Color |
| hex = hex.Replace("#", "") |
| If hex.Length <> 6 Then |
| Throw New Exception(hex & " n'est pas une valeur de couleur hexadecimale valide.") |
| End If |
| Dim r, g, b As String |
| r = hex.Substring(0, 2) |
| g = hex.Substring(2, 2) |
| b = hex.Substring(4, 2) |
| Return System.Drawing.Color.FromArgb(HexStringToBase10Int(r), HexStringToBase10Int(g), HexStringToBase10Int(b)) |
| End Function |
| Function HexStringToBase10Int(ByVal hex As String) As Integer |
| Dim base10value As Integer = 0 |
| Try |
| base10value = System.Convert.ToInt32(hex, 16) |
| Catch ex As Exception |
| base10value = 0 |
| End Try |
| Return base10value |
| End Function |
| Function myCStr(ByVal test As Object) As String |
| If isdbnull(test) Then |
| Return ("#ffffff") |
| Else |
| Return CStr(test) |
| End If |
| End Function |
| SelectedColor='<%# HexStringToColor(myCStr(Eval("Couleur"))) %>' |
<
body>
<div class="pagediv">
</div></body>
.pagediv
{
width: 950px;
top: 10px;
margin:0 auto 0;
}

Greetings,
Sorry about the question title. It should read:
"Using 'pasteHtml' to capture the value of an external input button"
I found the following code here on site with the associated title:
The following example will show you how to paste content into the editor's content area from an external input button:
-----------------------------------------------------------------------------------------------------------------------------
<telerik:radeditor runat="server" ID="RadEditor1"></telerik:radeditor>
<input type="button" value="Paste Content" onclick="InsertSpan();return false;" />
<script type="text/javascript">
function InsertSpan()
{
var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to the editor
editor.pasteHtml('<span style="width:100px;border: 1px solid red;background-color: blue;color: white;">sample content</span>');
}
</script>
-----------------------------------------------------------------------------------------------------------------------------
Can anybody explain to me how this does _anything_ with a value outside the RadEditor. Seems to me there is a very necessary piece left out of the example. For instance, when using 'OnClientCommandExecuting(editor, args)' to do this kind of thing 'within' the editor, the args parameter is used to produce the value of 'val':
var val = args.get_value();
editor.pasteHtml("<div style='width:100px;background-color:#fafafa;border:1px dashed #aaaaaa;'>" + val + "</div>");
As we can see, the code provided for the external input doesn't come close to addressing how to handle the outside value.
Am I missing something here??
Thanks!

| Protected Sub RadScheduler1_FormCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated |
| Dim CB_Groupe As RadComboBox = TryCast(e.Container.FindControl("CB_Groupe"), RadComboBox) |
| Dim CB_Forfait As RadComboBox = TryCast(e.Container.FindControl("CB_Forfait"), RadComboBox) |
| CB_Forfait.Items.Add(New Telerik.Web.UI.RadComboBoxItem(CB_Groupe.SelectedValue)) |
| CB_Groupe.AutoPostBack = True |
| AddHandler CB_Groupe.SelectedIndexChanged, AddressOf CB_Groupe_SelectedIndexChanged |
| End Sub |
| Protected Sub CB_Groupe_SelectedIndexChanged(ByVal o As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs) |
| Lbl_titre.Text = "j'ai changé" |
| End Sub |
If
Me.RadComboBox1.Attributes.Item("TreeviewSelectedItem") Is Nothing Then
If objuser.DivisionTwo <> 0 Then
Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.DivisionTwoDesc)
ElseIf objuser.DivisionOne <> 0 Then
Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.DivisionOneDesc)
ElseIf objuser.PearsonBusiness <> 0 Then
Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.PearsonBusinessDesc)
Else
Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", "Please select a division")
End If
End If
this works and does preload the correct demographic in the combobox, but problem is when you press 'save' again and havent changed the combo box when it goes to save the demos if have this code to get the chosen id
Dim NewRadTreeDivisions As Telerik.Web.UI.RadTreeView
Dim DivisionValue As Integer
NewRadTreeDivisions = RadComboBox1.Items(0).FindControl(
"RadTreeView1")
If NewRadTreeDivisions.SelectedValue = "" Then
DivisionValue = 0
Else
DivisionValue = NewRadTreeDivisions.SelectedValue
End If
but now at this point NewRadTreeDivisions.SelectedValue does equal "" therefore sets it back to 0. even though the correct text is shown in the box the value isnt being passed through...how can i get this to keep the id???
thank you!