accessing item template controls of gridview without database

hi,

 I am having a gridview with Item Template Controls as below
////////////////////////////////////////////////////////////////////////////////////////////////
 
                
                  '--%>
                    
                        
                            
                            
                        
                                       
                   
                    
                                                
                           
                           01
                           02
                             
                                                  
                    
                    
                        
                                                        
                        
                                      
                                    
                   
                
            
////////////////////////////////////////////////////////////////////////////////////////////

I want to set the Label control text when a user clicks a button outside the gridview.

I dont want to show values from database....

Is it possible and if so how to do it..... or else is there any alternate way for it

Pls guide me ..... NEEDED IN URGENT...........
0
bhalajisw
1/15/2009 11:24:03 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
584 Views

Similar Articles

[PageSpeed] 5
Get it on Google Play
Get it on Apple App Store

  you can Change Label in text simply running a foreach loop on gridview on button click event like:

foreach(GridViewRow _Row in GridView1.Rows)
{
     Label objLabel = (Label)_Row.FindControl("LableId");
     if (objLabel != null)
     {
              objLabel = "any text";
     }
}
 
If this post helps you, please mark it as Answer.



Cheers,
Muhammad Rizwan Javed
Sr .Net Developer
Aim 168, Dubai, UAE.
0
Rizwan328
1/15/2009 12:06:32 PM
Reply:

Similar Artilces:

How do I access control on edit item template in DataView control?
I have a DataView control. I have a Template Field named MyNewTemplateField and in it's Edit Items Template I have a text box called "txtMyTextBox", which I want to do something with the data typed in, and then take that result and put it in the Access database.  Protected Sub DataView1_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewCommandEventArgs) Handles dvAcct.ItemCommand Select Case e.CommandName Case "Edit" Dim txtTheText As New TextBox txtTheText = DataView1.FindControl("txtMyTextBox"...

How to add the data present in the controls to a table control without any database involvement.
Hi All,i am four controls where i will write the text and once i click the add button those should get added to the table .i want 6 columns fixed in the table and rows as many as required.i tried doing that taking a table server control and able to load the table.but the problem is whenver i am adding a new row the old one is gfetting overwritten by this and at the end i am getting only one row.  System.Web.UI.WebControls.Table t1 = new System.Web.UI.WebControls.Table();  i have declared the below one global TableRow tr; TableCell tc1; TableCell tc2; TableCell tc...

Serverside Template Control
I've created a template control what I am running into difficults is during the Page_Load event on my web page I cannot access the child controls in the two possible templates. What I would like to be able to do is set the value or make some changes to the control at runtime but I have not been successful in gaining code access to the control, for example the TEXTBOX1 control in the EditTemplate template.     Does anyone know a good way to preform this task, let alone if I am even using the correct event Example of HTML Render  <aspSample:TextLabe...

How to access a child control in a templated control?
I am not sure how to access a child control that I addes to a templated control. For example: I drag a Login Control (ID: "Login1") into page in VisualStudio web developer, I can click on it and from the upper right of that control now in my desinger I can choose "convert to template".  Now I can drop in my own control to be added to the Login Control.  Let say I drag over a DropDownList control (ID: "DropDownList1") and place it at the bottom within the Login Control. At run time I might expect to access the my DropDownList control with somethin...

Accessing Child Controls of a Template Server Control
I've created a templated control that has a property called ContentTemplate which is of type ITemplate.  The control works great with the exception of I now have to interact with the child controls via the FindControl method. Markup: <test:MyControl ID="testControl" runat="server"> <ContentTemplate> <asp:Label ID="testLabel" runat="server" /> </ContentTemplate> </test:MyControl>    In order to interact with the child label, testLabel, I now need to do something like this:Dim lbl As La...

Cannot access a dropdownlist control inside the gridview control
I am using the Gridview control without a DataSource control. When I click on the Edit button, the page posts back and enters the following code: <code>     Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing         Try            Dim row As GridViewRow = GridView1.Rows(e.NewEditIndex)            Dim ddlCustomerID As DropDownList...

Access controls in Wizard control header template.
Is this possible?Web dev - spending forever achieving nothing. hi, suppose the control in the header template is a DDL with Id DropDownList1 access it this way DropDownList dp = (DropDownList)Wizard1.FindControl("headerContainer$DropDownList1");        Response.Write(dp.SelectedValue); hope it helpsJessica CaoSincerely,Microsoft Online Community Support“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community ...

