Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Help with Gridview and templatefield column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rafia Tapia - 28 Jul 2007 15:10 GMT
Hi
I have a gridview control that is showing 6 column. The first column is a
buttonfield, then there are three boundfield and two template field control.
I am creating all these column in the page load event and initializing the
itemtemplate of the template field in rowcreated event. The problem is that
my templatefield shows a textbox and the value of the textbox in not retain
between postback.

Can anyone please help me.
Thanks
Masudur - 29 Jul 2007 05:44 GMT
> Hi
> I have a gridview control that is showing 6 column. The first column is a
[quoted text clipped - 6 lines]
> Can anyone please help me.
> Thanks

Hi... please override the oninit
protected override void OnInit(EventArgs e)
       {
           base.OnInit(e);
           BoundColumn column = new BoundColumn();
           ///your code goes here
           gdvData.Columns.Add(column);
           ///your code goes here
       }
and add all the column template and bound both in onInit...

The thing is dynamically added control does not persists on pages
control tree... after post back... so you got to make sure that every
thing again in place to persists the value of the controls....

Thanks
Md. Masudur Rahman (Munna)
Kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.