Solved

How to dynamically add a custom row to a DetailsView

Posted on 2009-05-12
3
616 Views
Last Modified: 2013-11-08
Hi,

I want to add a custom row to a DetailsView from the code behind.

Please help!
0
Comment
Question by:robaherne
  • 2
3 Comments
 
LVL 28

Expert Comment

by:chilternPC
ID: 24365450
ok.
without seeing what you have already I would use a few tests with IF statemetns to add in the custom row for writing to the clients screen
0
 

Author Comment

by:robaherne
ID: 24365496
This is what I have so far...

// Create new Template
TemplateField jobdate = new TemplateField();

// Set the fields header
 jobdate.HeaderText = "Job Time";

//Now I want to set the value of the field but I don't know how!
//Something like jobdate.FieldText = "16:30"; would be nice but it doesn't exist.

// And finally Add the field to the DetailsView
grid_JobTable.Fields.Add(jobdate);
0
 

Accepted Solution

by:
robaherne earned 0 total points
ID: 24366072
Nevermind... I found a work around.

I added a column to the datatable that was to bind with the details view, entered a custom value into that field and then created a standard databound field to pick up hte value.

Thanks anyways
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question