templatefield

Passing more than one argument in asp.net button in gridview

I have a TemplateField column in a gridview with a button inside of it. There is NO key value (surely that was not designed by me) , but in the other hand there aren't redundancies when comparing each single column, because they are events, and there is "starting date" and "ending date" of something that could not happen twice at the sa...

What is the best WebControl to create this

current output wanted output current code public partial class test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) populateData(); } private void populateData() { List<temp> ls = new List<temp>(); ls.Add(new temp { a = "A...

ASP.NET GridView sorting on method data

Hi, I'm binding a GridView to a domain model object, this domain model object has a method for working out a formatted value to display on the grid. I'd like to use this method for my display value, which is fine, but I'd also like to be able to sort on the value returned by that method. My sort expression can only take in a property/...

Binding data to a textbox , inside a templatefield of a gridview » C# and ASP.NET

How can I bind data to a textbox which is in a templatefield of a gridview ? I want to use ExecuteScalar , get a value and throw it to that textbox . ...

Dynamically enable asp button based on datasource value

SOLVED: See my solution below! using aspx with C# code behind. I have the following code in a button in a item template in a gridview: Enabled='<%# IIF(Eval("wrqst_need_ind") == "Y","TRUE","FALSE") %>' I am getting the following error: The name 'IIF' does not exist in the current context What am I doing wrong? I get the same erro...

add ItemTemplate Manually to create Checkbox column in TemplateField

I am creating the checkbox manually by adding templatefield and , but i cannot able to get the value of Checkbox Checked. my code: TemplateField tf = new TemplateField(); tf.ItemTemplate = new clsMyTemplate(); CheckBox chkCheckBox1 = new CheckBox(); tf.ItemTemplate.InstantiateIn(chkCheckBox1); chkCheckBox1.Checked = (DataBinder....

ASP.NET DetailsView changing field display for edit verses insert mode

For ASP.NET, I'm using a DetailsView for insert and edit of a record. For edit mode I don't want to display the primary key field because it should not be changed. For insert mode, I want to display the primary key field because it doesn't exist and the user can specify it via a DropDownList that insures they will pick an unique value. A...

ASP.NET 3.5 GridView Template Field Display Date If Not MinValue?

Hi guys, I have a rather simple problem with ASP.NET. I have a grid view with a template field. In the template field I have a label. I'm trying to set the labels text property to the date specified in a bound column if the datetime value is not the min value (in other words the date time field hasn't been set). I'm really not sure abou...

Explosif TemplateField

Hi, I have a custom server control that implement templatefield (textbox), what I want to do is when textchanged call enchurechangeevent () ? ...

TemplateField Not Updating In GridView using LINQDataSource

Im using a LINQDataSource to populate a GridView of Universities. Each University has an associated State, which is in another table and associated by a foreign key (StateID). I have a TemplateField in the GridView so that when you view it normally it displays the StateName which comes from the State table and when you edit it shows a ...

Validator offers no controls to validate.

I've created a DetailsView with a Calendar TemplateField. When I drag a RangeValidator near the calendar to try and validate the date range, the ControlToValidate dropdown property for the RangeValidator is blank and fails to display the Calendar control for me to select it. How can I get the RangeValidator to show the calendar in the ...