Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
d[ - - ]b #1
Datagrid: aligning a template column
Hi,
Is it possible to align a template column? Tried align, textalign and
itemstyle (but I think that one is for the whole grid?), and nothing works.
It's a simple datagrid, but one field is a dollar ($) value, so I've had to
do a TemplateColumn so that I could make it have the '$'-sign and the
decimal places, but it's aligned to the left which is kinda ugly. Any ideas
how to change this column alone or another way to do this?
Many thanks,
Naomi
d[ - - ]b Guest
-
How to set different label value in datagrid template column?
Hi all, I have a datagrid with a stock label "lblStock". Here's is what i what to do : 1. If the quantity value retrieved from database is = 0... -
Problem with Template Column in Datagrid
When adding a template column to a datagrid the following error is displayed on page load. The datagrid is bound to a class and the fieldname does... -
Bound Column or Template Column (w dAdapater?) in DataGrid
I am able to get the data using DataAdapter and the DataReader. I am more inclined to use DataAdapter because I want to update the data on the SQL... -
Aligning the controls in the item template of the datagrid
I have got the datagrid control with item template property , and i want to align the textboxes or checkboxes in the header template of the... -
DataGrid / Template Column
I have a DataGrid with a template column (displaying a checkbox). The rows of the datagrid are being populated from a db table. Currently, only one... -
Amar #2
Re: Datagrid: aligning a template column
What i have done is create another table inside the TD
public void InstantiateIn(System.Web.UI.Control container){
CheckBox lc = new CheckBox();
lc.EnableViewState = true;
lc.DataBinding += new EventHandler(BindCol);
Literal startLC = new Literal();
startLC.Text = "<TABLE width=100% border=0 cellspacing=0
cellpading=0><TR><TD align=center>";
Literal endLC = new Literal();
endLC.Text = "</TD></TR></TABLE>";
container.Controls.Add(startLC);
container.Controls.Add(lc);
container.Controls.Add(endLC);
}
Hope it Helps!
"d[ - - ]b" <nospamplz@goaway.xyz> wrote in message news:<c8bsm7$ouv$1@lust.ihug.co.nz>...> Hi,
>
> Is it possible to align a template column? Tried align, textalign and
> itemstyle (but I think that one is for the whole grid?), and nothing works.
> It's a simple datagrid, but one field is a dollar ($) value, so I've had to
> do a TemplateColumn so that I could make it have the '$'-sign and the
> decimal places, but it's aligned to the left which is kinda ugly. Any ideas
> how to change this column alone or another way to do this?
>
> Many thanks,
> NaomiAmar Guest
-
d[ - - ]b #3
Re: Datagrid: aligning a template column
Ok, thanks Amar. I'll give it a go!
"Amar" <amaretos@yahoo.com> wrote in message
news:7c627043.0405172328.1a1bcb73@posting.google.c om...news:<c8bsm7$ouv$1@lust.ihug.co.nz>...> What i have done is create another table inside the TD
>
>
> public void InstantiateIn(System.Web.UI.Control container){
> CheckBox lc = new CheckBox();
> lc.EnableViewState = true;
> lc.DataBinding += new EventHandler(BindCol);
> Literal startLC = new Literal();
> startLC.Text = "<TABLE width=100% border=0 cellspacing=0
> cellpading=0><TR><TD align=center>";
> Literal endLC = new Literal();
> endLC.Text = "</TD></TR></TABLE>";
> container.Controls.Add(startLC);
> container.Controls.Add(lc);
> container.Controls.Add(endLC);
> }
>
> Hope it Helps!
>
> "d[ - - ]b" <nospamplz@goaway.xyz> wrote in messageworks.> > Hi,
> >
> > Is it possible to align a template column? Tried align, textalign and
> > itemstyle (but I think that one is for the whole grid?), and nothingto> > It's a simple datagrid, but one field is a dollar ($) value, so I've hadideas> > do a TemplateColumn so that I could make it have the '$'-sign and the
> > decimal places, but it's aligned to the left which is kinda ugly. Any> > how to change this column alone or another way to do this?
> >
> > Many thanks,
> > Naomi
d[ - - ]b Guest



Reply With Quote

