In a form there's datasource, the datasource content is a table. this table is the datasource of a grid. then I have markChange override method on the table to do business logic when I'm selecting record/s on the grid.
Now the question is, if my form datasource is a Query how could I do the markChange event?
If you add a query to your datasources node of your form it should expand with all the tables in the query.
On the first table you can just override the markChanged method and it will be triggered when you select a record using the checkbox.
The markChanged is triggered on the first table though, not on the others.
Related
How can I bind a checkbox to filter a query in a table view? The datasource contains the field "active" and it is an inherited (relation) to the pages main datasource. I could create another datasource that filters on a parameter that is bound to the checkbox but this returns all results in the table do to losing the inherited (relation). Is there a better way to do this? I'd like to keep the inherited relation if possible.
I want to add ComboBox type control in GridView, how is it possible just like that?
You add an enum control to the grid control (not GridView). Also adding a string field with relation to a table (a foreign key) will give a lookup which is similar to combobox.
A good starting point is reading about form controls.
If I have 2 entities that share a navigation property (In my case an entity called Groups and one called Requirements) and I have a Gridview that displays Groups and another Gridview that I want to display the Requirements in the navigation property of the selected Group, should I pull in all the Requirements in the Requirements DataSource and then filter in the Gridview or should I filter in the DataSource?
I tried filtering in the Requirements DataSource by doing some Linq in the OnQueryCreated event, but I realized that OnQueryCreated is called when the page is loaded and then not again. Is there another event I should use?
Basically: Should I filter in the DataSource and if so where? If I should filter somewhere else, where?
I have my Items table bound to the repeater control. What if I want to display data from another table that is related to this one?
I'm using LINQ to SQL as the datasource in the codebehind.
In the repeater itemDataBound event get any data you need with LINQ and display what you need.
The datasource of the datagrid is a LINQDataSource which relies on the value of a dropdownlist. In addition, I want to use the footer to insert new records - so I'd prefer not to use the empty dataset template. I am trying to find a way to always display the footer regardless if the datasource is empty or not.
EDIT:
Is there a way to create an empty/invisible object of the type in the LinqDataSource?
check the following article:
http://weblogs.asp.net/joewrobel/archive/2008/01/30/a-more-elegant-solution-to-display-gridview-header-and-footer-when-the-data-source-is-empty.aspx