Change Format

  • Thread starter Thread starter Bonj
  • Start date Start date
B

Bonj

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
 
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.
 
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!
 
Back
Top