Silverlight Datagrid - Getting The Data? - asp.net

This may sound stupid....I've followed Scott Morrisons Blog and have implemented a silverlight datagrid and populated it with some data. My question now is, when I edit the datagrid and change some of the data, how do i then retrieve it back?! I guess what i'm trying to say is - does it get posted back somewhere!?

Well, when you bind your columns of your data grid to the properties, you should specify that the binding is a two-way binding. This will update the back end data as the grid data is changed.
For a more thorough read, you should look at this article.

Following Brad Abrams MIX09 tutorials located on his blog has ALL the answers I could have possibly ever wanted when starting out with such a powerful framework.
Brad's Blog

Related

Posting variable data

I am building an application in ASP.NET, C#, MVC3 and SQL Server 2008.
A form is presented to a user to fill out (name, email, address, etc). I would like to allow the admin of the application to add extra, dynamic questions to this form.
The amount of extra questions and the type of data returned will vary. For instance, the admin could add 0, 1 or more of the following types of questions:
Have you a full, clean driving liscence?
Rate your drivings skills from 1 to 5.
Describe the last time you went on a long journey?
etc ...
Note, that the answers provided could be binary (Q.1), integer (Q.2) or free text (Q.3).
How would I allow the posting of 0, 1 or more random values from the form back to my code?
Any help would be greatly appriecated.
Thanks in advance.
PS. I asked a similar question regarding the storing of this data in sql, see here
You will need to use an EAV scheme for storage. For a discussion of the topic, along with common pitfalls and solutions, see Best Practices for Semantic Data Modeling for Performance and Scalability. Other alternatives are Sparse Columns and XML data type column, but I think EAV is superior most of the times.
You'll have to accomplish this using dynamic controls.
Basically you'll read the question list from your database, inject zero or more custom controls to emit the question(s) and accept the answer(s). Probably wrapped in a repeater.
On post back you'll have to rehydrate the dynamic controls so that you can get the values.
I have done this before when I worked on a survey tool.
So first of all you need to decide what questions type you'll have. I had SingleOption, MultiOption and FreeText type questions.
User logs into the admin screen and selects a type of question he wants to add. He then clicks on Add button, which submits a request to a controller/web service.
Controller looks at type of question and adds a record into the database.
Rough table structure below:
QuestionID | SurveyId | QuestionTypeId
2 4 1
This is your basic structure.
When you generate an interface for answering questions, you will retrieve all questions with a SurveyId = 4.
You will then write an HTML helper that looks at question type and generates an appropriate control.
When it comes to submitting a survey, or answers to your question, you will display all questions and answer fields in some div, say we call it "survey_questions". Inside this div will be a form which will contain all your questions and controls for answers (text inputs, checkboxes etc).
You will then submit this form through jQuery to a controller/web service. Controller/Web Service will read survey id and it will iterate through all submitted values.
You will then use these values to populate a table for storing survey results. I understand that this is very brief and abstract, but I have worked over a month on this, so if this is useful and you need further help, then please ask.
I found a great article that solves my problem.
You can find it here

is there a DevExpress XtraReports event that fires after all widgets of a details subreport got printed, like for formatting?

I want to be able to go through all instances of a printed details subreport and do some formatting of records, in part by computing stuff for one record based on another one already printed. The code that prints reports is a bit of a mess, so I think this particular issue is easiest to handle by a kind of postprocessing of a printed report rather than by changing the underlying data binding etc code.
Well, frankly, I am unable to find a way even to get to the point where I could format text records in a single XRTable (XRTable.AfterPrint event does not work for me here) let alone format one XRTable based on values output in another one.
Any suggestions? Is this a FAQ with a standard answer or a FAQ with "we are tired of telling people it cannot be done" answer?
There is no such event :(. A possible solution I've posted by answering
does DevExpress XtraReports have an easily accessible notion of “current detail report being printed”?
question.

Flexigrid- How to bind data to flexigrid(jquery)?

I am trying to use flexigrid(jquery) to display my data.. I have downloaded some examples but somehow i have not been able to figured out "How to bind the data to flexigrid" which i am fetching using ajax, and which currently is in array.. Basically i dont know how tryconvert my data in Json object.. Or is their any other way(I dont want to use php file to return my data).. and also please refer some useful links which i can follow to learn flexigrid in detail right from basics.. Most of the sites which i refered dont go in much details about flexigrid... I know, this 1 is very stupid, but I cant help as I have just beginned using flexigrid...
I think this explains everything pretty well. Flexgrid asp.net mvc

DevExpress Xtrareports using a Business object as a datasource

I am trying out DevExpress Xtrareports, but have asimple problem that I am not able to find an answer to.
In an Asp.net website project, I want to add a business object to my report as a datasource and then drag and drop the fields from my new business object data source onto the report designer.
Can some one help explain how i do this.
I asssume I have just missed something.
Thanks
Ian
One way to solve this would be to give the designer a DataSet with one or more DataTables representing your business object. You would of course have to write some code to convert your business object to the data table and back.
As a side note DevExpress have a really good support forum and I have always gotten answers to my questions regarding their products. I recommend you try your question there unless you get a really good answer.

Suggestions on which ASP.NET control to use?

I've received a project for internal use. My application has to store about 100 rows of meta data of a game and each row has about 15 fields maximum. Fields can be game name, game category, maker, source code path, etc. I will most likely have to join about 5-10 tables for each row of record. Only a few people are using it and will receive very little hits. Speed performance is not a much of an issue. The rows of data I have to present must be sortable and searchable
My current solution is to use ASP.NET's GridView control with ASP.NET's AJAX UpdatePanel to give it that ajax feel. I'm thinking of using LINQ-to-SQL as my data access layer. I'm thinking of building my own custom search engine but if there's an existing control that has this feature already, i would prefer to use that; anyone know of such control exist? Anyways what do you guys think?
Update #1:
I'm looking into creating a DynamicData website. Any have thoughts on that?
Use ext.js!
Look at the Grid Samples, its a very shallow learning curve and provides you with amazing results in little to no time.
http://extjs.com/products/extjs/
Basically, you expose your data via a web service (asmx or WCF, your choice), throw the Ext.Js grid onto your html/aspx page and point it at your webservice. Configure the control for things like sorting/searching/expanding/grouping/paging etc (use the api reference http://extjs.com/deploy/dev/docs/).
ASP.NET Dynamic Data looks really cool, particularly for sites where you've got:
lots of data
not a lot of worries about performance
no / little desire to skin / design the site
no / little desire to extend existing / write new functionality.
So I'd say that's a good match for your project.
Gridview is your best bet. It's so powerful if you know how to use it correctly. It does automatic sorting and if you can code pretty well you can get the data to be filterable(if that's a word). It also makes the Connection to the database for you....so in my opinion, you can't beat the gridview when it comes to reports like that.

Resources