Accessing controls inside User control template
Hi, I need to create a user control with one template. That template needs to be like View in MultiView or Wizzard control or Panel. It means, that controls, which are inside should be visible to the page. It will be created just once per control. I need to be able to write :  TextBox1.Text = "Hello world" not : (MyUserControl1.Controls.FindControl("TextBox1") as TextBox).Text = "Hello world" Thanks, radco  If this is a answer to your problem, mark it as answer in right upper corner. It helps other who read your article to known that...

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...

Hi, I use login control. My database in an MS access mdb file. How to set the access db to be the provider of the login control?
Hi I'm pretty new to security, so it may be a qstn of a begginer but i hope you'll help. I have an access db, and I use the login control. The login control uses the asp.net sql server as the provider right? but I want it to use my custom access database as the provider/database how can I do it?   Thanks for the help. The login control will use whichever provider is specified in the <Membership> section of your Web.config.  So in order to use your existing database, you'll probably want to create a custom membership provider.  There are lots of e...

A standardized method to access to controls that are within a Templated Control.
Hello, As all of us we know, lots of controls are of the type of "templated controls". This controls can hold, in any of their templated sets other controls. The problem arise when we try to access to the aforementioned controls in the code-behind/beside (I don't know yet how to name this model) file. Could be, in anyway, implemented a standardized way to access to those controls? Apologize my ignorance in this topic. Greetings.VB .Net Coder - Apologize my C# nescienceBest Regards. Hello. What are you trying to do? you can always use FindControl as your last resort, but maybe t...

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...

How to access page control (editor control) from user control?
Hi, I want to do something, but I don't know if it's even possible. I'm trying to make a simple application to edit my website. I have a page called editPage.aspx which contains an editor control. (cuteEditor from cutesoft) I also have a Treeview that dynamically populates my website structure. I placed this treeview in a custom control (populateTreeView.ascx) and placed it on the editPage.aspx page. When you click on a html file in the treeview (inside the custom control) I check if the file exists. If it does exists I send it to a class which retrieves the editable region within this ...

Accessing controls in EmptyData Template in a Gridview
I have a GridView - gv that is bound to an ObjectDataSource - ods. ods fetches the records from my data store. If there is no records (ods is empty), the EmptyData Template of gv is shown. I have a TextBoxe - tb and a Button - btn in EmptyData Template. The idea being, the user can create the first record by typing in tb and clicking btn. When the user clicks btn, I want to access the Text property of tb (tb.Text) so that I can add a record. To do this, I have to do the following:         Dim tb As TextBox = Me.gv.Controls(0).Controls(0).FindContro...

Web resources about - accessing item template controls of gridview without database - asp.net.presentation-controls

Highest Percentage Of Opera Mini Users Accessing Facebook? Macau
If you were asked to guess which country had the highest percentage of users of Opera mobile Web browser Opera Mini users accessing Facebook ...

International Users Accessing Facebook Places Through US VPN Accounts
By using a virtual private network (VPN) hosted in the United States, Facebook users from around the world are accessing Facebook Places. The ...

What are some alternatives to Yodlee for accessing bank information?
Clay Loveless , Founder, Jexy. Co-founder, Mashery. Founder, Jexy. Co-founder, Mashery.

Cloud Console - Accessing files in cloud storage for iPad on the iTunes App Store
Get Cloud Console - Accessing files in cloud storage on the App Store. See screenshots and ratings, and read customer reviews.

Meryl Streep On Accessing The Characters Within - YouTube
Meryl Streep talks about the importance of an actors work representing their ability. CONNECT WITH AFI: http://facebook.com/AmericanFilmInstitute ...

Accessing the Future Fund a sensible proposal, says super expert Daryl Dixon
As portfolios go, the Future Fund's asset allocation is concentrated in higher-risk investment, including equities and alternative assets.

Accessing my Super
I'm 57 - can I access my super?

Australia, US accessing Indonesian telephone data, leaked documents show
Newly disclosed documents from former US intelligence contractor Edward Snowden have revealed that Australian intelligence efforts against Indonesia ...

Euthanasia advocate Philip Nitschke detained at Melbourne Airport, accuses Customs officials of accessing ...
Euthanasia advocate Philip Nitschke has accused Customs officials of accessing hundreds of patients' sensitive records on his laptop after detaining ...

Frances Abbott scholarship: Sydney woman pleads guilty to accessing Whitehouse Institute records on PM's ...
A Sydney woman who leaked the student records of Tony Abbott's daughter pleads guilty. A Sydney woman who leaked the student records of Prime ...

Resources last updated: 11/22/2015 11:30:52 AM