Solved

How to dynamically add a custom row to a DetailsView

Posted on 2009-05-12
3
615 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now