Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Designer to Define Grids
Message
 
 
To
02/02/2010 07:53:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01446780
Message ID:
01447091
Views:
29
>>I think I found how to work with the VS designer on specifying columns of the grid in designer. I just want to be sure that I am not going to break something later.
>>
>>Here is what I did (everything in Design Mode):
>>
>>1. Click on Smart Tag (that little thingie at the top of the control)
>>2. When grid Grid_Tasks window is open I click on Choose Data Source. (Initially only my BindingSource was visible there. But that didn't do any good as it was not showing any columns).
>>3. I click on Add Project Data Source. This opens Data Source Configuration window.
>>4. In the prompt "Where will application get the data" I click on Object (the other 2 choices are DataBase and Web Service. Then click on Next.
>>5. Then I see all the projects in my application. I go to the DataSets project and drill down to the Data Table of the Data Set that should be used for this grid.
>>6. Then, once the data table is set as a Data Source for the grid I can add/remove columns and set certain properties.
>>Everything seem to work.
>>
>>The only concern is that now below the form (in the designer) there are 2 data sources: 1. Binding Source that I set up when I was designing this form 2. DataTable binding source (result of the steps above).
>>
>>Is it a problem that the form has two binding sources? One of them is used for all the controls and another for grid?
>>
>>Thank you for any input/suggestions on this topic.
>
>Dmitry,
>It should work. However, I suggest you to, on a new empty form:
>-Show data sources window (Data\Show Data Sources).
>-Connect and add your tables there
>-Drag&drop one of the tables on to form (creates grid by default and adds needed BindingSource etc)
>-Right click on table and select details
>-Drag&drop again and this time you also get fields in detail mode
>
>You can run and later check what it writes. Especially note that BindingSource has both DataSource and DataMember set. In your case probably you were missing the datamember.
>
>PS: Have you ever thought of using Linq instead. Future is in there (say - my personal opinion).
>Cetin

Cetin,

I think you are right about missing DataMember. I was just reading about it this morning in the Data Binding book I have. And I will try what you suggested. Thank you very much.

As to your suggestion on Linq. I have heard a lot this term mentioned here but have not looked into it. I am concerned that it is a new concept all together for me and I will get stuck learning it. But since you mentioned, can I ask you a couple of questions (very newbie)?

1. Will Linq work on WinForms applicaiton?
2. Do I need to install anything additional on each client for Linq to work?
3. Can you describe Link in a paragraph understandable to a very newbie person in .NET?

Thank you in advance.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform