Advertisement

03.13.2008 at 01:16PM PDT, ID: 23239996
[x]
Attachment Details

Getting DataItem out of a Selected GridView

Asked by jvancojr in C# Programming Language, Programming for ASP.NET, Visual Studio .NET 2005

Tags: c#

G Afternoon C# Gurus,
Yes, it is the VB coder floundering again in his conversion to C# ;)
I am trying to get the dataitems out of a selected row in a gridview.
(and I have already tried a couple of converters)
This is what I have:
 int i = gvAvailableEvents.SelectedIndex; (i does get set to an index number)
 GridViewRow drv = gvAvailableEvents.Rows(i);

error is:
Default.aspx.cs(182): error CS0118: 'System.Web.UI.WebControls.GridView.Rows' is a 'property' but is used like a 'method'"      string


I have tried:
DataRowView drv = (DataRowView)gvAvailableEvents.Rows[i].DataItem;
Doesn't return an error till i try and pull a DataItem out of it and thats when i find out drv is NULL

Again, something I could write in VB with my eyes closed....arggg.
Please help me find the hitch.....Start Free Trial
[+][-]03.13.2008 at 01:20PM PDT, ID: 21120439

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.13.2008 at 01:24PM PDT, ID: 21120467

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.13.2008 at 01:27PM PDT, ID: 21120508

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.13.2008 at 01:29PM PDT, ID: 21120528

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.13.2008 at 01:31PM PDT, ID: 21120545

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 12:22AM PDT, ID: 21123515

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 12:35AM PDT, ID: 21123546

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.14.2008 at 05:52AM PDT, ID: 21124950

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 09:38PM PDT, ID: 21131475

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, Programming for ASP.NET, Visual Studio .NET 2005
Tags: c#
Sign Up Now!
Solution Provided By: GreymanMSC
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628