Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:817799
More Search Options
RSS Available
Matching Posts
Re: Get result of LinqDataSource
You do not need a type to use System.Collections.IList. Looks like you have "new {, , , }" as Linq select which effectively results in an anonymous type. If the e.Result needs to be modified, Reflection can be used. if (result != null && result.Count > 0) { var obj = result[idx]; Type t = obj.GetType(); System.Reflection.PropertyInfo pi = t.GetProperty("MyBooleanProperty"); if (pi.GetValue(obj, null) == null) { pi.SetValue(obj, false, null);//if null, set to false
Posted to
Data Access and ObjectDataSource Control
(Forum)
by
Mar7in
on 3/12/2009
Re: Get result of LinqDataSource
It is not exactly clear to me what you try to accomplish. I am guessing... :) - If each item in LinqDataSource result is bound to a GridViewRow, it would seem a good idea to handle RowDataBound. - You may want to handle LinqDataSource Selected event as followed: //LinqDataSource lds; //int idx; IList result = e.Result as IList; //you can cast the obj to its corresponding type if the type is *not* anonymous var obj = result[idx]; var propValue = DataBinder.Eval(obj, "MyProperty");//check
Posted to
Data Access and ObjectDataSource Control
(Forum)
by
Mar7in
on 3/12/2009
Re: formview prerender
Try: ( ( DropDownList )FormView1.FindControl( "ddlSet" )).SelectedValue = rowView[ "patSet" ].ToString();
Posted to
Data Presentation Controls
(Forum)
by
Mar7in
on 3/12/2009
Re: formview prerender
Are you trying to test how the compiler does its job? if ((rowView != null) && ((DropDownList) ( FormView1.FindControl("ddlSet")).Items.FindByValue(rowView["patSet"].ToString()) != null)) -> if ((rowView != null) && ((DropDownList)FormView1.FindControl("ddlSet")).Items.FindByValue(rowView["patSet"].ToString()) != null))
Posted to
Data Presentation Controls
(Forum)
by
Mar7in
on 3/12/2009
Re: Gridview column needs to be a link
One way of doing it is to use TemplateField, then use a LinkButton in ItemTemplate. The LinkButton (i.e. "Text" property) is bound to SQL column. After that, you have two options to handle the link clicked: 1. In Server-Side, you can use CommandName, CommandArgument, etc. and handle GridView's OnRowCommand 2. In Client-Side, you can use OnClientClick to add javascript handling code
Posted to
Data Presentation Controls
(Forum)
by
Mar7in
on 3/11/2009
Re: Pass Values when selecting a GridView to populate text boxes in a FormView -
' Find control in GridView selected row YourGridView.SelectedRow.FindControl("...") ' Find Control in FormView YourFormView.FindControl("...") You did not provide any source code. So the above is only the idea... Hope it helps.
Posted to
Data Presentation Controls
(Forum)
by
Mar7in
on 10/21/2008
Re: [LINQ] Delete data with relationships?
If your database is MS SQL, you can set "Delete Rule" to "Cascade" in your "Category" table designer - "Foreign Key Relationships" with "Content" table.
Posted to
Data Access and ObjectDataSource Control
(Forum)
by
Mar7in
on 10/18/2008
Re: LinqDataSource not using UpdateParameters as expected
You probably need to define a parameter for "ID" and/or DataKeyNames for your FormView update. To troubleshoot, handle FormView's OnItemUpdating event, and inspect FormViewUpdateEventArgs for properties/values...
Posted to
Data Access and ObjectDataSource Control
(Forum)
by
Mar7in
on 10/17/2008
Re: DetailsView Update and Cancel commands
Is this what you were looking for? < asp:DetailsView ID= "YourDetailsView" runat= "server" ... > < Fields > < asp:CommandField ButtonType= "Link" SelectText= "MySelect" UpdateText= "MyUpdate" CancelText= "MyCancel" DeleteText= "MyDelete" /> </ Fields > </ asp:DetailsView >
Posted to
Data Presentation Controls
(Forum)
by
Mar7in
on 10/17/2008
Re: how can detect string encoding in c#.net
.NET string is a sequential collection of Unicode characters. The whole purpose of Unicode makes precise encoding detection very difficult if not impossible. http://www.codeproject.com/KB/recipes/DetectEncoding.aspx makes a very good attempt, not 100% bullet-proof, but it is like "best-bet".
Posted to
Web Forms
(Forum)
by
Mar7in
on 10/14/2008
Page 1 of 7 (68 items) 1
2
3
4
5
Next >
...
Last ยป
Channel 9:
Nick Baker: Xbox Architecture
TechNet Edge:
Thrive Live! Behavioral Interviewing: A behavioral answer is always the correct answer
ASP.NET:
PDC and Tech-Ed Europe Slides and Code
WindowsClient:
JScript location bar silliness
WindowsClient:
Anybody build a XAML parser in C or C++ yet?
WindowsClient:
Silverlight use, power and deployment keeps growing; so does WPF
ASP.NET:
T4CSS: A T4 Template for .Less CSS With Compression
WindowsClient:
JSON-P: An Elegant Hack
Channel 9:
Photosynth Update and New UI
Channel 9:
First Look: Streetside in Bing Maps
Channel 9:
Coding4Fun at PDC 2009
WindowsClient:
10 Must-See PDC 09 Sessions
Channel 10:
Photosynth Updated with New Release and New UI
Channel 10:
WindowsBlinds 7 Now Works with Windows 7
Channel 10:
Zune HD Launches New Colors
ASP.NET:
PDC09: ASP.NET MVC 2: Ninjas Still on Fire Black Belt Tips
ASP.NET:
Hanselminutes Podcast 188: ASP.NET MVC 2 Beta with Phil Haack
ASP.NET:
Hanselminutes Podcast 186: .NET Debugging 101 with Tess Ferrandez
TechNet Edge:
WinRE and free stuff with Sean Kearney
WindowsClient:
XslCompiledTransform and large template elements
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online