.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

DataFormatString in a BoundField of a GridView

Posted By: Rahul     Posted Date: January 01, 2010    Points: 2   Category :ASP.Net
 
I had a simple little problem - the DataFormatString="{0:0}" in a BoundField was not working


View Complete Post


More Related Resource Links

DataFormatString not working in GridView even if HtmlEncode="false"

  

Hello everybody,

My following bound column in GridView is not displayed with the currency formatting that I have apllied.

Please help me to find the solution. I am able to format my columns for Date but not for numbers and currency. somewhere i found that putting HtmlEncode="false" will work. But it is also not working in my case.

<asp:BoundField DataField="LoanAmount" HeaderText="Loan Amount" SortExpression="LoanAmount" DataFormatString="{0:C}" HtmlEncode="false">

 thanks in advance. please help me to find the solution.

 regards,

bikash


Gridview: can we use asp:TemplateField and asp:BoundField both in a single grid??

  

Hello everybody

can we use asp:TemplateField and asp:BoundField both in a single grid??

If yes then how to handle deleteCommand on serial number. mean to say how to write query for that field as it is not any column of databse..

for e.g--

 

<Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
                <asp:TemplateField HeaderText="Serial No">
                    <ItemTemplate>

gridview boundfield

  

Hi Friends,


how to create calculated column using boundfield in gridview?

i want to create a new column using the existing records?

can help me?


how to create calculated column with gridview boundfield?

  

Hi Friends.....

can you guide me how to create calculated column with gridview boundfield?



Thanks in advance.........


JavaScript Compare BoundField and TextBox in a GridView

  

Hi everyone. 
Below I have a BoundField and a TextBox.
When the user moves away from the TextBox, I need to compare the BoundField (minQty) and the TextBox (Qty).
How do I pass the values of the BoundField and TextBox to a Javascript eg. CheckMinQty(Qty,minQty) when the user moves away from the TextBox?

GridView, BoundField, SqlDataSource and DeleteParameters

  

Hello All,

I I have a GridView attached to a SqlDataSource and all is working well.  I also have and edit and delete icon attached to each record in the GridView, and again, all is working well.

My problem is when I add a BoundField named 'statusCode', the delete stored procedure fails with:

"Procedure or function 'up_delReference' expects parameter '@statusCode', which was not supplied."

When I remove the BoundField named 'statusCode' from the GridView list, the delete works fine.  I need to show the status in the GridView as the user can chose to see Avtive, Inavtive or Both records and they need to see the status when in Both.

Here is the Code:

<asp:GridView ID="GridViewList" runat="server" DataSourceID="SqlDataSourceList" DataKeyNames="refID" >
	<Columns>
		<asp:TemplateField HeaderText="Action">
			<ItemTemplate>
				<asp:ImageButton ID="ImageButtonEditDetail" runat="server" SkinID="IconEdit" CommandName="Edit" ToolTip="Edit Record" />
				<asp:ImageButton ID="ImageButtonDelete" runat="server" SkinID="IconDelete"  CommandName="Delete" ToolTip="Delete Record" OnClientClick

Inplace Edit in GridView

  
In this article I am presenting a different way to look at EditItemTemplate, using which user navigation for editing is reduced and . it looks very different (see screeen shots) then regular implementation of GridView.

GridView Confirmation Box Using JQuery BlockUI in asp.net

  
JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

Textbox Editable GridView in ASP.NET

  
This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

AJAX GridView Checkbox Select All in ASP.Net

  
In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

AJAX GridView Paging and Sorting using C# in ASP.Net

  
To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

GridView Paging Using Ajax in ASP.Net

  
To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

Displaying Row Details Tooltip on GridView using JQuery

  
Continuing exploring JQuery! I decided to implement a feature to display some kind of details related to a row displayed on GridView. For example when displaying employees details on GridView some information might not fit in the GridView because it will make it huge and wide. These infomration can be diplayed as Tooltip. Or when you want to display a picture and some kind of formated text to be diplayed as tooltip when mouse hover on the image.

jQuery: Highlight Gridview Rows with Checkbox

  
Im learning and experimenting with jQuery and ASP.NET. Below is a simple solution I created to highlight rows in a gridview by clicking on a checkbox next to the row.

Gridview setup:

Sortable GridView using jQuery's TableSorter

  
This article explains how to use jQuery's plug-in Tablesorter to implement client-side sorting in an ASP.NET GridView. This comes in handy especially when an ObjectDataSource is used with a GridView as GridView does not provide sorting out of the box.

Sorting Gridview using Jquery with ASP.NET

  
I want to show how to sorting a gridview using a Jquery in ASP.NET, it is a flexible client-side table sorting. We have known that Jquery is a new kind of Javascript Library. You can find detail of Jquery in this site http://jquery.com/ there are lot of example with documentation and also allow free download a latest version.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend