This is a migrated thread and some comments may be shown as answers.

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

5 Answers 139 Views
GridView
This is a migrated thread and some comments may be shown as answers.
pluie
Top achievements
Rank 1
pluie asked on 10 Apr 2015, 08:56 AM

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.

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 10 Apr 2015, 11:18 AM
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.

 
0
pluie
Top achievements
Rank 1
answered on 10 Apr 2015, 11:58 AM

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
0
Stefan
Telerik team
answered on 10 Apr 2015, 01:21 PM
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.

 
0
pluie
Top achievements
Rank 1
answered on 10 Apr 2015, 01:47 PM

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!

0
Stefan
Telerik team
answered on 10 Apr 2015, 01:57 PM
All the best to you too.

Stefan
Telerik
 

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

 
Tags
GridView
Asked by
pluie
Top achievements
Rank 1
Answers by
Stefan
Telerik team
pluie
Top achievements
Rank 1
Share this question
or