Questions tagged [templatefield]

182 questions
2
votes
2 answers

How to 2-way bind a textbox in a template fields programmatically

I have a gridview to which I'm adding template fields programmatically. Each of the template fields have a textbox. I would like to make this text box have 2-way binding to a database column. Please see below code. public class…
userb
  • 21
  • 1
  • 2
2
votes
0 answers

Insert and remove Template textbox column in grid view

class TextColumn : ITemplate { private string controlId; private string cssClass; public TextColumn(string id, string cssClass = "inputFromTo") { controlId = id; this.cssClass = cssClass; …
Er. ßridy
  • 553
  • 2
  • 6
  • 20
2
votes
0 answers

Extending Gridview Templatefield making it reusable

I made this work, but not in an appropirate way. I'm working with .NET 4.0 and these would be my needs: I work with a big bunch of gridviews that essentially shows the same kind of controls and works in the very same way. What i've tried is creating…
2
votes
1 answer

Seeing Events in Properties window for controls in EditItemTemplate

My application is using ASP.NET Webforms. I am trying to see the events for a control (a button control in this case) that I have in an EditItemTemplate. The events don't show in the Properties window when I select the control in the Source view;…
MikeC
  • 208
  • 3
  • 12
2
votes
1 answer
2
votes
1 answer

GridView Template - How to Grab Data from Selected Row

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91
2
votes
1 answer

updatecommand in asp page not working

ok i have solved my last question by using update parameters instead und putting templatefields on my gridview instead of boundfields. it is displayed alright, only thing is the update button doesn't seem to work. when i click it, it just returns to…
LeonidasFett
  • 3,052
  • 4
  • 46
  • 76
2
votes
3 answers

How to add TemplateField created in .aspx markup to GridView column in code behind?

Basically, I want a button that adds a new column with my controls (i.e. TextBox, DropDownList) to my GridView. Already seems simple enough with this: protected void btn_AddColumn_Click(object sender, EventArgs e) { TemplateField MyTemplateField…
SymphonyX7
  • 23
  • 1
  • 5
2
votes
1 answer

How to control TemplateField order

I have a grid view where the columns is generated dynamically through the code [AutoGenerateColumns="false"] with one TemplateField but also I am creating another TemplateField from ASPX How can I control the order of these two TemplateField For…
Noora
  • 319
  • 3
  • 10
  • 26
2
votes
3 answers

Reading variable into NavigateUrl in TemplateField in GridView asp.net 4 c#

I am new to programming. I have created a GridView and used SqlDataSource to bind. Grid presents several variables from SQL Server database, including hypertext links. For a particular field I need to: - evaluate a database field "Journal_title" -…
Tim Bacon
  • 41
  • 2
  • 4
1
vote
3 answers

change templatefield column location in gridview

i have and grid view which i set an templatefield in it. in addition i set a datasource dynamically in code behind. now the templatefield appears as the first column, and i want to move it to be the 5 one, and also disable another column. how can i…
Aviadjo
  • 635
  • 5
  • 17
  • 36
1
vote
1 answer

How to Retain the Styling / Hover Functionality of Image Hyperlinks in a GridView TemplateField using ImageButtons

Within each row of a GridView (using the TemplateField), I would like to display image buttons that will be used to control the data in that row. I would then like to swap out the images of the buttons when a user first hovers over the GridView row…
1
vote
1 answer

Sitecore: Hide data template field from page editor

I have 2 data template fields "title" and "id", used for the HTML page title and the id attribute in the body tag respectively. When the page is viewed using Page Editor, Sitecore attempts to render editor controls on these items and because they…
Ronnie Liew
  • 18,220
  • 14
  • 46
  • 50
1
vote
2 answers

SortExpression in ASP.NET GridView not working with

I have an ASP.NET GridView. Now I am adding the SortExpression property tothe tags, to make specific columns sortable. Now, one of the columns has some markup content to be added in the header. The problem is, SortExpression does…
Agniva De Sarker
  • 778
  • 2
  • 12
  • 22
1
vote
2 answers

GridView loses column contents during PostBack

I am having an issue with the behavior of a GridView between post backs. The real problem comes from a TemplateField I define in the markup at column[0] with a child CheckBox control. Things work fine for the first, and second search executions.…
jwrightmail
  • 907
  • 1
  • 13
  • 24
1 2
3
12 13