Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7309145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:41:10+00:00 2026-05-28T23:41:10+00:00

I have select statement which shows selected items in datagrid. cmdSel.CommandText = select id,Name,TypeID,StatusID

  • 0

I have select statement which shows selected items in datagrid.

cmdSel.CommandText = "select id,Name,TypeID,StatusID from document where Contains([Context],'FormsOf (INFLECTIONAL, \"" + TextBoxSearch.Text + "\")')";

.

<WpfToolkit:DataGrid IsTextSearchEnabled="True" IsReadOnly="True" CanUserSortColumns="True" AutoGenerateColumns="False" Name="DataGrid1" 
                     ItemsSource="{Binding Path=MainSearchBinding}" SelectionChanged="DataGrid1_SelectionChanged">              
    <WpfToolkit:DataGrid.Columns>
        <WpfToolkit:DataGridTextColumn Header="Номер" Width="63" Binding="{Binding id}" IsReadOnly="false" />
        <WpfToolkit:DataGridTextColumn Header="Название" Width="*" Binding="{Binding Name}" IsReadOnly="false" />
    </WpfToolkit:DataGrid.Columns>

I have another user control with richtextbox. And I want to show that specific data on richtextbox by clicking on datas in datagrid.

I tried what I found here, it did not help me. Please give me direction. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T23:41:13+00:00Added an answer on May 28, 2026 at 11:41 pm

    He is my answer for my question, somebody may need. Firstly on mouse click I am looking for id and then selecting Context depending on that ID, here is code

     private void OnMouseClick(object sender, MouseButtonEventArgs e)
            {
    
    
                IList rows = DataGrid1.SelectedItems;
                DataRowView row = (DataRowView)DataGrid1.SelectedItems[0];
                int a = (int)row["ID"];//It is returning the id of selected row
    
                DocumentView docview = new DocumentView();
    
                commProc = new SqlCommand("SELECT Context from Document where ID='" + a + "'", MainWindow.conn);//Depending on ID I am selecting context.
                SqlDataReader dr = commProc.ExecuteReader();
                string str;
                FlowDocument document = new FlowDocument();
                Paragraph paragraph = new Paragraph();
    
                if (dr.Read())
                {
                    str = (string)dr["Context"];
                    paragraph.Inlines.Add(new Bold(new Run(str)));
                    document.Blocks.Add(paragraph);
                    docview.RBox.Document = document;
    
                }
    
                dr.Close();
    
    
    
                var tabControl = (sender as DataGrid).FindParent<TabControl>();
    
    
                tabControl.Items.Add(new TabItem() { Header = "Документ", Content = docview, IsSelected = true });
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following statement SELECT id, descr from mytable which returns 1, 'Test1'
I have an xml file which contains query details like <queries> <query> <name>GetStudentById</name> <statement>select
I have a stored procedure which executes a select statement. I would like my
I have a Stored proc which returns 6 select statement results. I'm trying to
If I have a SQL statement such as: SELECT TOP 5 * FROM Person
I currently have a fairly long LINQ statement which pulls data from two tables:
I have a SQL query which retrieve wall post list $qry=mysql_query(SELECT senderid,post,date FROM .post_table.
I have a select statement with calculated columns and I would like to use
I have a select statement and in a couple of the fields, I want
I have a select statement, retrieve about 1000 record I want to modify it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.