help me! WHY CAN THE TOP GRIDVIEW DETECT CONTROLS BUT THE SECOND GRIDVIEW NOT DETECT CONTROLS?!

Hi guys,

two gridviews, same page, but one cant define paramters, the other one can.  the one that works is the first example, the one that doesnt work is the second example.  what is the difference? if you could highlight why example two doesnt detect contorls that would be great!!!

example one

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"

AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan"

BorderWidth="1px" CellPadding="2" DataKeyNames="AuthorID" DataSourceID="ObjectDataSource2"

ForeColor="Black" GridLines="None">

<FooterStyle BackColor="Tan" />

<Columns>

<asp:BoundField DataField="AuthorID" HeaderText="AuthorID" InsertVisible="False"

ReadOnly="True" SortExpression="AuthorID" />

<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />

<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />

<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />

<asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />

<asp:HyperLinkField DataNavigateUrlFields="AuthorID" DataNavigateUrlFormatString="Details.aspx?AuthorID={0}"

HeaderText="Details" Text="detail" />

</Columns>

<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />

<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />

<HeaderStyle BackColor="Tan" Font-Bold="True" />

<AlternatingRowStyle BackColor="PaleGoldenrod" />

</asp:GridView>

 

Example two - doesnt work

 

<asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True"

AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan"

BorderWidth="1px" CellPadding="2" DataKeyNames="AuthorID" DataSourceID="ObjectDataSource4"

ForeColor="Black" GridLines="None" Style="z-index: 102; left: 17px; position: absolute;

top: 528px">

<Columns>

<asp:BoundField DataField="AuthorID" HeaderText="AuthorID" InsertVisible="False"

ReadOnly="True" SortExpression="AuthorID" />

<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />

<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />

<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />

<asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />

</Columns>

<FooterStyle BackColor="Tan" />

<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />

<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />

<HeaderStyle BackColor="Tan" Font-Bold="True" />

<AlternatingRowStyle BackColor="PaleGoldenrod" />

</asp:GridView>


Chu = Noob, please help
0
chukwa
8/5/2008 1:46:04 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
801 Views

Similar Articles

[PageSpeed] 23

Are the DataSource's meant to be the same for both GridView's?

You have ObjectDataSource2 and ObjectDataSource4.

If you use the same DataSource's, what happens?

So let both DataSourceID's be mapped to ObjectDataSource2 .. e.g DataSourceID="ObjectDataSource2" 


There's a myth that if we were really good at programming, there would be no bugs to catch.


If my reply has answered your question, please mark the reply as "Answer".
0
fezian
8/5/2008 6:00:32 PM
Reply:

Similar Artilces:

gridview control in another gridview control
Hi ia have a questioni have a gridview control which contains button in one colum.now my question is i need another gridview to be placed in the  first gidviewso that when i click on the button the second gridview will populate the data.now my question is how to place second gridview in first gridview.or is there any approach like first grid itself acting as parent and child.please help me  Hi sirikalavalapalli:                I think nested gridview will help you. Check this link and it will show you how...

Help Req: !!! :- On Disabling Controls Present inside a Gridview control
Hi All, We have A requirement Where we have disable controls inside a grid.These controls can be textbox, DropDownlist (in TemplateField), ComandField present inside the grid.We have to call a generic method for doing the same .(since it can be done for multiple grid.) PFB the code snippet we use. Which disables all the controls inside the page.The bolded part of the code is used to loop inside a grid view.(Not Working.)Is this ideal way to deal with the requirement.Or can someone suggest be a better way.        public void DisableMe(Page p1, st...

Gridview control embedded in another gridview control
I am writing an ambulance crew scheduling application on the web and I need some help completing the last part.  I have an access database that has three tables: user table, shift table (describing the shifts available), and a schedule table (that stores shift by shift_id and user by user_id).  I have a gridview control that will display the available shifts but I cannot get the embedded gridview control that will display the user that is signed up for each shift to display because I cannot figure out how to use the OnRowDataBound method.  I need a simple VB example of how to...

Getting the control id of a control inside gridview control
 uhmm.. a little bit confusing regarding my subject because i dont know how to say it...by the way my problem is how can i get the id of a control (e.g. textbox) inside the gridview... and the textbox is in the templatefield... is there any way i can get its id??  hoping i could get a reply as soon as possible... Regards,MhaeyPlease remember to click “Mark as Answer” on the post that helps you.. =) What do you want's to do by getting the id of the Text box? Do you want's to find particular Textbox with certain id ? Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MC...

There is a Gridview Control in the tmplate field of another GridView Control.
    For instance,a gridview displays the information of the  students in a class.A table is recording the information except their mark.There is another table recording the mark of the students whose foreign key is the primary key of the previous table.   string strSQLconnection=".................."; SqlConnection sqlCononection=new SqlConnection(strSQLconnection); SqlCommand sqlCommand=new SqlCommand("select * from stuendent where classID=1",sqlConnection); SqlConnection.Open(); SqlDataReader reader=sqlCommand.ExecuteReader(); GridVie...

How can I control the width of a column in the GridView control.
From searching I see mention of ways to do it before the controls are bound. Is there a simpler way? If not, could someone explain to me how I need to go about it?Here is the code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id"        DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display."        OnSelectedIndexChanged="GridView1_SelectedIndexChanged">   &nbs...

