How did textboxes bind to a selected row of a RadGridView in the provided example named "BugTracker"?

6 posts, 0 answers
  1. pluie
    pluie avatar
    3 posts
    Member since:
    Apr 2014

    Posted 10 Apr 2015 Link to this post

    Hello,

    In the provided sample project named BugsTracker, how did the textboxes in the detailPageView bind to a selected row of that bugsGrid?

    I mean, there will be corresponding detail message shown in the textboxes when I select one row of bugsGrid.

    How was that done?I read the codes but I couldn't find out the entry.

    thanks in advance.

  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 10 Apr 2015 Link to this post

    Hello Pluie,

    Thank you for writing.

    The editors are bound to the underlying DataSet via simple data binding:
    titleTextBox.DataBindings.Add(new Binding("Text", dataSet.Tables["Issue"], "Title"));

    see the BindControls() method.

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. pluie
    pluie avatar
    3 posts
    Member since:
    Apr 2014

    Posted 10 Apr 2015 in reply to Stefan Link to this post

    Hi Stefan,

    thank you for your answer.

    I thought this titleTextBox.DataBindings.Add()  method just bind titleTextBox's Text property to the dataTable's Title property.

    There is a OnSelectedRowChange event handler,but it is just used for ReadOnlyControls() method.The ReadOnlyControls() method just change controls' ReadOnly Property rather than Text Property.

    Then how could titleTextbox know  when the selected row of dataGrid changes and after that it can changes its own Text property?

    Regards.

     

    Posted 28 minutes agoLink to this post

    Hello Pluie,

    Thank you for writing.

    The editors are bound to the underlying DataSet via simple data binding:

    titleTextBox.DataBindings.Add
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 10 Apr 2015 Link to this post

    Hi,

    It knows as both the text box and the grid are bound to the same data source. So when the grid changes the selected row, the CurrencyManager Position will change, which will notify the text box and it will automatically change its text, thanks to the data binding I mentioned in my previous post.

    Here is a nice article on the data bindings in WinForms, which you might find useful: http://www.akadia.com/services/dotnet_databinding.html.

    I hope that the provided information addresses your question.

    Regards,
    Stefan
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. pluie
    pluie avatar
    3 posts
    Member since:
    Apr 2014

    Posted 10 Apr 2015 in reply to Stefan Link to this post

    So that's how it is!

    Sorry for bothering with this kind of question.

    And I really appreciate your patience in reply.

    Thank you very much and have a good day!

  7. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 10 Apr 2015 Link to this post

    All the best to you too.

    Stefan
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready