473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Change Format

Hi
I have a datagrid control that I want to be able to change the source SQL
statement for, I presume I can do this by setting the datasource property
and calling DataBind(). But how can I change the data formatting expression
property of a bound column at runtime, from within the C# code of my aspx
page?
I'm quite inexperienced with this so bear with me.

Thanks
Nov 18 '05 #1
3 1450
They're the same in number, but possibly not the same in format. For instance, I might have a toggle button that allows the user to switch between the three recordsets (which will appear in the same place
CompanyArea, WeekNumber, Sale
CompanyArea, WeekNumber, SalesVolum
CompanyArea, WeekNumber, SalesAsPercentOfCollection

etc...

but thanks for the sanity check - I think different grids sounds simpler I just wanted to make sure I wasn't doing something completely unnecessary!
Nov 18 '05 #2
Are the fields identical from one datasource to the other? If not, you might
be better off to have two grids, one for each datasource. You could hide the
one you don't want.

"Bonj" <a@b.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi
I have a datagrid control that I want to be able to change the source SQL
statement for, I presume I can do this by setting the datasource property
and calling DataBind(). But how can I change the data formatting
expression
property of a bound column at runtime, from within the C# code of my aspx
page?
I'm quite inexperienced with this so bear with me.

Thanks


Nov 18 '05 #3
They're the same in number, but possibly not the same in format. For instance, I might have a toggle button that allows the user to switch between the three recordsets (which will appear in the same place
CompanyArea, WeekNumber, Sale
CompanyArea, WeekNumber, SalesVolum
CompanyArea, WeekNumber, SalesAsPercentOfCollection

etc...

but thanks for the sanity check - I think different grids sounds simpler I just wanted to make sure I wasn't doing something completely unnecessary!
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Karam Chand | last post by:
Hello Is there anyway to change the default date format (possibly in a .ini or .cfg file) from YYYY-MM-DD to another format ? (ie, mm/dd/yyyy or any user-defined format). The useage that I'm...
1
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
4
by: Du | last post by:
I want to format the text within my richtextbox. However I have large amount of text to change, simply using richtextbox.select and format is not pratical. How do I change text format using...
1
by: Julius Fenata | last post by:
Dear all, I need help to change my item-template value format... Here is my case, I have a datagrid, with 'SubjectPrice' field, and when the grid displayed, my 'SubjectPrice' field displayed...
4
by: andreas.w.h.k. :-\) | last post by:
How do I change the address location in the wsdl <wsdl:port name="SearchSoap12" binding="tns:SearchSoap12"> <soap12:address location="http://searchservices/engine/search.asmx" /> </wsdl:port> ...
1
by: Tee GEE | last post by:
I included my VBA below. I would like to change the font of the "strBody" to be Bold, italic, color, etc. The code that I attempted to write is identified by ***. Any help would be appreciated....
13
by: sonald | last post by:
Hi, Can anybody tell me how to change the text delimiter in FastCSV Parser ? By default the text delimiter is double quotes(") I want to change it to anything else... say a pipe (|).. can anyone...
4
by: Orchid | last post by:
How can I change a Date datatype to a Number datatype? For example, I want a date 10/31/2006 to show 1031 as Number datatype. But I don't want it becomes 39021. What formula should I use? ...
2
by: DavidOwens | last post by:
SELECT DISTINCTROW Format(PERIOD.START_DT,"mmmm yyyy") AS MonthYear, SALES.PERIOD_ID, Sum(SALES.SALES) AS SumOfSALES, Sum(SALES.SALES_UNITS) AS SumOfSALES_UNITS, Sum(SALES.SALES_VALUE) AS...
3
by: Bface | last post by:
Hi all, Hope everyone had a good holiday. I am having a difficult time changing the date format of a field from Excel. I have never had this problem before. I link the excel spreadsheet to my DB,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.