nopCommTopic.Items.Clear()
RCBI =
New RadComboBoxItem()
RCBI.Text =
"Select a topic..." & ",0"
RCBI.Value = 0
RCBI.Selected =
True
nopCommTopic.Items.Add(RCBI)
For Each Nop_Topic_Data In Nop_Topic_Arry
RCBI =
New RadComboBoxItem()
RCBI.Text = Nop_Topic_Data.Name &
", " & Nop_Topic_Data.TopicID.ToString
RCBI.Value = Nop_Topic_Data.TopicID
nopCommTopic.Items.Add(RCBI)
Next
===============================================================================
The page contains a button for execution after the user selects an item from the above combo box. After the button is clicked, the code retrieves the selected value from the combo box and then continues processing. The problem is that the selected value test (see code immediately below) always gets a 0 for the selectedvalue no matter which item in the combo box is selected. It also does not matter how many different entries in the combo box that you select before pressing the processing button.
The .aspx page code for the combo is shown further below. It's pretty simple.
===============================================================================
button click event code:
' Verify that the user did select a topic to translate and save it if they did
Dim iTopic As Integer = 0
If Me.nopCommTopic.SelectedValue = 0 Then
Me.PageErrors.Text = "You must select a topic to translate from the list!"
Exit Sub
End If
iTopic = nopCommTopic.SelectedValue
===============================================================================
===============================================================================
related code from .aspx page:
<
telerik:RadComboBox ID="nopCommTopic" Skin="NeoClassic" EnableEmbeddedSkins="false" runat="server"></telerik:RadComboBox>
<br />
<br />
<asp:Button ID="TranslateTopic" runat="server" Text="Translate Selected Topic" />
===============================================================================
Can you help me figure out what is wrong?
Thanks in advance! I feel so stupid, but I cannot figure this out. I must be missing something really basic!
Lynn
Hi,
I want display all image after upload, i like use upload silverlight . All step:
1- Upload
2- Generate thumbnail (now for testing, i just do copy to new file with prefix aa_)
3- Display all thumbnail.
I have a problem at step 3. the last thumbnail not display, i have to right click --> choose 'show picture'.
#aspx
| <telerik:RadPane ID="RadPane2" runat="server" Width="300" BorderWidth="3" BorderColor="ActiveBorder"> |
| <input type="hidden" runat="server" id="UploadedFilesJson" /> |
| <center> |
| <object data="data:application/x-silverlight," type="application/x-silverlight-2" width="280" height="120" > |
| <param name="source" value='<%= ResolveUrl("~/Upload.xap") %>'/> |
| <param name="onerror" value="onSilverlightError" /> |
| <param name="background" value="white" /> |
| <param name="minRuntimeVersion" value="2.0.31005.0" /> |
| <param name="windowless" value="true" /> |
| <param name="autoUpgrade" value="true" /> |
| <param name="InitParams" value='<%= InitParameters %>' /> |
| <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"> |
| <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/> |
| </a> |
| </object> |
| </center> |
| <div id="uploaded-files"> |
| </div> |
| </telerik:RadPane> |
#Script in aspx
| <script type="text/javascript"> |
| var $ = $telerik.$; |
| var uploadInProgress; |
| var uploadedFiles = new Array(); |
| function updateHiddenField() { |
| var json = Sys.Serialization.JavaScriptSerializer.serialize(uploadedFiles); |
| $get('UploadedFilesJson').value = json; |
| } |
| // Fired when a file is uploaded |
| function onClientFileUploaded(json) { |
| var uploadedFile = Sys.Serialization.JavaScriptSerializer.deserialize(json); |
| var A = $("<img />") |
| .attr("src", '<%= ResolveUrl(TargetFolder) %>' + uploadedFile.FileName) |
| .load(function(e) { PageMethods.CreateThumbNail(uploadedFile.FileName); }) |
| ; |
| Array.add(uploadedFiles, uploadedFile); |
| } |
| //Called when all files are uploaded |
| function onClientUploadFinished() { |
| updateHiddenField(); |
| var image; var deleteFile; var html=""; |
| for (var i = 0; i < uploadedFiles.length; i++) { |
| image = '<%= ResolveUrl(TargetFolder) %>aa_' + uploadedFiles[i].FileName |
| html += "<img id='img_"+i.toString()+"' width='150px' src='" + image + "' /><br/>"; |
| var aa = document.getElementById("uploaded-files"); |
| } |
| aa.innerHTML = html; |
| } |
| </script> |
| protected string InitParameters |
| { |
| get |
| { |
| List<string> uploadConfig = new List<string>(); |
| uploadConfig.Add("UploadServiceUrl=" + ResolveUrl("~/RadUploadHandler.ashx")); |
| uploadConfig.Add("TargetFolder=" + ResolveUrl(TargetFolder)); |
| uploadConfig.Add("AllowedExtensions=" + "Image Files(*.gif;*.jpg;*.jpeg;*.png)"); |
| uploadConfig.Add("OverwriteExistingFiles=" + true); |
| uploadConfig.Add("IsAutomaticUpload=" + true); |
| uploadConfig.Add("OnClientFileUploaded=" + "onClientFileUploaded"); |
| //Name of the JavaScript function that will be called when all files are uploaded. |
| uploadConfig.Add("OnClientFilesUploadFinished=" + "onClientUploadFinished"); |
| return String.Join(",", uploadConfig.ToArray()); |
| } |
| } |
| private void PopulateUploadedFilesList() |
| { |
| if (!string.IsNullOrEmpty(UploadedFilesJson.Value)) |
| { |
| DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List<UploadedFileInfo>)); |
| UploadedFiles = (List<UploadedFileInfo>)serializer.ReadObject(new MemoryStream(Encoding.UTF8.GetBytes(UploadedFilesJson.Value))); |
| UploadedFilesJson.Value = string.Empty; |
| } |
| } |
| [WebMethod] |
| public static void DeleteFile(string fileName) |
| { |
| string uploadFolder = HttpContext.Current.Request.MapPath(TargetFolder); |
| File.Delete(Path.Combine(uploadFolder, fileName)); |
| } |
| [WebMethod] |
| public static void CreateThumbNail(string fileName) |
| { |
| string uploadFolder = HttpContext.Current.Request.MapPath(TargetFolder); |
| string pathImg = Path.Combine(uploadFolder, fileName); |
| File.Copy(Path.Combine(uploadFolder, fileName), Path.Combine(uploadFolder, "aa_" +fileName)); |
| // |
| } |
| Hello, i think i've tried just about every option i can find to Collapse the ChildNodes of the Level==0 parent i suspect that is has something to do with the fact that i'm not actually using the " e " in e.Nodes.... to try and do the actual process but i'm trying to use the actual RadTreeView ID collection itself, but the reason i'm doing that is because i want to Collapse all of the Level 0 AAAA node when i then select the Level 0 BBBB node for instance, so if i tried to use the " e " value i would be pointing to the BBBB node which i what i want to expand, but before i expand it, i want to Collapse the AAAA node just for example. thanks for any ideas or suggestins! protected void trvDB2_NodeExpand(object sender, RadTreeNodeEventArgs e) |
| { |
| foreach (RadTreeNode rtn in trvDB2.Nodes) |
| { |
| if (rtn.Level == 0 && !e.Node.Text.Equals(rtn.Text)) |
| { |
| int rntnc = rtn.Nodes.Count; |
| //Nodes ns = rtn.Nodes.Remove(); |
| //for (int index = rtn.Nodes.Count - 1; index >= 0; index--) |
| for (int index = rtn.Nodes.Count - 1; index >= 0; index--) |
| { |
| //string rtnrtntxt0 = rtn.Nodes[index].Text; |
| //if (rtn.Nodes[index].Level==1) |
| //{ |
| // //string rtnrtntxt = rtn.Text; |
| // //string rntnit = rtn.Nodes[index].Text; |
| // rtn.Nodes.Clear(); |
| // //rtn.Nodes[index] |
| // //rtn.Nodes[index]; |
| // //rtn.Nodes |
| //} |
| } |
| //string x = rtn.Text; |
| //IEnumerator ie = rtn.Nodes.GetEnumerator(); |
| //while (ie.MoveNext()) |
| //{ |
| // ((RadTreeNode)(ie.Current)).Nodes.Clear(); |
| //} |
| //foreach (RadTreeNode rtn2 in rtn.Nodes) |
| //{ |
| // //string r = rtn |
| // //rtn2.Nodes.Clear(); |
| // //rtn2.c |
| // //rtn2.Nodes.Clear(); |
| // //rtn.Nodes.Remove(rtn2); |
| //} |
| //rtn.Nodes.Remove(); |
| //rtn.CollapseChildNodes(); |
| //rtn.CollapseParentNodes(); |
| } |
| } |
| for (int index = trvDB2.CheckedNodes.Count - 1; index >= 0; index--) |
| { |
| //trvDB2.CheckedNodes[index].Checked = false; |
| } |
| for (int index = trvDB2.Nodes.Count - 1; index >= 0; index--) |
| { |
| string trvnodetxt = trvDB2.Nodes[index].Text; |
| if (trvDB2.Nodes[index].Level == 0 && !e.Node.Text.Equals(trvnodetxt)) |
| { |
| trvDB2.Nodes[index].CollapseChildNodes(); |
| trvDB2.Nodes[index].Nodes.Clear(); |
| trvDB2.Nodes[index].Remove(); |
| } |
| } |
| //e.Node.CollapseChildNodes(); |
| //e.Node.CollapseParentNodes(); |
| //PopulateNodeOnDemand(e, TreeNodeExpandMode.ServerSideCallBack); |
| } |
Telerik.Web.UI.XmlSchedulerProvider
to look after its bookings/appointments. This works well in that the provider handles all the inserts/updates/deletes for me.
I do, however, have a need to send a notification email to the Admin when new appointments get inserted or updated. In this email I want to provide a link to the scheduler, passing the appointment ID in the QueryString so that the appointment in question can be highlighted. This all works great for updates, as the ID is available in the
RadScheduler1_AppointmentUpdate
Method in the e.Appointment.ID property.
The same cannot be said for
RadScheduler1_AppointmentInsert
as the ID is null - I suppose the insert of the xmlProvider has not happened yet.
So my question is, at what point/event can I obtain the ID of the newly created Appointment?
Thanks for any help.
Steele.
Hello,
When I create nodes I have a problem. I have a list:
e.g.:
| class Liste |
| { |
| public string pfad; |
| public Liste(string pfad) |
| { |
| this.pfad = pfad; |
| } |
| } |
| .... |
| if (!IsPostBack) |
| { |
| LadeWerte(); |
| ZeigeTreeView(); |
| } |
| ..... |
| private void LadeWerte() |
| { |
| liste.Add(new Liste("c:\\dateien\\nord\\stad_nord")); |
| liste.Add(new Liste("c:\\dateien\\stad_test")); |
| liste.Add(new Liste("c:\\dateien\\nord\\stad_sued")); |
| } |
| private void ZeigeTreeView() |
| { |
| RadTreeNode rtn = new RadTreeNode("Layouts", "rootfolder"); |
| foreach (Liste list in liste) |
| { |
| Rekursiv(rtn, list.pfad); |
| } |
| RadTreeView1.Nodes.Add(rtn); |
| } |
| private void Rekursiv(RadTreeNode node, string newnode) |
| { |
| if (newnode != "") |
| { |
| RadTreeNode rtn2 = new RadTreeNode(); |
| string substr = ""; |
| if (newnode.LastIndexOf("\\") > 0) |
| substr = newnode.Substring(0, newnode.IndexOf("\\")); |
| else |
| substr = newnode; |
| rtn2.Text = substr; |
| rtn2.Value = "Folder"; |
| string nextnode = ""; |
| if (newnode.IndexOf("\\") > 0) |
| { |
| nextnode = newnode.Substring(newnode.IndexOf("\\") + 1); |
| Rekursiv(rtn2, nextnode); |
| } |
| node.Nodes.Add(rtn2); |
| } |
| } |