can we use gridview control with in repeater control
HI all,     Can i use gridview control with in repeater control, Any one knows plzzz... let me know. Is there any possibility for this?      It is urgent required... plzzzz... help me..  ------------- ThanksBalu Chandaka  yes you can nest a gridview control in the repeater controlJeev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~If you get the answer to your question, please mark it as the answer. Hi Jeev,    Thank you for your reply.But how can do that give some idea or If you have any example code snippet then plzzz... let m...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

SqlDataSource Control and Gridview control
Hi, I'm new to web development and learning about these controls.  The books teach you to bind the gridview control to an sqldatasource to perform delete,update,insert functions as well as to list the records in a table.  Is this standard practice for real world applications?  Or is there another way that should be used to display/manage table data in the gridview control? Thanks. Tulsi Using a sqldatasource is the best way I know of for binding data to a gridview.  (I'm pretty new to web development too, so maybe someone else can chime in if they know someth...

Precise Control over GridView controls?
Hi.When you create a GridView in visual studios and bind it to, say, an SqlDataSource, it automatically creates fields and templates according to the types retrieved from the data source. (ie, it creates a Label for number/string columns, checkboxField for booleans, etc). My question: How do I control precisely what WebControls/Fields are used for each column?thanks,Tombow Hi Tombow Using TemplateFields you can control that explicitly.  See the Data Tutorial #12 at http://www.asp.net/learn/dataaccess/default.aspx?tabid=63 for more details. Hope that helps. AaronDon't...

using controlS to control a gridview
This question is probably posted but i did not bother to look at 10,000+ posts so i am sorry. I've seen the tutorial where he builds a dataset and uses a gridview and controls the gridview with the drop down list box. What i am trying to do is to control the gridview with 2 drop down list boxes. First select the Country you life in and then the State. I've looked at the grid view properties but couldn't find where i can add another parameter. Is it possible to control a grid view (or any form of displaying the information) with more than 1 controller? Thank You.  ...

validation controls in gridview control
hi, I m using the grid view to add,edit,update,delete the data table. Everything is fine.In the footertemplate i get the values through text boxes and drop down lists.i took place sm validation controls to validate these controls.the problem arises here.if i want to update the record after i click the edit button, it validate the page n dont allow me to update the record.I want to validate the particular controls only. i checked if any causes validation property for update button.there is nothing like that. pls help me.. thanks in advance gowri  regards,gowripillaimark as answer if...

Edit data with GridView Control ? or another control ? help
I use GrivView in ASP.Net 2.0 to show data from DataTable. And i want to edit some fields in some rows. How can I do it? If i touch EDIT button - all columns, which have ReadOnly=false, switch into EDIT mode. But I want, that in first raw I can edit 2,3 column and in second row only 3 column. How can I do it ? ...

Need help binding data to GridView control inside a Repeater control
Hi, How do I bind data to a GridView control that is inside a Repeater control?Thanks,Sam Looks like I bind the data to the Repeater control then handle binding individual sets of data to GridViews in the Repeater's OnItemDataBound event. Is this correct? If so, how do I pull the data back into DataTable in the OnItemDataBound event so that I can further process it i.e. slice it up so that I can bind it to multiple GridViews?Thanks,Sam Hi SamU, Yes, you can handle ItemDataBound event of Repeater to generate the data source of inner GridView. The data source (such as DataTable) of ...

Web resources about - help me! WHY CAN THE TOP GRIDVIEW DETECT CONTROLS BUT THE SECOND GRIDVIEW NOT DETECT CONTROLS?! - asp.net.presentation-controls

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Grassfire near Leneva in Victoria's north-east now under control, fire authorities say
A grassfire burning near Leneva in Victoria's north-east is now under control, fire authorities say.

Publicis Said to Weigh Bid for Control of Cheil Worldwide
Publicis Groupe is weighing a bid for a controlling stake in Cheil Worldwide, people with knowledge of the matter said. The French company is ...

Oregon Pharmacists May Prescribe Birth Control - Al Jazeera America
Oregon is the only state to allow pharmacists to prescribe hormonal patches and the pill; California will soon follow

Playing around with BMW’s 7 Series gesture control user interface
We take a BMW 7 Series for a short drive to play with its gesture control. Video shot/edited by Jennifer Hahn. (video link) LAS VEGAS—Yesterday, ...

BMW recalls i8 for stability control problem
... , BMW , Safety , Coupe , Hybrid , Performance BMW will recall a small number of 2015 i8s because of a problem with the dynamic stability control ...

Embracing the NRA on gun control
I’m just stealing a massive post from Stonekettle Station on a plausible path forward towards sanity on guns: Those laws should be designed ...

This IBM programmer can control a BB-8 droid from 'Star Wars' with his mind
... decided to take Sphero's excellent "Star Wars: The Force Awakens" BB-8 app-powered droid and take it a step further with the ability to control ...

Want to Stay Comfortable? Ask Government to Mandate Temperature Controls on Thermometers
... ” should be considered for summer months, e.g. a maximum allowable temperature reading of 85 degrees Fahrenheit on all thermostats to control ...

Will gun control sink gun stocks?
Could new gun control measures hurt gun stocks? Boris Schlossberg of BK Asset Management and Gina Sanchez of Chantico Global discuss with Brian ...

Resources last updated: 1/14/2016 3:04:53 AM