How to get the RichTextBox’s unformatted text?
You can get the unformatted text in the RichTextBox using this approach RichTextBox rtb = richTextBox as RichTextBox; TextRange tr = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
What are the data sources I can bind the ComboBox’s list to?
The ComboBox, like the other ItemsControl can be bound to any IList, ObservableCollection or ObjectDataProvider (containing a list type data) as explained in this MSDN topic: ItemsControl Content Model Overview If bound to an ObservableCollection, changes happening in the collection will automatically reflect in the ComboBox. You can also bind to XML Data using an XMLDataProvider as explained in this topic: How to: Bind to XML Data Using an XMLDataProvider and XPath Queries Bind the ComboBox to a CollectionViewSource to be able to bind to sorted or grouped views of your list. CollectionViewSource Class You can also bind to a DataTable in an ADO.NET DataSet as follows: How to: Bind to an ADO.NET Data Source
What are the data sources I can bind the ListBox to?
The ListBox, like the other ItemsControl can be bound to any IList, ObservableCollection or ObjectDataProvider (containing a list type data) as explained in this MSDN topic: ItemsControl Content Model Overview If bound to an ObservableCollection, changes happening in the collection will automatically reflect in the ListBox. You can also bind to XML Data using an XMLDataProvider as explained in this topic: How to: Bind to XML Data Using an XMLDataProvider and XPath Queries Bind the ListBox to a CollectionViewSource to be able to bind to sorted or grouped views of your list. CollectionViewSource Class You can also bind to a DataTable in an ADO.NET DataSet as follows: How to: Bind to an ADO.NET Data Source
How to select a value from a child form and send it to parent form
page1.aspx <asp:TextBox id=’txtSelect’ style=’Z-INDEX: 101; LEFT: 186px; POSITION: absolute; TOP: 19px’ runat=’server’></asp:TextBox> <a href=’javascript:my_window = window.open(’page2.aspx?formname=Form1.txtSelect’ , ’my_window’,’width=300,height=300’); my_window.focus()’> Select CategoryName</a> page2.aspx <asp:DropDownList id=’DropDownList1′ style=’Z-INDEX: 101; LEFT: 180px; POSITION: absolute; TOP: 66px’ runat=’server’ AutoPostBack=’True’> <asp:Label id=’Label1′ style=’Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 66px’ runat=’server’>Select Category Name <asp:Literal id=’Literal1′ runat=’server’> VB.NET Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ’Put user code to initialize the page here If Not Page.IsPostBack Then ’Fill DataSet …. DropDownList1.DataSource = ds.Tables(0) DropDownList1.DataTextField = ‘CategoryName’ DropDownList1.DataValueField = ‘CategoryId’ DropDownList1.DataBind() End If End Sub Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged Try Dim strjscript As String = ‘<script language=”javascript”>’ strjscript = strjscript & ‘window.opener.’ & HttpContext.Current.Request.QueryString(‘formname’) & ‘.value = ’’ & DropDownList1.SelectedItem.Text & ‘’;window.close();’ strjscript = strjscript & ‘</script>’ Literal1.Text = strjscript Catch ex As Exception Response.Write(ex.Message) End Try End Sub C# private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if (!Page.IsPostBack ) { //Fill DataSet DropDownList1.DataSource = ds.Tables[0]; DropDownList1.DataTextField = ‘CategoryName’; DropDownList1.DataValueField = ‘CategoryId’; DropDownList1.DataBind(); } } private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e) { try { string strjscript = @'<script language=”javascript”>’; strjscript = strjscript + ‘window.opener.’ + HttpContext.Current.Request.QueryString[‘formname’].ToString () + ‘.value = ’’ + DropDownList1.SelectedItem.Text + ‘’;window.close();’; strjscript = strjscript + ‘</script>’; Literal1.Text = strjscript; } catch(Exception ex) { Response.Write (ex.Message ); } }
How do I load a Window from a XAML file dynamically?
You can load a xaml file dynamically as follows: [C#] // This file should then be next to the exe. If not specify a relative path. FileStream xamlFile = new FileStream(‘ChartWindow.xaml’, FileMode.Open, FileAccess.Read); Window win = XamlReader.Load(xamlFile) as Window; win.Show(); Note that any code-behind associated with the above xaml will not be loaded/processed. In case, you have an assembly reference to a custom dll in the above xaml file, you should reference that assembly with a fully qualified namespace as follows: [XAML] xmlns:syncfusion=’clr-namespace:Syncfusion.Windows.Chart;assembly=Syncfusion.Chart.WPF,Version=6.303.0.6,Culture=neutral,PublicKeyToken=3d67ed1f87d44c89′ The above assembly should then be present in the GAC for the runtime to find it.